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]

problem for next step command in all-stop multithreaded mode


i'm debugging 2 threads executing the same program.
i put 2 breakpoints, one on main() and the second on exit(), called at
the end of my program.

after loading my program and doing run my program stop at the breakpoint
I setted at main () ; (see the infrun report)

///////////////////////////////////
(gdb) run
infrun: clear_proceed_status_thread (thread 2)
infrun: clear_proceed_status_thread (thread 1)
infrun: proceed (addr=0xffffffff, signal=0, step=0)
infrun: resume (step=0, signal=0), trap_expected=0
infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
infrun: target_wait (-1, status) =
infrun:   1 [thread 1],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x80000330
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping

Breakpoint 1, main () at xprintf.c:13
//////////////////////////////


i change the thread and i do a next command. (here i expect gdb to
singlestep the thread 1 over its breakpoint and then handling the
deferred step of  the thread 2)

//////////////////////////////////
(gdb) info thread
  2 thread 2  main () at xprintf.c:13
* 1 thread 1  main () at xprintf.c:13

(gdb) thread 2
[Switching to thread 2 (thread 2)]#0  main () at xprintf.c:13

(gdb) n
infrun: clear_proceed_status_thread (thread 2)
infrun: clear_proceed_status_thread (thread 1)
infrun: proceed (addr=0xffffffff, signal=144, step=1)
infrun: resume (step=1, signal=0), trap_expected=1
infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
infrun: target_wait (-1, status) =
infrun:   1 [thread 1],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x80000334
infrun: handling deferred step
infrun: resume (step=1, signal=0), trap_expected=0
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun:   1 [thread 2],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x80000334
infrun: switching back to stepped thread
infrun: Switching context from thread 2 to thread 1
infrun: resume (step=0, signal=0), trap_expected=0                 /*
GDB here is telling to the target to continue instead of doing a next */
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun:   1 [thread 1],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x80000694
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_stepping
[Switching to thread 1]

Breakpoint 2, exit (status=0) at exit.c:27
///////////////////////////////


My problem here is despite my next command gdb act as if i did a
continue command ; so if somebody have already had this problem, please
give me some hints to fix it




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