List Info

Thread: gdbserver unable to attach to process




gdbserver unable to attach to process
country flaguser name
United Kingdom
2007-02-24 09:51:54
Hello,
I developing an application for mobilinux (kernel 2.6.10) on
ARM V6 
platform and I need to debug it , however, the gdbserver
remote debugger 
agent is unable to attach to any executable... here's what
happens:

First I tried to execute gdbserver (on remote platform - IP:

192.168.16.2) as follow:

    $gdbserver :12345 /usr/local/bin/flP5
    Process /usr/local/bin/flP5 created; pid = 4630

at this point my application (flP5) starts without stopping
at first 
instruction (as should be) and only after I kill the process
4630, 
gdbserver shows the "Listening on port 12345"
prompt, furthermore, when 
I do "target remote 192.168.16.2:12345" from my
host's gdb I get  a  
"Connection refused" message and the remote
gdbserver  exits.

I also tried to firstly run my application and then attach
gdbserver via 
the --attach option  but I get the following  error:

    $ /usr/local/bin/flP5 &
    [1] 4718
    $ gdbserver :12345 --attach 4718
    Cannot attach to process 4718: Operation not permitted
(1)

I really appreciate your help to understand what can prevent
gdbserver 
to work correctly.

Tanks & regards,
    Francesco Bradascio

PS:
- gdb and gdbserver versions is 6.6 (cross)compiled for
target 
arm-elf-linux-gnu
- I added several printfs to log the operations in the
linux-low.c file 
and I found that (for the first case) the gdbserver remains
stucked at 
the first waitpid in the linux_wait_for_process function.
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messe
nger.yahoo.com 

Re: gdbserver unable to attach to process
country flaguser name
United States
2007-02-24 10:15:09
On Sat, Feb 24, 2007 at 04:51:54PM +0100, Francesco
Bradascio wrote:
> Hello,
> I developing an application for mobilinux (kernel
2.6.10) on ARM V6 
> platform and I need to debug it , however, the
gdbserver remote debugger 
> agent is unable to attach to any executable... here's
what happens:
> 
> First I tried to execute gdbserver (on remote platform
- IP: 
> 192.168.16.2) as follow:
> 
>    $gdbserver :12345 /usr/local/bin/flP5
>    Process /usr/local/bin/flP5 created; pid = 4630
> 
> at this point my application (flP5) starts without
stopping at first 
> instruction (as should be) and only after I kill the
process 4630, 
> gdbserver shows the "Listening on port 12345"
prompt, furthermore, when 
> I do "target remote 192.168.16.2:12345" from
my host's gdb I get  a  
> "Connection refused" message and the remote
gdbserver  exits.

This sounds like something is wrong with your environment,
not with
gdbserver - I would be suspicious of a kernel bug of some
sort.  Or,
perhaps, is the application set-user-ID?  That would also
explain this:

>    $ /usr/local/bin/flP5 &
>    [1] 4718
>    $ gdbserver :12345 --attach 4718
>    Cannot attach to process 4718: Operation not
permitted (1)

-- 
Daniel Jacobowitz
CodeSourcery

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )