@@ -10,6 +10,7 @@ Features:
1010- Parallel, incremental indexing using sharded Xapian database
1111- Indexes cross-references by analyzing ELF relocations
1212- Query the database with a simple query language and custom output formats
13+ - Disassemble symbols matching a query
1314- Generate symbol reference graphs in DOT format
1415
1516## Installation ##
@@ -74,26 +75,36 @@ Available options:
7475 available, to find the source file for a compiled file, if it can't be found
7576 in any other way.
7677
77- ### Graph generation ###
78+ ### Disassembling ###
7879
79- Generate an SVG image showing at most 20 routes from symbol ` main ` in
80- ` main.o ` to all symbols in section ` .text ` in files matching wildcard
81- ` Algorithms_* ` :
80+ After a directory is indexed, you can disassemble symbols matching a search
81+ query.
8282
83- bdx graph 'main path:main.o' 'section:".text" AND path:Algorithms*' -n 20 | dot -Tsvg > graph.svg
83+ You can set the command to disassemble with the ` -D ` , ` --disassembler ` option,
84+ which can contain ` {} ` placeholders for replacement.
8485
85- Example graphs: ![ ASTAR] ( ./examples/astar.svg ) ![ BFS] ( ./examples/bfs.svg ) ![ DFS] ( ./examples/dfs.svg )
86+ ```
87+ $ bdx disass tree node defp source:./gcc/cp/parser* section:.text
8688
87- By default this generates paths by using the ASTAR algorithm, the `--algorithm
88- BFS` or ` --algorithm DFS` options will use
89- breadth-first-search/depth-first-search algorithms which can generate different
90- graphs and can be slower/faster depending on the index and the queries
91- provided.
89+ /src/gcc-12/build/gcc/cp/parser.o: file format elf64-x86-64
90+
91+
92+ Disassembly of section .text:
93+
94+ 000000000000a1d0 <defparse_location(tree_node*)>:
95+ a1d0: 48 8b 47 08 mov 0x8(%rdi),%rax
96+ a1d4: 48 8b 10 mov (%rax),%rdx
97+ a1d7: 48 8b 40 08 mov 0x8(%rax),%rax
98+ a1db: 8b 7a 04 mov 0x4(%rdx),%edi
99+ a1de: 8b 50 04 mov 0x4(%rax),%edx
100+ a1e1: 89 fe mov %edi,%esi
101+ a1e3: e9 00 00 00 00 jmp a1e8 <defparse_location(tree_node*)+0x18>
102+ ```
92103
93104### Searching ###
94105
95- ` bdx search ` command accepts a query string. A simple query language is
96- recognized.
106+ ` bdx search ` and other commands accepts a query string. A simple query
107+ language is recognized.
97108
98109```
99110$ bdx search -n 5 tree
@@ -183,6 +194,22 @@ $ bdx search -n 5 -f '0x{address:0>10x}|{section:<10}|{type:8}|{demangled}' tree
183194 bdx search section:.rodata AND size:1000..
184195
185196
197+ ### Graph generation ###
198+
199+ Generate an SVG image showing at most 20 routes from symbol ` main ` in
200+ ` main.o ` to all symbols in section ` .text ` in files matching wildcard
201+ ` Algorithms_* ` :
202+
203+ bdx graph 'main path:main.o' 'section:".text" AND path:Algorithms*' -n 20 | dot -Tsvg > graph.svg
204+
205+ Example graphs: ![ ASTAR] ( ./examples/astar.svg ) ![ BFS] ( ./examples/bfs.svg ) ![ DFS] ( ./examples/dfs.svg )
206+
207+ By default this generates paths by using the ASTAR algorithm, the `--algorithm
208+ BFS` or ` --algorithm DFS` options will use
209+ breadth-first-search/depth-first-search algorithms which can generate different
210+ graphs and can be slower/faster depending on the index and the queries
211+ provided.
212+
186213## License ##
187214
188215```
0 commit comments