From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18732 invoked by alias); 17 Jul 2003 13:35:49 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18713 invoked from network); 17 Jul 2003 13:35:47 -0000 Received: from unknown (HELO home.ringle.org) (12.153.69.24) by sources.redhat.com with SMTP; 17 Jul 2003 13:35:47 -0000 Received: by home.ringle.org (Postfix, from userid 501) id DF1A8B8251; Thu, 17 Jul 2003 09:35:36 -0400 (EDT) From: Jon Ringle 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 User-Agent: KMail/1.5 References: <1058429390.22837.38.camel@ruhe> In-Reply-To: <1058429390.22837.38.camel@ruhe> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307170935.36437.jon.ringle@comdial.com> X-SW-Source: 2003-07/txt/msg00198.txt.bz2 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 > #include > #include > > 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 )