forked from nnosov/pstrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.gdb
68 lines (60 loc) · 1.17 KB
/
script.gdb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# http://sourceware.org/gdb/wiki/FAQ: to disable the
# "---Type <return> to continue, or q <return> to quit---"
# in batch mode:
set width 0
set height 0
set verbose off
# enable breakpoint pending on future shared library load in batch
set breakpoint pending on
dashboard -enabled off
handle SIGSEGV nostop noprint
b _start
commands 1
p $rsp
info frame
info registers
continue
end
# at __libc_start_main point - print RSP
b __libc_start_main
commands 2
p $rsp
info frame
info registers
continue
end
# at entry point - print RSP
b main
commands 3
p $rsp
info frame
info registers
continue
end
# at Fun1 point - print RSP
b Fun1
commands 4
p $rsp
info frame
info registers
continue
end
# at Fun2 point - print RSP
b Fun2
commands 5
p $rsp
info frame
info registers
printf "\n"
continue
end
# show arguments for program
#show args
#printf "Note, however: in batch mode, arguments will be ignored!\n"
# note: even if arguments are shown;
# must specify cmdline arg for "run"
# when running in batch mode! (then they are ignored)
# below, we specify command line argument "2":
run # run
#start # alternative to run: runs to main, and stops
#continue