Re: (Rising Spam Alert)Re: (Rising Spam Alert)Re: (Rising Spam Alert)Re: wrong lib address

xchen
2007-09-04T10:46:45Z

Hi Daniel,
Huh! I set solib-absolute-prefix
/opt/montavista/pro/devkit/ppc/8xx/target and create /mnt/cf/shared/lib
under this path. All library can be loaded successfully. Thank you very
much. But there is another error when I debug the program. When the program
step to the system(), it hang and display "Detaching after fork from child
process 275."

(gdb) n
95 char bDhcpFail=0;
(gdb) n
100 if (g_profile->ipSetup.ucImode == MODE_STATIC)
(gdb) n
122 sprintf(cRdBuf, "dhcpcd -t 10");
(gdb) n
123 rc = system(cRdBuf);
(gdb) n
Detaching after fork from child process 275.
======================================
Waitting for a long time
=======================================
Remote communication error: No route to host.

I use x86 gdb debug the test program which include system call, it didn't
display "Detaching after fork from child process xxx".
8 printf("please show me\n");
(gdb) n
please show me
9 system("ls");
(gdb) n
hellogdb hellogdb.c makefile
10 return 0;
(gdb) n
11 }

Thx,
Xi

-----邮件原件-----
发件人: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] 代表
'Daniel Jacobowitz'
发送时间: 2007年9月3日 22:50
收件人: xchen
抄送: gdb@sourceware.org
主题: (Rising Spam Alert)Re: (Rising Spam Alert)Re: (Rising Spam Alert)Re:
wrong lib address

On Mon, Sep 03, 2007 at 06:30:58PM +0800, xchen wrote:
>
> Hi Daniel
>
> I have resolved this problem. I misunderstood the mean of
> solib-absolute-prefix. And now I use solib-search-path to load the
library.
> Bad luck! New errors occured include Malformed packet(b) (missing
> colon) and Invalid remote reply when I continue to debug my peogram.
> Belowed is the snapshot
>
> (gdb) set solib-absolute-prefix /root/
> (gdb) set solib-search-path
> /opt/montavista/pro/devkit/ppc/8xx/target/lib/:/opt/montavista/pro/dev
> kit/pp
> c/8xx/target/usr/lib/

No. Don't use solib-search-path for this.

Use:
set solib-absolute-prefix /opt/montavista/pro/devkit/ppc/8xx/target

> (gdb) n
> warning: Invalid remote reply: n8003

You are using MontaVista's gdbserver. You should be using their GDB, too.
This only works with both.

--
Daniel Jacobowitz
CodeSourcery