The following search commands search through the current source file to help you find the lines to list:
search_source_file_command
search_source_file_command
: forward-search [ string ]
| reverse-search [ string ]
The string is actually just the rest of the line, not a string literal. The rest of the line is still having alias expansion done on it.
Use a slash (/) to search forward from the most recently listed line; use a question mark (?) to search backward. Like most searches, it will stop at the end (or beginning) of the file being searched, and will wrap if the command is repeated at that point.
When the string is omitted, the previous search continues from where it found the string. When the string is present, the search starts from either the start (/) or the end (?) of the current line.
When a match is found, the debugger lists the line number and the line. That line becomes the starting point for any further searches, or for a list command. For example:
To locate _firstNode:
(idb) /_firstNode
69 NODETYPE* _firstNode;
(idb) forward-search _firstNode
69 NODETYPE* _firstNode;
Then to locate append before line 69:
(idb) ?append
65 void append (NODETYPE* const node);
(idb) reverse-search append
65 void append (NODETYPE* const node);
Then to locate append after line 65:
(idb) /append
145 void List<NODETYPE>::append(NODETYPE* const node)
(idb) forward-search append
145 void List<NODETYPE>::append(NODETYPE* const node)
The debugger provides parameterized aliases and debugger variables of arbitrary types. You can use these to do list traversal (see the array navigation example).