public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: loic.gautheur@wanadoo.fr To: gdb-gnats@sources.redhat.com Subject: threads/2371: gdbserver can't step in thread Date: Thu, 29 Nov 2007 10:18:00 -0000 [thread overview] Message-ID: <20071129101602.13799.qmail@sourceware.org> (raw) >Number: 2371 >Category: threads >Synopsis: gdbserver can't step in thread >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: support >Submitter-Id: net >Arrival-Date: Thu Nov 29 10:18:01 UTC 2007 >Closed-Date: >Last-Modified: >Originator: loic.gautheur@wanadoo.fr >Release: GDB 5.3 >Organization: >Environment: GDB 5.3 and GDBSERVER 5.3 under debian woody >Description: Hi, I have a problem using gdbserver 5.3 for debuging multi-threaded applications. If I use gdb 5.3 to debug the application everything works. my problem is when I put a breakpoint in a thread and the thread encounter the breakpoint the application stops, then i try to STEP to the next line and then if I use gdb the application run ,execute other threads and stop on the next line (normal behaviour ) but when using gdbserver the application receive a SIGTRAP and stop. PS: Attached you can find the traces I've got first using GDB and after using GDBSERVER Loic Gautheur >How-To-Repeat: use the print-threads.c program in the testsuite of gdb set slow to 1 then put a breakpoint at line 43 run the application when you encounter the breakpoint clear it and then use the STEP command. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="bug_gdbserver" Content-Disposition: inline; filename="bug_gdbserver" /********************* normal behaviour using GDB **********************/ (gdb) br print-threads.c:43 Breakpoint 2 at 0x8048667: file print-threads.c, line 43. (gdb) r Starting program: /i500/test/a.out [New Thread 1024 (LWP 210)] [New Thread 2049 (LWP 211)] [New Thread 1026 (LWP 212)] Print 1, thread 0 [New Thread 2051 (LWP 213)] Print 1, thread 1 [Switching to Thread 1026 (LWP 212)] Breakpoint 2, thread_function (arg=0xbffffcdc) at print-threads.c:43 43 if (slow) (gdb) clear print-threads.c:43 Deleted breakpoint 2 (gdb) s Print 2, thread 1 Print 3, thread 1 45 printf ("Print 2, thread %d\n", my_number); (gdb) s Print 4, thread 1 Print 5, thread 1 Bye from 1 Print 2, thread 0 [New Thread 3076 (LWP 214)] Print 1, thread 2 Print 2, thread 2 46 sleep (1); (gdb) s Print 3, thread 2 Print 4, thread 2 Print 5, thread 2 Bye from 2 [New Thread 4101 (LWP 215)] Print 1, thread 3 Print 2, thread 3 47 printf ("Print 3, thread %d\n", my_number); (gdb) c Continuing. Print 3, thread 3 Print 3, thread 0 [New Thread 5126 (LWP 216)] Print 4, thread 3 Print 4, thread 0 Print 1, thread 4 Print 5, thread 0 Print 2, thread 4 Print 5, thread 3 Bye from 0 Bye from 3 Print 3, thread 4 Print 4, thread 4 Print 5, thread 4 Bye from 4 Done Program exited normally. /********************* end of normal behaviour with GDB *******************/ /********************* PROBLEM using GDBSERVER **************************/ (gdb) target remote localhost:2345 Remote debugging using localhost:2345 0x400012d0 in ?? () (gdb) c Continuing. [New Thread 1024] [New Thread 1026] [Switching to Thread 1026] Breakpoint 1, thread_function (arg=0xbffffcec) at print-threads.c:43 43 if (slow) (gdb) clear print-threads:43 No source file named print-threads. (gdb) clear print-threads.c:43 Deleted breakpoint 1 (gdb) s Program received signal SIGTRAP, Trace/breakpoint trap. [Switching to Thread 1024] 0x4005187f in sigsuspend () from /lib/libc.so.6 (gdb) s Single stepping until exit from function sigsuspend, which has no line number information. 0x4001c879 in __pthread_wait_for_restart_signal () from /lib/libpthread.so.0 (gdb) c Continuing. Program exited normally. /********************* END of PROBLEM GDBSERVER **************************/
next reply other threads:[~2007-11-29 10:18 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-11-29 10:18 loic.gautheur [this message] 2007-11-30 14:58 Daniel Jacobowitz 2007-12-05 10:58 Martine GAUTHEUR 2007-12-05 13:50 drow
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20071129101602.13799.qmail@sourceware.org \ --to=loic.gautheur@wanadoo.fr \ --cc=gdb-gnats@sources.redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).