Emmanuel Dreyfus | 1 May 2005 10:46
Picon

gdb can't trace

Hello

I'm working on COMPAT_LINUX/amd64 and I experience unexpected problems.

When launching a Linux binary, the program starts but hangs before doing
any system call. Running gdb shows it is stopped on a hlt instruction.
What is it? halt? halt until when?

Thanks to sysctl proc.$$.stopexec I can use gdb to attach the program
before it starts. Stack and registers are correctly set up.

In order to find out what goes wrong, I'd like to trace the Linux binary
running on NetBSD using gdb. But gdb seems unable to trace. Anyone see
any reason why it could not? 

$ gdb /emul/linux/bin/hello  
(gdb) attach 632
Attaching to program: /emul/linux/bin/hello, process 632
_start () at ../sysdeps/x86_64/elf/start.S:48
48      ../sysdeps/x86_64/elf/start.S: No such file or directory.
        in ../sysdeps/x86_64/elf/start.S
Current language:  auto; currently asm
(gdb) info reg
rax            0x0      0
rbx            0x0      0
rcx            0x4001c0 4194752
rdx            0x0      0
rsi            0x0      0
rdi            0x0      0
rbp            0x0      0
(Continue reading)

Emmanuel Dreyfus | 1 May 2005 17:09
Picon

Re: gdb can't trace

Emmanuel Dreyfus <manu <at> netbsd.org> wrote:

> When launching a Linux binary, the program starts but hangs before doing
> any system call.

I tracked that down: it was doing system calls but I did not added the
code to see them with ktrace. Silly bug.

--

-- 
Emmanuel Dreyfus
Un bouquin en français sur BSD:
http://www.eyrolles.com/Informatique/Livre/9782212114638/livre-bsd.php
manu <at> netbsd.org


Gmane