This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/286: Gdb is currently not able to debug a pthread linked application on linux-mipsel targets.
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 21 Jan 2002 14:18:03 -0000
- Subject: Re: gdb/286: Gdb is currently not able to debug a pthread linked application on linux-mipsel targets.
- Reply-to: Daniel Jacobowitz <drow at mvista dot com>
The following reply was made to PR gdb/286; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@mvista.com>
To: thaber@tee.toshiba.de
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/286: Gdb is currently not able to debug a pthread linked application on linux-mipsel targets.
Date: Mon, 21 Jan 2002 09:12:32 -0500
This is a bug in glibc. It has been explained to the libc developers
several times; see the archives of the libc-alpha list on
sources.redhat.com.
On Mon, Jan 21, 2002 at 12:07:43PM -0000, thaber@tee.toshiba.de wrote:
>
> >Number: 286
> >Category: gdb
> >Synopsis: Gdb is currently not able to debug a pthread linked application on linux-mipsel targets.
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Mon Jan 21 04:08:01 PST 2002
> >Closed-Date:
> >Last-Modified:
> >Originator: thaber@tee.toshiba.de
> >Release: 5.1
> >Organization:
> >Environment:
> config: mipsel-unknown-linux-gnu
> platform: mipsel (tx49 toshiba)
> linux: Red Hat Linux release 7.0 (MIPS) Kernel 2.4.6 on
> a mips
> compiler: gcc version 2.95.3 20010315 (release)
>
>
>
> >Description:
> Hi all,
>
> currently we are not able to debug a pthread linked application with gdb ...
>
> GNU gdb 5.1
> Copyright 2001 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and
> you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for
> details.
> This GDB was configured as "mipsel-unknown-linux-gnu"...
> (gdb) break main
> Breakpoint 1 at 0x40091c
> (gdb) run
> Starting program: /home/teehab/DVB/Linux/Default/test2
> [New Thread 1024 (LWP 380)]
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> [Switching to Thread 1024 (LWP 380)]
> warning: Warning: GDB can't find the start of the function at
> 0x40080000.
>
> GDB is unable to find the start of the function at 0x40080000
> and thus can't determine the size of that function's stack frame.
> This means that GDB may be unable to access that stack frame, or
> the frames below it.
> This problem is most likely caused by an invalid program counter or
> stack pointer.
> However, if you think GDB should simply search farther back
> from 0x40080000 for code which looks like the beginning of a
> function, you can increase the range of the search using the `set
> heuristic-fence-post' command.
> 0x40080000 in ?? ()
>
>
>
> When setting heuristic-fence-post to 20 the result is ...
>
> (gdb) break main
> Breakpoint 1 at 0x40091c
> (gdb) run
> Starting program: /home/teehab/DVB/Linux/Default/test2
> [New Thread 1024 (LWP 382)]
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> [Switching to Thread 1024 (LWP 382)]
> Cannot access memory at address 0x4007fffc
>
> The test application compiled with 'gcc test.c -lpthread -o test' :
>
>
> #include <pthread.h>
>
> #define MAX_THREAD 40
>
> void* function(void*p)
> {
> while(1) printf("X%i",(int)p);
> return 0;
> }
>
>
> int main(int argc, char *argv[])
> {
> int i=0;
>
> pthread_t threadID=-1;
>
> for(i=0;i<MAX_THREAD;i++)
> {
> pthread_create(&threadID, NULL, function, (void*)i);
> }
>
> return 0;
> }
>
> Thanks for your help,
>
> tom haber
>
>
>
>
>
>
>
>
> >How-To-Repeat:
>
> >Fix:
>
> >Release-Note:
> >Audit-Trail:
> >Unformatted:
>
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer