c (refer to Listing 29-5),
for example, use the command reverse-search return. GDB obliges and displays the text:
(gdb) reverse-search return
17 return ret;
The search and reverse-search commands are especially helpful in large source files that have
dozens or hundreds of lines. One common use of the reverse-search command is to find the
file and/or line in which a variable is first used or in which it is defined. The search command
similarly enables you to locate with relative ease each location in which a program symbol (variable,
macro, or function) is used, perhaps to find the use that changes a variable unexpectedly or
the place where a function is called when it shouldn??™t be.
Summary
This chapter took you on a whirlwind tour of a few of the most common programs and utilities
used by Linux programmers. You learned how to use GCC to compile programs, how to use make
to automate compiling programs, and how to find information about programming libraries using
programs such as ldd, nm, and ldconfig. You also learned enough about the source code control
systems RCS and CVS to be comfortable with the terminology and how to use their most basic
features. Finally, you learned how to use the GNU debugger (GDB) to figure out why, or at least
where, a program fails.
Pages:
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459