public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdbserver on arm and multithreading again
@ 2003-07-17  8:11 unknown
  2003-07-17 13:35 ` Jon Ringle
  0 siblings, 1 reply; 4+ messages in thread
From: unknown @ 2003-07-17  8:11 UTC (permalink / raw)
  To: gdb

Hi

I read many postings about this, but I cannot get it working. :(

My Testprogram:
--
#include <stdio.h>
#include <pthread.h>
#include <sched.h>

void * Thread1( void * p )
{
  char * ptr = 0;
  *ptr = 0; // Make Segfault in Thread
  return NULL;
}


int main( int argc, char ** argv )
{
  pthread_t pid;
  pthread_create( &pid, NULL, Thread1, NULL );
  pthread_join( pid, NULL );
  return 0;
}

-----------------------------------------------------------

I built gdbserver like this:

frank@ruhe:/arbeit/gdbserver$ export
CC=/usr/local/arm-linux/bin/arm-linux-gcc
frank@ruhe:/arbeit/gdbserver$
../gdb+dejagnu-20030716/gdb/gdbserver/configure
--prefix=/usr/local/arm-linux arm-unknown-linux-gnu
creating cache ./config.cache
checking for gcc... /usr/local/arm-linux/bin/arm-linux-gcc
checking whether the C compiler (/usr/local/arm-linux/bin/arm-linux-gcc 
) works... yes
checking whether the C compiler (/usr/local/arm-linux/bin/arm-linux-gcc 
) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether /usr/local/arm-linux/bin/arm-linux-gcc accepts -g...
yes
checking host system type... arm-unknown-linux-gnu
checking target system type... arm-unknown-linux-gnu
checking build system type... arm-unknown-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking how to run the C preprocessor...
/usr/local/arm-linux/bin/arm-linux-gcc -E
checking for ANSI C header files... yes
checking for sgtty.h... yes
checking for termio.h... yes
checking for termios.h... yes
checking for sys/reg.h... no
checking for string.h... yes
checking for proc_service.h... no
checking for sys/procfs.h... yes
checking for thread_db.h... yes
checking for linux/elf.h... yes
checking for stdlib.h... yes
checking for unistd.h... yes
checking whether strerror must be declared... no
checking for lwpid_t in sys/procfs.h... yes
checking for psaddr_t in sys/procfs.h... yes
checking for prgregset_t in sys/procfs.h... yes
checking for prfpregset_t in sys/procfs.h... yes
checking whether prfpregset_t type is broken... yes
checking for elf_fpregset_t in sys/procfs.h... yes
checking for libthread_db... -lthread_db
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h

after make...

frank@ruhe:file gdbserver
gdbserver: ELF 32-bit LSB executable, ARM, version 1 (ARM), for
GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped

-------------------------------------------------------

Ok, then I start gdbserver and connect with gdb.

(gdb) target remote 192.168.0.127:2222
Remote debugging using 192.168.0.127:2222
0x000080e0 in _start ()
(gdb) c
Continuing.
#
Program received signal SIGSEGV, Segmentation fault.
0x0000f354 in __sigsuspend (set=0xbffffc48) at
../sysdeps/unix/sysv/linux/sigsuspend.c:55
55      ../sysdeps/unix/sysv/linux/sigsuspend.c: Datei oder Verzeichnis
nicht gefunden.
        in ../sysdeps/unix/sysv/linux/sigsuspend.c
(gdb) bt
#0  0x0000f354 in __sigsuspend (set=0xbffffc48) at
../sysdeps/unix/sysv/linux/sigsuspend.c:55
#1  0x0000a7c4 in __pthread_wait_for_restart_signal (self=0x85b20) at
pthread.c:942
#2  0x00008690 in pthread_join (thread_id=1026, thread_return=0x0) at
restart.h:36
#3  0x00008240 in main (argc=1, argv=0xbffffde4) at test.c:17
(gdb)


nothing about the thread. What can I do?

Thanks for any answer
Frank Benoit 

( benoit at tionex dot de )

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gdbserver on arm and multithreading again
  2003-07-17  8:11 gdbserver on arm and multithreading again unknown
@ 2003-07-17 13:35 ` Jon Ringle
  2003-07-17 15:55   ` Frank Benoit
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Ringle @ 2003-07-17 13:35 UTC (permalink / raw)
  To: benoit, gdb

Frank,

Do you need to build gdb as a cross-gdb?

I had to build gdb twice. Once for the ARM target (for gdbserver). And again 
for a gdb that runs on my x86 host but understands arm binaries.

Here is how I built:

tar xzf gdb-5.3-tar.gz
mkdir build-i686-to-arm
mkdir build-arm

cd build-i686-to-arm

../gdb-5.3/configure --host=i686-pc-linux-gnu \
                     --target=arm-linux \
                     --build=i686-pc-linux-gnu
make

cd ../build-arm

HOSTCC=gcc CC='arm-linux-gcc' CFLAGS='-msoft-float' \
../gdb-5.3/configure --host=arm-linux \
                     --target=arm-linux \
                     --build=i686-pc-linux-gnu
make


On Thursday 17 July 2003 04:09 am, unknown wrote:
> Hi
>
> I read many postings about this, but I cannot get it working. :(
>
> My Testprogram:
> --
> #include <stdio.h>
> #include <pthread.h>
> #include <sched.h>
>
> void * Thread1( void * p )
> {
>   char * ptr = 0;
>   *ptr = 0; // Make Segfault in Thread
>   return NULL;
> }
>
>
> int main( int argc, char ** argv )
> {
>   pthread_t pid;
>   pthread_create( &pid, NULL, Thread1, NULL );
>   pthread_join( pid, NULL );
>   return 0;
> }
>
> -----------------------------------------------------------
>
> I built gdbserver like this:
>
> frank@ruhe:/arbeit/gdbserver$ export
> CC=/usr/local/arm-linux/bin/arm-linux-gcc
> frank@ruhe:/arbeit/gdbserver$
> ../gdb+dejagnu-20030716/gdb/gdbserver/configure
> --prefix=/usr/local/arm-linux arm-unknown-linux-gnu
> creating cache ./config.cache
> checking for gcc... /usr/local/arm-linux/bin/arm-linux-gcc
> checking whether the C compiler (/usr/local/arm-linux/bin/arm-linux-gcc
> ) works... yes
> checking whether the C compiler (/usr/local/arm-linux/bin/arm-linux-gcc
> ) is a cross-compiler... yes
> checking whether we are using GNU C... yes
> checking whether /usr/local/arm-linux/bin/arm-linux-gcc accepts -g...
> yes
> checking host system type... arm-unknown-linux-gnu
> checking target system type... arm-unknown-linux-gnu
> checking build system type... arm-unknown-linux-gnu
> checking for a BSD compatible install... /usr/bin/install -c
> checking how to run the C preprocessor...
> /usr/local/arm-linux/bin/arm-linux-gcc -E
> checking for ANSI C header files... yes
> checking for sgtty.h... yes
> checking for termio.h... yes
> checking for termios.h... yes
> checking for sys/reg.h... no
> checking for string.h... yes
> checking for proc_service.h... no
> checking for sys/procfs.h... yes
> checking for thread_db.h... yes
> checking for linux/elf.h... yes
> checking for stdlib.h... yes
> checking for unistd.h... yes
> checking whether strerror must be declared... no
> checking for lwpid_t in sys/procfs.h... yes
> checking for psaddr_t in sys/procfs.h... yes
> checking for prgregset_t in sys/procfs.h... yes
> checking for prfpregset_t in sys/procfs.h... yes
> checking whether prfpregset_t type is broken... yes
> checking for elf_fpregset_t in sys/procfs.h... yes
> checking for libthread_db... -lthread_db
> updating cache ./config.cache
> creating ./config.status
> creating Makefile
> creating config.h
>
> after make...
>
> frank@ruhe:file gdbserver
> gdbserver: ELF 32-bit LSB executable, ARM, version 1 (ARM), for
> GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped
>
> -------------------------------------------------------
>
> Ok, then I start gdbserver and connect with gdb.
>
> (gdb) target remote 192.168.0.127:2222
> Remote debugging using 192.168.0.127:2222
> 0x000080e0 in _start ()
> (gdb) c
> Continuing.
> #
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000f354 in __sigsuspend (set=0xbffffc48) at
> ../sysdeps/unix/sysv/linux/sigsuspend.c:55
> 55      ../sysdeps/unix/sysv/linux/sigsuspend.c: Datei oder Verzeichnis
> nicht gefunden.
>         in ../sysdeps/unix/sysv/linux/sigsuspend.c
> (gdb) bt
> #0  0x0000f354 in __sigsuspend (set=0xbffffc48) at
> ../sysdeps/unix/sysv/linux/sigsuspend.c:55
> #1  0x0000a7c4 in __pthread_wait_for_restart_signal (self=0x85b20) at
> pthread.c:942
> #2  0x00008690 in pthread_join (thread_id=1026, thread_return=0x0) at
> restart.h:36
> #3  0x00008240 in main (argc=1, argv=0xbffffde4) at test.c:17
> (gdb)
>
>
> nothing about the thread. What can I do?
>
> Thanks for any answer
> Frank Benoit
>
> ( benoit at tionex dot de )

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gdbserver on arm and multithreading again
  2003-07-17 13:35 ` Jon Ringle
@ 2003-07-17 15:55   ` Frank Benoit
  2003-07-17 16:03     ` Jon Ringle
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Benoit @ 2003-07-17 15:55 UTC (permalink / raw)
  To: gdb

do think it is a build problem? Because normal debugging works. Only the
threads are missing.

Frank


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gdbserver on arm and multithreading again
  2003-07-17 15:55   ` Frank Benoit
@ 2003-07-17 16:03     ` Jon Ringle
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Ringle @ 2003-07-17 16:03 UTC (permalink / raw)
  To: gdb

The only reason I asked was because you didn't indicate anything about your 
gdb build configuration, only your gdbserver config.

When you start gdb it will tell you what --host and --target is.

Also, before building gdbserver, you might need to apply the patch at:
http://sources.redhat.com/ml/gdb/2003-06/msg00535.html

Jon

On Thursday 17 July 2003 11:53 am, Frank Benoit wrote:
> do think it is a build problem? Because normal debugging works. Only the
> threads are missing.
>
> Frank

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-17 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-17  8:11 gdbserver on arm and multithreading again unknown
2003-07-17 13:35 ` Jon Ringle
2003-07-17 15:55   ` Frank Benoit
2003-07-17 16:03     ` Jon Ringle

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).