Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB does not stop at assembly code address
@ 2016-10-14 15:21 deffo
  2016-10-17 11:46 ` Yao Qi
  2016-10-18 19:47 ` Jan Kratochvil
  0 siblings, 2 replies; 5+ messages in thread
From: deffo @ 2016-10-14 15:21 UTC (permalink / raw)
  To: gdb

Hi there,

I'm currently debugging the 32 bit Linux Kernel 4.8.1 remotely with GDB and Qemu i386 2.7. My GDB script looks like this:

target remote localhost:10000
source .
symbol-file vmlinux
set width 0
set height 0
set verbose off

b rest_init
commands
continue
end

b console_init
commands
continue
end

b start_kernel
commands
continue
end

b startup_32
commands
continue
end

continue

Now apparently I'm missing something, since the breakpoints in C land, that is start_kernel, console_init, rest_init are recognized as breakpoints and thus jumped at by GDB just fine.

What does not work is the breakpoint on startup_32, which is still in Assembly land. GDB just jumps over it as if it wasn't called, but it is definitely called since it's the 32-bit kernel entrypoint.

Is this due to some real-mode/protected-mode fiddlings?

Best regards,
J.


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: GDB does not stop at assembly code address
@ 2016-10-18 16:53 deffo
  2016-10-18 19:19 ` Yao Qi
  0 siblings, 1 reply; 5+ messages in thread
From: deffo @ 2016-10-18 16:53 UTC (permalink / raw)
  To: qiyaoltc; +Cc: gdb

Here's the output:

(gdb) b startup_32
Breakpoint 1 at 0xc1000000: file arch/x86/kernel/head_32.S, line 97.
(gdb) print startup_32
$1 = {<text variable, no debug info>} 0xc1000000 <startup_32>
(gdb) info breakpoints
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0xc1000000 arch/x86/kernel/head_32.S:97

(gdb) b start_kernel
Breakpoint 1 at 0xc1be3755: file init/main.c, line 480.
(gdb) print start_kernel
$1 = {void (void)} 0xc1be3755 <start_kernel>
(gdb) info breakpoints
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0xc1be3755 in start_kernel at init/main.c:480

I guess the "no debug info" would be the explanation, but why is that? The address is listed as a FUNC in readelf -Ws vmlinux, thus it should be correct. What do I have to do?

----------------------------------------------------------------------------------------------

What is startup_32 address and where does GDB set breakpoint?
You can do "print startup_32" and "info breakpoints" to get the answer
of two questions above.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-18 19:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14 15:21 GDB does not stop at assembly code address deffo
2016-10-17 11:46 ` Yao Qi
2016-10-18 19:47 ` Jan Kratochvil
2016-10-18 16:53 deffo
2016-10-18 19:19 ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox