Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jan 2005 16:46:51 +0100 (CET)
From:      mk@capri.pl
To:        sparc64@freebsd.org
Subject:   gdb troubles with threaded program
Message-ID:  <Pine.LNX.4.44.0501141632490.2316-100000@grendel.oldford.pl>

next in thread | raw e-mail | index | archive | help
Hello,

I'm trying to debug multi-threaded program (my own work), but unexpected 
things happen.
On startup, I set breakpoint within one of the threads. Program is 
started, some time passes, gdb stops at the breakpoint. Just as expected.
Then I try to single step through the code, and this is weird: sooner or 
later, but always, happens this:

(gdb) n
0x000000004092820c in sigprocmask () from /lib/libc.so.5
(gdb)
Single stepping until exit from function sigprocmask,
which has no line number information.
0x00000000407a4390 in _thread_kern_scheduler () from /usr/lib/libc_r.so.5
(gdb)
Single stepping until exit from function _thread_kern_scheduler,
which has no line number information.
0x00000000407a4b20 in _thread_kern_sched_state_unlock () from 
/usr/lib/libc_r.so.5
(gdb) thread
[Current thread is 0 (process 10819)]
(gdb) n
Single stepping until exit from function _thread_kern_sched_state_unlock,
which has no line number information.
0x00000000407a4120 in kevent () from /usr/lib/libc_r.so.5
(gdb)
Single stepping until exit from function kevent,
which has no line number information.
0x00000000407a4b30 in _thread_kern_sched_state_unlock () from 
/usr/lib/libc_r.so.5
(gdb)
Single stepping until exit from function _thread_kern_sched_state_unlock,
which has no line number information.
0x00000000407a45f0 in _thread_kern_scheduler () from /usr/lib/libc_r.so.5
(gdb)
Single stepping until exit from function _thread_kern_scheduler,
which has no line number information.

Breakpoint 1, lb731_get_log_record (comm=0x2d2800, 
cp=0x7fdffed9598)
    at ../../../../src/drivers/lb731/lb731.c:1537
1537                    if (ptr[0] == 0x00)


After stepping through some pthreads (?) code (as shown above), execution 
returns to my function, but it's other place than before.
Quite often it just hangs after few steps through this - no return to my 
code, Ctrl-C does nothing, I have to kill gdb externally.

Machine is Ultra2, FreeBSD 5.3 RELEASE.

What's going on ?

-- 
Michal Konieczny
mk@capri.pl



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.44.0501141632490.2316-100000>