meta data for this page
  •  

This is an old revision of the document!


getting info

  • p[rint] var
  • x /100bx m - eXamine memory located by variable m, print 100 bytes in hex format
  • bt (backtrace)
  • t (threads)

breakpoints

  • break malloc
  • clear malloc

stepping

  • s[tep]
  • c[ontinue] <num_to_ignore>
  • n[ext] - to next line
  • fin[ish] - execute until stack frame returns
  • u[ntil] <line number> - execute to line (to avoid loops)

file paths and libraries

  • set verbose on
  • set auto-load safe-path /
  • info shared
  • set sysroot /home/niziak/n/3/out/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot

source paths

Search paths (prefixes):

  • dir /path/to/src1
  • dir /path/to/lib/src2

Translate beginning of paths:

  • set substitute-path /usr/lib ../../out/target/usr/lib

infos

  • show debug-file-directory

Kernel OOPS

Reading

PC is at RTMPCheckEtherType+0x90/0x4d4 [mt7601Uapsta]
LR is at RTMPCheckEtherType+0x34/0x4d4 [mt7601Uapsta]

Code: e59f3418 e0256593 e2859d43 e289902c (e5d939ba)

Oops occurs at offset 0x90 from RTMPCheckEtherType. 0x4d4 is length. “Code” line shows last instruction. Instruction in bracket is problematic instruction (at RTMPCheckEtherType+0x90)

Tracing

Disassembly kernel binary or module binary: objdump -dS vmlinux > /tmp/kernel.s and look into generated code.