Skip to content

Commit 539656d

Browse files
committed
Update documentation on debugger extensions to mention source step
Also make documentation more consistent across the repo.
1 parent f722402 commit 539656d

File tree

6 files changed

+68
-29
lines changed

6 files changed

+68
-29
lines changed

automatic_symbol_loading/README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Load Debug Symbols
2-
==================
1+
# Load Debug Symbols
32

43
A common practice amongst UDB users is to produce binaries compiled with debug symbols and
54
then use a tool such as `objcopy` to strip it of symbols, producing a `.debug` symbol file
@@ -15,10 +14,19 @@ This script automates the symbol loading completely.
1514
The script will traverse the whole directory structure, the user is just asked for the base
1615
directory.
1716

18-
Usage: `load-all-symbols PATHTOBASEDIR`
17+
## Usage
18+
```
19+
load-all-symbols PATHTOBASEDIR
20+
```
1921

20-
Examples:
21-
`load-all-symbols /data/mci/` - For each library loaded in UDB looks for the symbol file
22+
Before using the script it must be loaded in to the debugger:
23+
```
24+
source PATHTOADDONS/automatic_symbol_loading/automatic_symbol_loading.py
25+
```
26+
27+
## Examples
28+
29+
`load-all-symbols /data/mci/` : for each library loaded in UDB looks for the symbol file
2230
(by taking into consideration all and only the files ending in `.debug`) and, if the Build-IDs
2331
match, it loads the symbol-file.
2432

load_debug_symbols/README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Load Debug Symbols
2-
==================
1+
# Load Debug Symbols
32

43
A common practice amongst customers is to produce binaries compiled with debug symbols and
54
then use a tool such as `objcopy` to strip it of symbols, producing a `.debug` symbol file
@@ -12,10 +11,19 @@ retrospectively add the debug symbols to the recording, the user is required to
1211
`add-symbol-file` command in udb and pass in the `.debug` file and relevant addresses for the
1312
`.text`, `.data` and `.bss` sections. This script automates this process.
1413

15-
Usage: `load-debug-symbols PATHTOFILE`
14+
## Usage
15+
```
16+
load-debug-symbols PATHTOFILE
17+
```
1618

17-
Examples:
18-
`load-debug-symbols /foo/bar/baz.debug` - Loads the debug symbols by parsing relevant sections.
19+
Before using the script it must be loaded in to the debugger:
20+
```
21+
source PATHTOADDONS/load_debug_symbols/load_debug_symbols.py
22+
```
23+
24+
## Examples
25+
26+
`load-debug-symbols /foo/bar/baz.debug` : loads the debug symbols by parsing relevant sections.
1927

2028
Note that the argument to `load-debug-symbols` needs to be a valid debug symbol file and
2129
present in the file system.

reconstruct_file/README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
Reconstruct file
2-
================
1+
# Reconstruct file
32

43
Reconstruct a file read by the target program by examining its execution
54
history. Use the `-regex` or `-fd` options to select which file to reconstruct
65
or, if omitted, the first file opened is reconstructed.
76

8-
Usage:
7+
## Usage
98

109
```
1110
reconstruct-file [-regex PATH-REGEX | -fd FILE-DESCRIPTOR]
1211
[-from-start]
1312
[-output OUTPUT-PATH]
1413
```
1514

16-
Optional arguments:
15+
Before using the script it must be loaded in to the debugger:
16+
```
17+
source PATHTOADDONS/reconstruct_file/reconstruct_file.py
18+
```
19+
20+
### Optional arguments
1721

1822
- `-regex PATH-REGEX`:
1923
A regular expression matching the path of the file to reconstruct. Only the
@@ -28,7 +32,7 @@ Optional arguments:
2832
Path to a file were to write the reconstructed file. If not specified, the
2933
content is printed on standard output.
3034

31-
Limitations:
35+
## Limitations
3236

3337
- Only 64-bit x86 is supported.
3438
- Only files which are read in their entirety can be fully reconstructed.

regs_every_bb/README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
Regs every bb
2-
=============
1+
# Regs every bb
32

43
Prints the values of all the registers at every basic block within a range
54

6-
Usage:
7-
uregs <bbstart> <bbend>
5+
## Usage
6+
```
7+
uregs <bbstart> <bbend>
8+
```
9+
10+
Before using the script it must be loaded in to the debugger:
11+
```
12+
source PATHTOADDONS/regs_every_bb/regs_every_bb.py
13+
```

sample_functions/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sample functions
22

3-
Sampler which counts the number of times we find ourselves in a particular function.
3+
Sampler which counts the number of times we find ourselves in a particular function.
44
Outputs a list of functions with their counts.
55
```
66
Usage:
@@ -15,6 +15,11 @@ Usage:
1515
means sample every basic block count from 1 to 1000.
1616
```
1717

18+
Before using the script it must be loaded in to the debugger:
19+
```
20+
source PATHTOADDONS/sample_functions/sample_functions.py
21+
```
22+
1823
## Generating flame graphs
1924

2025
The output from this tool can be used directly to generate [flame graphs](https://www.brendangregg.com/flamegraphs.html).

what_map/README.md

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
What map
2-
========
1+
# What map
32

43
Looks up a variable or address within the maps of the debuggee.
54

6-
Usage: whatmap EXPRESSION
5+
## Usage
6+
```
7+
whatmap EXPRESSION
8+
```
79

8-
Examples:
9-
whatmap my_variable - Looks up the map containing the named variable.
10-
whatmap *0x1234 - Looks up the map containing the address 0x1234.
10+
Before using the script it must be loaded in to the debugger:
11+
```
12+
source PATHTOADDONS/what_map/what_map.py
13+
```
1114

12-
Note that the argument to "whatmap" needs to be addressable - in other words, you should use an
13-
argument that you would pass to "watch".
15+
## Examples
16+
17+
`whatmap my_variable` : looks up the map containing the named variable.
18+
19+
`whatmap *0x1234` : looks up the map containing the address 0x1234.
20+
21+
Note that the argument to `whatmap` needs to be addressable - in other words, you should use an
22+
argument that you would pass to `watch`.
1423

1524
This command works with vanilla GDB or within UDB. When run under UDB it will inspect the maps
1625
of the currently active child process - note that these don't exactly match the maps that were
1726
present at record time.
18-

0 commit comments

Comments
 (0)