public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* more info on Help needed for gdbserver on redhat 9, thanks!
@ 2003-10-07  1:20 Ming Sun
  2003-10-07  1:25 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Ming Sun @ 2003-10-07  1:20 UTC (permalink / raw)
  To: gdb

After changed to static linking without share liberies. The gdbserver works
for the test program. But my real program cannot work with static library
due to different thread behave. Does anyone know why dynamic library
causes SEGSEGV in gdbserver? By the way, I check /usr/lib/libglib* on
both PCs. All files have same size and date.

Thanks,

Ming

===========================================================================

I got two PCs. One is running target and run gdbserber and the other is 
host and run
gdb. Both are redhat 9. I am constantly get SIGSEGV before it reaches 
main().
Gdb works fine in local machine. Does anyone know what is my problem?
Thanks in advance for your help!

Ming

Here are the outputs from both target and host.

==============TARGET==============
root@pc28 x86]# gdbserver foo:5432 test
Process test created; pid = 3569
Remote debugging from host 192.168.0.57


==============HOST==============

[root@mings x86]# gdb test
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 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 "i386-redhat-linux-gnu"...
(gdb) target remote 192.168.0.155:5432
Remote debugging using 192.168.0.155:5432
0x40000c10 in ?? ()
(gdb) symbol-file test
Load new symbol table from "test"? (y or n) y
Reading symbols from test...done.
(gdb) list main
1 #include <stdio.h>
2
3 main (int argc,
4 char *argv[])
5 {
6 printf ("test gdbserver\n");
7 }
(gdb) br main
Breakpoint 1 at 0x8048338: file test.c, line 6.
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x0c011ad7 in ?? ()
(gdb) where
#0 0x0c011ad7 in ?? ()
#1 0x40001365 in ?? ()
#2 0x4000eebf in ?? ()
#3 0x40000f53 in ?? ()
(gdb) quit
The program is running. Exit anyway? (y or n) y
[root@mings x86]# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix 
--disable-checking --with-system-zlib --enable-__cxa_atexit 
--host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

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

* Re: more info on Help needed for gdbserver on redhat 9, thanks!
  2003-10-07  1:20 more info on Help needed for gdbserver on redhat 9, thanks! Ming Sun
@ 2003-10-07  1:25 ` Daniel Jacobowitz
       [not found]   ` <3F84C42F.5080006@intellambda.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-10-07  1:25 UTC (permalink / raw)
  To: Ming Sun; +Cc: gdb

On Mon, Oct 06, 2003 at 06:17:44PM -0700, Ming Sun wrote:
> After changed to static linking without share liberies. The gdbserver works
> for the test program. But my real program cannot work with static library
> due to different thread behave. Does anyone know why dynamic library
> causes SEGSEGV in gdbserver? By the way, I check /usr/lib/libglib* on
> both PCs. All files have same size and date.

Your two hosts do not have the same libraries.

Either make sure that they do, or else use set solib-absolute-prefix;
copy the target's library layout to the host and point GDB at it before
connecting.

> 
> Thanks,
> 
> Ming
> 
> ===========================================================================
> 
> I got two PCs. One is running target and run gdbserber and the other is 
> host and run
> gdb. Both are redhat 9. I am constantly get SIGSEGV before it reaches 
> main().
> Gdb works fine in local machine. Does anyone know what is my problem?
> Thanks in advance for your help!
> 
> Ming
> 
> Here are the outputs from both target and host.
> 
> ==============TARGET==============
> root@pc28 x86]# gdbserver foo:5432 test
> Process test created; pid = 3569
> Remote debugging from host 192.168.0.57
> 
> 
> ==============HOST==============
> 
> [root@mings x86]# gdb test
> GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
> Copyright 2003 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 "i386-redhat-linux-gnu"...
> (gdb) target remote 192.168.0.155:5432
> Remote debugging using 192.168.0.155:5432
> 0x40000c10 in ?? ()
> (gdb) symbol-file test
> Load new symbol table from "test"? (y or n) y
> Reading symbols from test...done.
> (gdb) list main
> 1 #include <stdio.h>
> 2
> 3 main (int argc,
> 4 char *argv[])
> 5 {
> 6 printf ("test gdbserver\n");
> 7 }
> (gdb) br main
> Breakpoint 1 at 0x8048338: file test.c, line 6.
> (gdb) c
> Continuing.
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x0c011ad7 in ?? ()
> (gdb) where
> #0 0x0c011ad7 in ?? ()
> #1 0x40001365 in ?? ()
> #2 0x4000eebf in ?? ()
> #3 0x40000f53 in ?? ()
> (gdb) quit
> The program is running. Exit anyway? (y or n) y
> [root@mings x86]# gcc -v
> Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
> --infodir=/usr/share/info --enable-shared --enable-threads=posix 
> --disable-checking --with-system-zlib --enable-__cxa_atexit 
> --host=i386-redhat-linux
> Thread model: posix
> gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
> 
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: more info on Help needed for gdbserver on redhat 9, thanks!
       [not found]   ` <3F84C42F.5080006@intellambda.com>
@ 2003-10-09  2:18     ` Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-10-09  2:18 UTC (permalink / raw)
  To: Ming Sun; +Cc: gdb

On Wed, Oct 08, 2003 at 07:13:03PM -0700, Ming Sun wrote:
> Thanks Dan! That was my problem. It is a bit diffical to sync up libs on 
> two PCs.
> But it finally worked. I got another problem on gdbserver and pthread.
> 
> If I have a break point in the entry function of a thread, when 
> pthread_create() is
> invoked my program will receive a SIGTRAP signal and quit. The gdbserver 
> outputs
> "Cannot find new threads: generic error" before it breaks at main() also.
> Is this normal or there is some configuration I need to do?
> 
> Thanks for the help,

I don't know.  It should work, but you're probably using NPTL and as
far as I know gdbserver has never been tested with NPTL.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

end of thread, other threads:[~2003-10-09  2:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-07  1:20 more info on Help needed for gdbserver on redhat 9, thanks! Ming Sun
2003-10-07  1:25 ` Daniel Jacobowitz
     [not found]   ` <3F84C42F.5080006@intellambda.com>
2003-10-09  2:18     ` Daniel Jacobowitz

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