Transcript

Debug Hacks

8/13/'09

(Debug Hacks)

[email protected]

http://d.hatena.ne.jp/hyoshiok/

http://blog.miraclelinux.com/yume/

Debug Hacks

Debug Hacks --
&

, , , ,

ISBN:978-4-87311-404-0

2009422

Debug Hacks

DB


printf()

GDB

Gcc
$gcc -g -Wall
-Wall

-W -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith

Makefile CFLAGS

INSTALLREADME

GDB

$gdb

$gdb -c

emacsM-x gdb

GDB

break

break

break

break

break [+|-]

break *


info break

run

run

main()main()

start


backtrace(bt)

print[/]

`x' 16

`d' 10

`u' 10

`o' 8

`t' 2`t' "two"

`a'

`c' (ASCII)

`f'

`s'

x[/NFU]

N

F

U

`b'

`h' 2

`w' 4

`g' (8

disassemble

continue

finish/until

next

step

continue

finish/until

finish

until

next/step

continue

finish/until

watch

awatch

rwatch

(hbreak)

(tbreak)

set variable =

info threads

thread

info registers

frame

ID
$ ps aux|grep

attach ID

$gdb -c

GDB

GDB

Debug Hacks([email protected])

Debug Tools

kprobes

jprobes

KAHO

systemtap

VMware Vprobe

crash

gdb

kprobes

Debug Hacks, #47, #49, #50

jprobes

kprobes

Debug Hacks, #48

KAHO

Debug Hacks, #51

systemtap

kprobes

Debug Hacks, #52, #53

VMware Vprobe

OS

Debug Hacks, #61

crash

kernel crash dump utility

Debug Hacks, #21

gdb

Debug Hacks, #5, #6, #7

Intel 64 and IA-32 Architectures Software Developer's Manualshttp://www.intel.com/products/processor/manuals/index.htm