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