Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Peter Choi <peter_tkchoi@yahoo.com>
To: gdb@sources.redhat.com
Subject: [NEED HELP] Problem to multithread remote debugging with GDBserver
Date: Thu, 27 Oct 2005 10:27:00 -0000	[thread overview]
Message-ID: <20051027102655.88385.qmail@web32913.mail.mud.yahoo.com> (raw)

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 <pthread.h>
    #include <stdio.h>
    #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


             reply	other threads:[~2005-10-27 10:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-27 10:27 Peter Choi [this message]
2005-10-27 12:47 ` Daniel Jacobowitz
2005-10-27 13:25   ` David Lecomber
2005-10-27 13:50     ` Daniel Jacobowitz
2005-10-28  1:55   ` Peter Choi
2005-10-28  3:05     ` Daniel Jacobowitz
2005-10-28  4:50   ` Peter Choi
2005-10-28  4:58   ` Peter Choi
2005-10-28 12:47     ` Daniel Jacobowitz
2005-10-31  1:51       ` Peter Choi
2005-10-31  4:20         ` Daniel Jacobowitz

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=20051027102655.88385.qmail@web32913.mail.mud.yahoo.com \
    --to=peter_tkchoi@yahoo.com \
    --cc=gdb@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: link
Be 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