Use new gdb commands for core dump examination
[csit.git] / resources / tools / scripts / gdb-commands
1 # Copyright (c) 2019 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 # Most of the content of this file has been copied from:
15 # http://stdio.be/vpp/gdb-commands.txt
16
17 # Usage:
18 # gdb ${BINFILE} ${CORE} -ex 'source -v gdb-commands' -ex quit
19
20 set pagination off
21 thread apply all bt
22
23 define printstack
24   set $i=0
25   while $i < 15
26       frame $i
27       x/i $pc
28       info locals
29       info reg
30       set $i = $i + 1
31   end
32 end
33 thread apply all printstack
34
35 # info proc mappings