This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

attach process, run it, and CANNOT exit


Hi,

While executing gdb 6.8 test-suite on ARM architecture i got following
FAIL in gdb.base/attach.exp

...
p should_exit = 1
$1 = 1
(gdb) PASS: gdb.base/attach.exp: p should_exit = 1
c
Continuing.
FAIL: gdb.base/attach.exp: c (timeout)
...

I tried to test is manually with following C code.

sleep.c
----------
#include <stdio.h>
#include <unistd.h>
int main()
{
 sleep(30);
 return 0;
}

When gdb is attached to sleeping process, gdb waits on continue and
never returns to gdb prompt.

(gdb) set debug  infrun 1
(gdb) shell ps ax | grep sleep
17817 pts/6    S+     0:00 ./sleep
17818 pts/4    S+     0:00 bash -c ps ax | grep sleep
17820 pts/4    S+     0:00 grep sleep
(gdb) attach 17817
Attaching to program: /tmp/sleep, process 17817
infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4783f27c
infrun: stop_stepping
Loaded symbols for /devel/lib/libc.so.6
Loaded symbols for /devel/lib/ld-linux.so.3
0x4783f27c in nanosleep () from /devel/lib/libc.so.6
(gdb) bt
#0  0x4783f27c in nanosleep () from /devel/lib/libc.so.6
#1  0x4783f030 in __sleep (seconds=162) at
../sysdeps/unix/sysv/linux/sleep.c:138
#2  0x0000839c in main () at sleep.c:5
(gdb) c
Continuing.
infrun: proceed (addr=0xffffffff, signal=144, step=0)
infrun: resume (step=0, signal=0)
infrun: wait_for_inferior (treat_exec_as_sigtrap=0)

I tried it on x86, and it worked fine.
Is it a ARM specific gdb bug or something else?

Thanks and Regards,
Ashwin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]