Example 14-1 Sample Output for the find command

$ cat example.c #include <stdio.h> #include <stdlib.h>

int main()

{

char *str;

str = (char *) malloc (15); strcpy(str,"hihi-hikh"); return 0;

}

(gdb) find &str[0], &str[15], "hi" 0x400123e0

0x400123e2

0x400123e5

3 patterns found.

(gdb) find/2 &str[0], &str[15], "hi" 0x400123e0

0x400123e2

2 patterns found.

(gdb) find/2b &str[0], &str[15], 0x68 0x400123e0

0x400123e2

2 patterns found.

(gdb) find/2b &str[0], +10, 0x68 0x400123e0

0x400123e2

2 patterns found.

(gdb) find/2b &str[0], +10, 0x68, 0x69 0x400123e0

0x400123e2

2 patterns found.

(gdb) find &str[0], &str[15], "hi", "hi" 0x400123e0

1 pattern found.

The following examples provide sample usages of the different parameters in the find command:

Using the start address (start-address), end address (end-address), and patterns (expr1, expr2)

(gdb) find &a[0], &a[10], "el",'l' 2 patterns found.

198 HP-UX Configuration-Specific Information