Howto single step from beginning
Paul Blacquiere
blacq@slingshot.co.nz
Thu Feb 2 03:20:00 GMT 2006
> First, assuming that this is a dynamically linked application, try
> "set stop-on-solib-events 1". That'll stop you way back in the dynamic
> linker. From there you may be able to single-step to _start; it gets
> called from something like _dl_start_user.
pretty sure it is static
gcc -g --static -o test test.c
result as follows:
-------------------------------
(gdb) set stop-on-solib-events 1
(gdb) run
Starting program: /home/blacq/src/bin/test
Program received signal SIGILL, Illegal instruction.
0x00008094 in _start ()
(gdb)
------------------------------
>
> Secondly, does it work outside of GDB?
Yup, sorry forgot to mention earlier.
> If so, I'd suspect that the
> breakpoint GDB has invisibly placed at _start (which it always does)
> is causing SIGILL instead of SIGTRAP. There was some change in this
> area for ARM/Linux recently. If your kernel is too old, perhaps
> GDB is using a breakpoint that it doesn't support. Or maybe it's GDB
> that's too old. Check with "set debug target 1" before running to see
> what bytes it's inserting, then check your kernel sources (esp.
> arm/kernel/ptrace.c and arm/kernel/traps.c) to see which breakpoints
> it expects.
>
Your description seems very feasible, as I am using Linux kernel 2.6.12.
I will investigate this further.
PaulB.
More information about the Gdb
mailing list