AIRobot

AIRobot quick note


  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 搜索

gdb自动化调试

发表于 2021-01-05
本文字数: 711 阅读时长 ≈ 1 分钟

gdb自动化调试

basic

variable

set $a=1

register

i r print registers

set $eax=1

function

1
2
3
4
5
6
7
8
define func_name
<body>
end

# func doc
document func_name
# write documents here
end

condition

1
2
3
4
5
6
7
8
9
condition N COND #Specify breakpoint number N to break only if COND(expr) is true

b [if CONDITION]

if <condition>
# do something
else
# do other things
end

loop

1
2
3
while <condition> 
# do something
end

commands

1
2
3
4
commands 1 # breakpoint number
print argc
continue
end

run batch

  • source run.batch
  • gdb --batch --command=run.batch --args test.exe <args>

example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
set $LINE = 10
set $LINE2 = 20

b main
commands 1
print argc
continue
end

b test.c:$LINE
commands 2
#none
end

b test.c:$LINE2
commands
backtrace
continue
end
# gdb # debug
gdb代码跳转调试
microcode
  • 文章目录
  • 站点概览
AIRobot

AIRobot

AIRobot quick note
130 日志
15 分类
23 标签
GitHub E-Mail
Creative Commons
  1. 1. gdb自动化调试
    1. 1.1. basic
      1. 1.1.1. variable
      2. 1.1.2. register
      3. 1.1.3. function
      4. 1.1.4. condition
      5. 1.1.5. loop
      6. 1.1.6. commands
    2. 1.2. run batch
    3. 1.3. example
0%
© 2023 AIRobot | 716k | 10:51