User Tools

Site Tools


mywiki:linux:linux_debugging_with_lauterbach

This is an old revision of the document!


Linux Debugging with LauterBach

Basic requirement

In order to support c source code level debugging, it is a must to enable debugging option during compile

Get source code directory base

    mips-openwrt-linux-objdump -g vmlinux | grep -i DW_AT_comp_dir | grep -i indirect |  grep '\/'

Its output is like:

    <bb2043>   DW_AT_comp_dir : (indirect string, offset: 0x171): /disk/fs1/tmp2/openwrt/core/kernel_tree

Discover entry point in ELF

  • Discover vmlinux entry point
     mips-openwrt-linux-objdump -t vmlinux | grep -w "_text"

Its output in my setup: 60020000 g .text 00000000 _text

  • Discover kernel_entry
    mips-openwrt-linux-objdump -f vmlinux

Its output in my setup: start address 0x6002df00

Generate system.map

    mips-openwrt-linux-nm -n vmlinux | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > System.map

Get one symbol's address

    mips-openwrt-linux-objdump -t vmlinux | grep dp_xmit

Lauterbach/Debugger

Load System via networking

Suppose below working environment:

Linux Compilation folder /disk/fs1/tmp2/shaoguoh/project/ugw61_grx500/openwrt/core/kernel_tree
vmlinux folder /disk/fs1/tmp2/shaoguoh/project/ugw61_grx500/openwrt/core/kernel_tree
samba mapping folder to windows X:\tmp2\shaoguoh\project\ugw61_grx500\openwrt\core\kernel_tree

Lauterbach command:

  d.load.elf X:\tmp2\shaoguoh\project\ugw61_grx500\openwrt\core\kernel_tree\vmlinux /gnu /strippart "/disk/fs1/tmp2" /path "X:\tmp2" /nocode
mywiki/linux/linux_debugging_with_lauterbach.1451381466.txt.gz · Last modified: (external edit)