Ok , compiled gdb 5 from sources, and its still doesn't work for me - here's
the lay down :
this is a simple program that uses pthreads :
<snip>
void * tmp(void *a)
{
while (1)
{
printf("yo\n");
sleep(10000);
}
return 0;
}
int main(void)
{
pthread_t threadInfo;
int ret = pthread_create(&threadInfo,0,tmp,0);
pthread_detach(threadInfo);
printf("main %d \n",ret);
sleep(100000000);
return 0;
}
</snip>
Now, Running it using gdb :
$ gdb ./threads
(gdb) list
28 printf("yo\n")
(gdb) b 28
Breakpoint 1 at 0x8048650: file main.cpp, line 28.
(gdb) r
Starting program: /home/oded/threads/threads/./threads
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Program received signal SIG32, Real-time event 32.
0x1ce17e in sigsuspend () from /lib/libc.so.6
(gdb) yo
<comment>
now, the last line is what is displayed on the screen - I didn't actually
written "yo" at the gdb prompt. this comes from the printf where execution
should have stopped.
</comment>
(gdb) info threads
(gdb)
<comment>
this just means that nothing is displayed when I issue 'info threads'
</comment>
I didn't really understand that warning message, but pthread is compiled
only as a static library on my system, so I assume 'threads' is linked
staticly with libpth, and I have no idea what the dynamic linker wants from
me.
Oded
--
It was state of the art, he said.
The art in this case was probably pottery.
-- Terry Pratchett and Neil Gaiman, "Good Omens"
----- Original Message -----
From: "mulix" <[EMAIL PROTECTED]>
To: "Oded Arbel" <[EMAIL PROTECTED]>
Cc: "Linux-IL Mailing list" <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 14:21
Subject: Re: GDB and PThreads
> On Mon, 19 Mar 2001, Oded Arbel wrote:
>
> > Hello All
> > I'm having problems debugging with GDB and Pthread.
> > GDB doesn't show any notice of the threads that are created and I
> > cannot set breakpoints in the other threads. When running info
> >
> > I'm using GDB 5.0 - gdb-5.0-4mdk
>
> try compiling and installing gdb 5.0 from src. try the latest gdb
> snapshot.
>
> personally, i'm using gdb 5.0 (release) compiled from source, and it works
> fine in the presence of threads.
>
> [mulix@alhambra ~]$ gdb --version
> GNU gdb 5.0
>
> --
> mulix
> http://www.advogato.com/person/mulix
>
> linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead
>
>
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]