This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdbserver + pthreads on arm


Hello,
I'm having problems debugging a multithreaded program running on an
embedded system using gdbserver to a i386-linux host. Setting a
breakpoint for a thread other than the main thread causes gdb to stop at
a point where it can not provide any useful information -- i.e., it can
not read the stack frames and can not continue to execute the program.  

On the host:
$ gdb/gdb --version
GNU gdb 6.3
Copyright 2004 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 "--host=i686-pc-linux-gnu
--target=armv5l-linux".

gdb/gdb ~/Code/MyCode/arm-tests/gdb-thread-test 
GNU gdb 6.3
Copyright 2004 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 "--host=i686-pc-linux-gnu
--target=armv5l-linux"...
(gdb) target remote 192.168.1.135:4888
Remote debugging using 192.168.1.135:4888
0x40002980 in ?? ()
(gdb) break mainLoop
Breakpoint 1 at 0xabcc: file gdb-thread-test.cpp, line 20.
(gdb) handle nostop SIG32
Signal        Stop      Print   Pass to program Description
SIG32         Yes       Yes     Yes             Real-time event 32
(gdb) c
Continuing.

Program received signal SIG32, Real-time event 32.
Cannot remove breakpoints because program is no longer writable.
It might be running in another process.
Further execution is probably impossible.
Cannot access memory at address 0x400ef82c
(gdb) where
Cannot access memory at address 0x400ef82c
(gdb) quit
The program is running.  Exit anyway? (y or n) y

On the target:
$ ./gdbserver :4888 gdb-thread-test
Process gdb-thread-test created; pid = 236
Listening on port 4888
Remote debugging from host 192.168.1.45
ptrace: bogus breakpoint trap
Killing inferior

The host (i386-linux) gdb was compiled with a different gcc version than
the gdbserver for arm-linux. Should I build a new toolchain for the
arm-linux target?

$ gcc --version
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

$ arm-linux-gcc --version
2.95.3

The host is running RedHat Linux with a 2.4.20 kernel. The target is
running a linux 2.4.19 kernel from the Familiar linux distribution.

Thanks for any advice,

David Bacher
dbacher@dustnetworks.com

Attachment: gdb-thread-test.cpp
Description: gdb-thread-test.cpp


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]