public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Gautham Thavva" <gautham.thavva@lycos.com>
To: "Daniel Jacobowitz" <drow@mvista.com>
Cc: gdb@sources.redhat.com
Subject: Re: Debugging a Multi-threaded application on PowerPC 82xx...
Date: Wed, 09 Apr 2003 20:16:00 -0000	[thread overview]
Message-ID: <DNAHGFOPLFFOJCAA@mailcity.com> (raw)


Hi Daniel,

I have read in the archives that you are yet to write a FAQ and already answered this question 5 or 6 times. Please bear with me
for one more time.

A quick recap: I am running a multi-threaded application on
PowerPC 8260 and trying to debug it with gdb-5.3 

In the previous reply, you had asked me to set the solib-absolute-
prefix. I set solib-absolute-prefix and still couldn't debug.
I then built the application as a static executable and tried
to debug it. It got stuck at the system calls in the application.

I then tested the system calls with a test program.
---------------------------------------------
#include <pthread.h>
#include <stdio.h>
#define NUM_THREADS     5


void *PrintHello(void *threadid)
{
<##3##>   printf("\n%d: Hello World!\n", threadid);
   pthread_exit(NULL);
}

int main (int argc, char *argv[])
{
   pthread_t threads[NUM_THREADS];
int rc, t;

<##1##>   system("mkdir story");
   system("rm -rf story");

   for(t=0;t < NUM_THREADS;t++){
<##2##>      printf("Creating thread %d\n", t);
      rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t);
if (rc){
         printf("ERROR; return code from pthread_create() is %d\n", rc);
         exit(-1);
      }
   }
   pthread_exit(NULL);
-------------------------------------------------------------------

I put a breakpoint at points shown by <##X##> in the above code.
It hit breakpoint 2 and 3 but never hit breakpoint 1
I placed the system calls in the main function to exclude
the possibility of gdb not handling system calls in threads.

Please can you tell me how I can resolve this issue. 
I appreciate your help.

with regards,
Gautham Thavva



On Mon, 24 Mar 2003 15:43:57  
 Daniel Jacobowitz wrote:
>How does DDD invoke GDB?  I bet it uses --symbols or the symbol-file
>command.  Don't Do That!  Use "file" or just "gdb gtest" instead.
>Fix DDD or say "file gtest" before saying "target remote".
>
>You also need to have your target libraries present on the host system
>and pointed to by solib-absolute-prefix or solib-search-path.
>
>And I (or someone else!) should write more bulletproof documentation
>about this since it is obviously a FAQ.
>



____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus

             reply	other threads:[~2003-04-09 20:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-09 20:16 Gautham Thavva [this message]
2003-04-09 20:59 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2003-03-24 20:38 Gautham Thavva
2003-03-24 20:50 ` Daniel Jacobowitz
2003-03-22 21:06 Gautham Thavva
2003-03-22 21:35 ` 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=DNAHGFOPLFFOJCAA@mailcity.com \
    --to=gautham.thavva@lycos.com \
    --cc=drow@mvista.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).