This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bug in GDB while stepping over pthread_create() on x86 and powerpc


Hi,

I'm still working on this bug http://sourceware.org/ml/gdb/2006-11/msg00233.html.

GDB looses the software single-step breakpoint after stepping over pthread_create(), if the created thread uses dlopen() to refer to a new shared library.

I looked through the output from gdb given by using "debug infrun". This is the result, when stepping over pthread_create native:

infrun: stop_pc = 0x8048626
infrun: stepping inside range [0x80485fe-0x804862e]
infrun: resume (step=1, signal=0)
infrun: prepare_to_wait
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED

infrun: stop_pc = 0x80484b8
infrun: stepped into subroutine
infrun: resume (step=0, signal=0)
infrun: prepare_to_wait
[New Thread -1209021536 (LWP 10622)]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED

infrun: stop_pc = 0x4961ba84
infrun: BPSTAT_WHAT_SINGLE
infrun: step-resume breakpoint
infrun: resume (step=1, signal=0)
infrun: prepare_to_wait
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED


If I do the same using gdbserver, I got the following result:


infrun: stop_pc = 0x8048626
infrun: stepping inside range [0x80485fe-0x804862e]
infrun: resume (step=1, signal=0)
infrun: prepare_to_wait
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED

infrun: stop_pc = 0x80484b8
infrun: stepped into subroutine
infrun: resume (step=0, signal=0)
infrun: prepare_to_wait
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x804862b
infrun: BPSTAT_WHAT_STEP_RESUME
infrun: stepping inside range [0x80485fe-0x804862e]
infrun: resume (step=1, signal=0)
infrun: prepare_to_wait
[New Thread 10682]
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x45d3c3c9
infrun: context switch
infrun: BPSTAT_WHAT_CHECK_SHLIBS
infrun: no stepping, continue
infrun: resume (step=1, signal=0)
infrun: prepare_to_wait
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED

GDB lost its stepping bp and just runs to the end.

This occurs both on x86 and powerpc and I think on most of the other archs that use gdbserver, too. I think this is somehow a timing problem. I guess that error also can occur when not debugging remotely.

Has someone an idea where this error could be located at?

If someone wants to test it on another platform, please let me know and I'll send you my testcase.



Regards,
Markus

--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]