bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems with pthread application on mips


From: Thomas Haber
Subject: problems with pthread application on mips
Date: Fri, 14 Dec 2001 15:44:09 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010923

gdb version:     5.1
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)


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









reply via email to

[Prev in Thread] Current Thread [Next in Thread]