From: Jon Ringle <jon.ringle@comdial.com>
To: benoit@tionex.de, gdb@sources.redhat.com
Subject: Re: gdbserver on arm and multithreading again
Date: Thu, 17 Jul 2003 13:35:00 -0000 [thread overview]
Message-ID: <200307170935.36437.jon.ringle@comdial.com> (raw)
In-Reply-To: <1058429390.22837.38.camel@ruhe>
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 )
next prev parent reply other threads:[~2003-07-17 13:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-17 8:11 unknown
2003-07-17 13:35 ` Jon Ringle [this message]
2003-07-17 15:55 ` Frank Benoit
2003-07-17 16:03 ` Jon Ringle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200307170935.36437.jon.ringle@comdial.com \
--to=jon.ringle@comdial.com \
--cc=benoit@tionex.de \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox