tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Base GDB tracing 32bit applications on amd64 kernel (with 64bit debugger) part 1)



cc'ing maxv@ who is the author of some of the commits,

On Mon, Jun 24, 2019 at 08:41:23PM +0200, Michał Górny wrote:
> On Mon, 2019-06-24 at 17:19 +0000, maya%netbsd.org@localhost wrote:
> > Hi,
> > 
> > with the attached patch against -current, backtraces work again.

For convenience, these are the commits referenced.
https://github.com/NetBSD/src/commit/4b66e9c074e39cd67a49386318770ebc2a6edf82
https://github.com/NetBSD/src/commit/030b2742098c17c9bd99e797fff5f1c820d6edfe
https://github.com/NetBSD/src/commit/4cab1e757c7197a01b6dc268c0104fa43ab7f0aa
https://github.com/NetBSD/src/commit/5542798943417f4d1bdb61d0a49a9f8c1c37445c
https://github.com/NetBSD/src/commit/ef20f297e5f1527c1b54d4b2de8280a6cca21c71
https://github.com/NetBSD/src/commit/80d084c7ddc1104b2bf191ccaa8a5347e71253ef

Patch against -current: http://coypu.sdf.org/bisect.diff

> 
> Am I missing something or are you destroying compat32 in the process?
> 


I bisected to find offending commits so that I could go from this
-current amd64 kernel
8.1 userland (artifact of test setup, same happens with -current
userland)
C hello world, 32bit

current situation:

localhost# gdb -q ./test 
Reading symbols from ./test...done.
(gdb) b main 
Breakpoint 1 at 0x80486da: file test.c, line 3.
(gdb) r 
Starting program: /root/test
 
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000000 in ?? ()
(gdb) si 
0xfb0a8c9d in ?? ()
(gdb)  

Program received signal SIGSEGV, Segmentation fault.
0xfcb6a300 in ?? ()


---------------------------------------------
after patch:

localhost# gdb -q ./test 
Reading symbols from ./test...done.
(gdb) b main 
Breakpoint 1 at 0x80486da: file test.c, line 3.
(gdb) r 
Starting program: /root/test
 
Breakpoint 1, main () at test.c:3
3               printf("Hello, world!\n");
(gdb) si 
0x080486e1      3               printf("Hello, world!\n");
(gdb)  
0x08048470 in puts@plt ()


I didn't put any of my own input, I tried to be as close to "revert the
commit" as possible, but might've made some inattentive errors.

To clarify, amd64 32bit debugging isn't my highest priority, I am OK if
this waits past branching, I'm just after MIPS debugging, and it runs a
compat32 userland. It's not happy after this patch either, but I don't
know if it ever was.


Home | Main Index | Thread Index | Old Index