From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30147 invoked by alias); 27 Oct 2005 10:27:04 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 30132 invoked by uid 22791); 27 Oct 2005 10:26:56 -0000 Received: from web32913.mail.mud.yahoo.com (HELO web32913.mail.mud.yahoo.com) (68.142.206.60) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Thu, 27 Oct 2005 10:26:56 +0000 Received: (qmail 88387 invoked by uid 60001); 27 Oct 2005 10:26:55 -0000 Message-ID: <20051027102655.88385.qmail@web32913.mail.mud.yahoo.com> Received: from [203.193.55.70] by web32913.mail.mud.yahoo.com via HTTP; Thu, 27 Oct 2005 03:26:55 PDT Date: Thu, 27 Oct 2005 10:27:00 -0000 From: Peter Choi Subject: [NEED HELP] Problem to multithread remote debugging with GDBserver To: gdb@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2005-10/txt/msg00154.txt.bz2 Hi, I've heard that GDB 5.3 onwards has supported remote debugging multiple thread programs, but I still fail to do so. I wonder what I have done wrong. I work with a x86 host and a x86 target, both with linux kernel 2.4.22 (FC1 actually). I worked on a test program below, linked with glibc: #include #include #define NUM_THREADS 5 void *thread_function(void *arg) { printf("Hello World from %d!\n", arg); sleep(10); pthread_exit(NULL); } int main(int argc, char *argv[]) { pthread_t threads[NUM_THREADS]; int i; for (i = 0; i < NUM_THREADS; i++) pthread_create(&threads[i], NULL, thread_function, (void *)i); for (i = 0; i < NUM_THREADS; i++) pthread_join(threads[i], NULL); return 0; } First we set everything up and connect: (gdb) set solib-search-path /usr/local/cris/r59/cris-axis-linux-gnu/lib/ (gdb) set solib-absolute-prefix /dev/null/ (gdb) set remotetimeout 60 (gdb) target remote 10.84.130.10:2222 Remote debugging using 10.84.130.10:2222 0x35557608 in ?? () Next we set a breakpoint in main after all threads have been created: (gdb) break 20 Breakpoint 1 at 0x80568: file hello.c, line 20. Now send the program on its way: (gdb) c Continuing. On the host computer side, I fail to see other threads, other than the main thread. As a result, I fail to set breakpoint on the other threads. I have downloaded source code of GDB6.3 and compiled my own GDB & GDBSERVER. But it still can't see the other threads on the host side. SO, I wonder what I have done wrong. What option do I need to specify to compile GDB/GDBSERVER in order to support multithread remote debugging ????? Pls HELP. Thank you for your attention. Regards. Peter Choi __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com