14.2.1. Searching for text

To quickly find a text string in the current source file displayed in the File Editor pane:

  1. Enter the required text string into the Find data field above the window.

  2. Press the Enter key to find the first occurrence.

  3. Press Enter again to find the next occurrence.

As you enter a search string, RealView Debugger copies the string to the clipboard. This means that the most-recently used string is available when you next display the Find, or Find and Replace, dialog box.

To find a text string in the current source file using the Find dialog box:

  1. Position the cursor in the current file.

  2. Select Find → Find... to display the Find dialog box, shown in Figure 14.1.

    Figure 14.1. Find dialog box

    Find dialog box
  3. Enter the required text string into the Find field in the dialog box. The last search string used might already be displayed as copied from the clipboard.

  4. Click the Find button.

  5. When a match is highlighted either:

    • click the Find button again to search for the next occurrence of the text string

    • replace the current selection, see Searching and replacing text.

If you have configured your Search controls to enable wrapping, that is the default, and you do not replace all matched strings, the search cycles through the file and returns to the starting point. Then it begins again and continues until you click Close in the Find dialog box.

When the first match is found, you can move the focus to the File Editor pane and press F3 to find the next occurrence of the text string. It is not necessary to close the Find dialog box.

Changing the search direction

With the Find dialog box displayed, you can change the direction of the search regardless of the default, see Configuring searches. This might be useful if you miss a previous match and want to retrace your steps to verify the occurrence or to make a replacement.

Searching multiple tabs

If you display two or more file tabs in the current Code window then the search is restricted only to the file tab that is currently visible. However, you can select another file tab without closing the Find dialog box so continuing the search.

Regular expressions

With the Find dialog box displayed, you can select the Reg-expression check box so that it is checked. This forces the File Editor to treat the search string as a regular expression. See Using regular expressions for more details on using this feature.

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B