Hi kgdb folks,
I would like to request your help with an issue, please.
I am trying to single-step the Linux kernel (v3.8-rc7) for the first
time on an ARM platform (TI OMAP5), and I can't seem to succeed.
I can enter kdb with no problem on the serial console, and set a
breakpoint (in drm_ioctl for instance):
---
Entering kdb (current=0xc0861cd0, pid 0) on processor 0 due to Keyboard
Entry
[0]kdb> bp drm_ioctl
kdbgetsymval: symname=drm_ioctl, symtab=c0857b20
kdbgetsymval: returns 1, symtab->sym_start=0xc0362c80
Instruction(i) BP #0 at kdbnearsym: addr=0xc0362c80, symtab=c0857b28
kdbnearsym: returns 1 symtab->sym_start=0xc0362c80,
symtab->mod_name=c06efb3c, symtab->sym_name=c0e26f20 (drm_ioctl)
0xc0362c80 (drm_ioctl)
is enabled addr at 00000000c0362c80, hardtype=0 installed=0
[0]kdb> go
---
If I run a userspace program calling drm_ioctl(), then kdb is reentered
ok on breakpoint hit:
---
Entering kdb (current=0xed934b80, pid 1776) on processor 1 due to
Breakpoint @ 0xc0362c80
---
The problem is that the PC seems to stay there when I try to "single
step" (note that I enabled kdb debug, too, so sorry for the long log):
---
[1]kdb> ss
state: kdb_local 9 cpu 1 value -1003 initial 1 state 2204a0
state: kdb_main_loop 3 cpu 1 value -1003 initial 1 state 2204a0
kdb_bp_install: bp 0 bp_enabled 1
_kdb_bp_install: bp_installed 0
_kdb_bp_install: delayed bp
regs->ip = 0xc0362c80
kdb_bp_install: bp 1 bp_enabled 0
kdb_bp_install: bp 2 bp_enabled 0
kdb_bp_install: bp 3 bp_enabled 0
kdb_bp_install: bp 4 bp_enabled 0
kdb_bp_install: bp 5 bp_enabled 0
kdb_bp_install: bp 6 bp_enabled 0
kdb_bp_install: bp 7 bp_enabled 0
kdb_bp_install: bp 8 bp_enabled 0
kdb_bp_install: bp 9 bp_enabled 0
kdb_bp_install: bp 10 bp_enabled 0
kdb_bp_install: bp 11 bp_enabled 0
kdb_bp_install: bp 12 bp_enabled 0
kdb_bp_install: bp 13 bp_enabled 0
kdb_bp_install: bp 14 bp_enabled 0
kdb_bp_install: bp 15 bp_enabled 0
kdb_bp_remove: bp 15 bp_enabled 0
kdb_bp_remove: bp 14 bp_enabled 0
kdb_bp_remove: bp 13 bp_enabled 0
kdb_bp_remove: bp 12 bp_enabled 0
kdb_bp_remove: bp 11 bp_enabled 0
kdb_bp_remove: bp 10 bp_enabled 0
kdb_bp_remove: bp 9 bp_enabled 0
kdb_bp_remove: bp 8 bp_enabled 0
kdb_bp_remove: bp 7 bp_enabled 0
kdb_bp_remove: bp 6 bp_enabled 0
kdb_bp_remove: bp 5 bp_enabled 0
kdb_bp_remove: bp 4 bp_enabled 0
kdb_bp_remove: bp 3 bp_enabled 0
kdb_bp_remove: bp 2 bp_enabled 0
kdb_bp_remove: bp 1 bp_enabled 0
kdb_bp_remove: bp 0 bp_enabled 1
state: kdb_main_loop 1 cpu 1 value 1 initial 1 state 20480
state: kdb_main_loop 2 cpu 1 value 1 initial 1 state 20480
state: kdb_local 1 cpu 1 value 3 initial 1 state 20480
Entering kdb (current=0xed934b80, pid 1776) on processor 1 due to
Breakpoint @ 0xc0362c80
---
This is as if bp 0 had not been disabled (but I am not sure).
If I do a 'bd 0', the next 'ss' will still stay at the same address but
the messages differ a bit:
---
[1]kdb> bd 0
Breakpoint 0 at 0xc0362c80 disabled
[1]kdb> ss
state: kdb_local 9 cpu 1 value -1003 initial 1 state 220420
state: kdb_main_loop 3 cpu 1 value -1003 initial 1 state 220420
kdb_bp_install: bp 0 bp_enabled 0
kdb_bp_install: bp 1 bp_enabled 0
kdb_bp_install: bp 2 bp_enabled 0
kdb_bp_install: bp 3 bp_enabled 0
kdb_bp_install: bp 4 bp_enabled 0
kdb_bp_install: bp 5 bp_enabled 0
kdb_bp_install: bp 6 bp_enabled 0
kdb_bp_install: bp 7 bp_enabled 0
kdb_bp_install: bp 8 bp_enabled 0
kdb_bp_install: bp 9 bp_enabled 0
kdb_bp_install: bp 10 bp_enabled 0
kdb_bp_install: bp 11 bp_enabled 0
kdb_bp_install: bp 12 bp_enabled 0
kdb_bp_install: bp 13 bp_enabled 0
kdb_bp_install: bp 14 bp_enabled 0
kdb_bp_install: bp 15 bp_enabled 0
kdb_bp_remove: bp 15 bp_enabled 0
kdb_bp_remove: bp 14 bp_enabled 0
kdb_bp_remove: bp 13 bp_enabled 0
kdb_bp_remove: bp 12 bp_enabled 0
kdb_bp_remove: bp 11 bp_enabled 0
kdb_bp_remove: bp 10 bp_enabled 0
kdb_bp_remove: bp 9 bp_enabled 0
kdb_bp_remove: bp 8 bp_enabled 0
kdb_bp_remove: bp 7 bp_enabled 0
kdb_bp_remove: bp 6 bp_enabled 0
kdb_bp_remove: bp 5 bp_enabled 0
kdb_bp_remove: bp 4 bp_enabled 0
kdb_bp_remove: bp 3 bp_enabled 0
kdb_bp_remove: bp 2 bp_enabled 0
kdb_bp_remove: bp 1 bp_enabled 0
kdb_bp_remove: bp 0 bp_enabled 0
state: kdb_main_loop 1 cpu 1 value 1 initial 1 state 20400
state: kdb_main_loop 2 cpu 1 value 1 initial 1 state 20400
state: kdb_local 1 cpu 1 value 5 initial 1 state 20400
Entering kdb (current=0xed934b80, pid 1776) on processor 1 Oops: (null)
due to oops @ 0xc0362c80
Pid: 1776, comm: pvrsrvinit
CPU: 1 Tainted: G W O (3.8.0-rc7vs-00238-gaa3daea #2)
PC is at drm_ioctl+0x0/0x420
LR is at do_vfs_ioctl+0x80/0x5f0
pc : [<c0362c80>] lr : [<c01288b0>] psr: a0000013
sp : edb85f00 ip : 00005452 fp : 00000000
r10: 00000000 r9 : edb84000 r8 : 00000003
r7 : 00000003 r6 : eca2d880 r5 : 000121e0 r4 : edd30158
r3 : c0362c80 r2 : 000121e0 r1 : c0246400 r0 : eca2d880
Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c53c7d Table: adec406a DAC: 00000015
[<c001bee8>] (unwind_backtrace+0x0/0x130) from [<c00aa504>]
(kdb_dumpregs+0x28/0x50)
[<c00aa504>] (kdb_dumpregs+0x28/0x50) from [<c00ad038>]
(kdb_main_loop+0x36c/0x7d0)
[<c00ad038>] (kdb_main_loop+0x36c/0x7d0) from [<c00afbc4>]
(kdb_stub+0x358/0x474)
[<c00afbc4>] (kdb_stub+0x358/0x474) from [<c00a6454>]
(kgdb_cpu_enter+0x310/0x6c4)
[<c00a6454>] (kgdb_cpu_enter+0x310/0x6c4) from [<c00a6a88>]
(kgdb_handle_exception+0x160/0x1cc)
[<c00a6a88>] (kgdb_handle_exception+0x160/0x1cc) from [<c001b484>]
(kgdb_brk_fn+0x18/0x20)
[<c001b484>] (kgdb_brk_fn+0x18/0x20) from [<c00084e0>]
(do_undefinstr+0x15c/0x1f4)
[<c00084e0>] (do_undefinstr+0x15c/0x1f4) from [<c0580870>]
(__und_svc_finish+0x0/0x30)
Exception stack(0xedb85e78 to 0xedb85ec0)
5e60: eca2d880
c0246400
5e80: 000121e0 c0362c80 edd30158 000121e0 eca2d880 00000003 00000003
edb84000
5ea0: 00000000 00000000 00005452 edb85f00 c01288b0 c0362c80 a0000013
ffffffff
[<c0580870>] (__und_svc_finish+0x0/0x30) from [<c0362c80>]
(drm_ioctl+0x0/0x420)
[<c0362c80>] (drm_ioctl+0x0/0x420) from [<00000036>] (0x36)
---
And if I do 'ss' again, it will never come back (like a 'go'):
---
[1]kdb> ss
state: kdb_local 9 cpu 1 value -1003 initial 1 state 220420
state: kdb_main_loop 3 cpu 1 value -1003 initial 1 state 220420
kdb_bp_install: bp 0 bp_enabled 0
kdb_bp_install: bp 1 bp_enabled 0
kdb_bp_install: bp 2 bp_enabled 0
kdb_bp_install: bp 3 bp_enabled 0
kdb_bp_install: bp 4 bp_enabled 0
kdb_bp_install: bp 5 bp_enabled 0
kdb_bp_install: bp 6 bp_enabled 0
kdb_bp_install: bp 7 bp_enabled 0
kdb_bp_install: bp 8 bp_enabled 0
kdb_bp_install: bp 9 bp_enabled 0
kdb_bp_install: bp 10 bp_enabled 0
kdb_bp_install: bp 11 bp_enabled 0
kdb_bp_install: bp 12 bp_enabled 0
kdb_bp_install: bp 13 bp_enabled 0
kdb_bp_install: bp 14 bp_enabled 0
kdb_bp_install: bp 15 bp_enabled 0
[ 1716.172790] [drm:drm_ioctl], pid=1776, cmd=0xc0246400, nr=0x00, dev
0xe200, auth=1
(Then more kernel traces and prompt...)
---
Has anybody succeeded in single stepping on ARM Cortex-Ax already? Do
you have any advice debugging this, please?
Best regards,
V.
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport