/ | ?[string] (idb mode only)

Search in the source for a string, or repeat the last search.

Syntax

/[stringm|M]
?[stringm|M]

Parameters

/

Tells the debugger to search forward.

?

Tells the debugger to search backward.

string

Specifies the string you want to search for.

If you do not specify string, the debugger repeats the most recent search.

m

Searches a 32-bit chunk of memory.

M

Searches a 64-bit chunk of memory.

Description

This command searches forward or backward, starting at the current position in the current source file, for the specified character string. If you do not specify a string, the debugger repeats the most recent search.

The debugger interprets anything on the same line after the / as the search string, so do not quote the string.

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.

Tip iconTip

Pressing the Enter key repeats the most recent forward or backward search, using the same pattern. You do not need to specify / or ?.

Note that the debugger performs alias expansion on the rest of the line before the /, possibly changing the search string. For example, suppose you have j = in your source code:

(idb) alias zzz "/j"

(idb) zzz =

zzz expands to /j = and finds the next instance of j = in the source code.

Examples

This example demonstrates three separate forward searches and their results.

(idb) /_firstNode
60 NODETYPE* _firstNode;
(idb) /append
65 void append (NODETYPE* const node)
(idb) /
145 void List<NODETYPE>::append(NODETYPE* const node)
  

This example demonstrates three separate backward searches and their results.

(idb) ?append
145 void List<NODETYPE>::append(NODETYPE* const node)
(idb) ?
65 void append (NODETYPE* const node);
(idb) ?_firstNode
60 NODETYPE* _firstNode;

See Also


Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.