Red Hat ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE Manual

Developer tools guide
Hide thumbs Also See for ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE:

Advertisement

Red Hat Enterprise Linux 4
Developer Tools Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE and is the answer not in the manual?

Questions and answers

Summary of Contents for Red Hat ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE

  • Page 1 Red Hat Enterprise Linux 4 Developer Tools Guide...
  • Page 2 All other trademarks referenced herein are the property of their respective owners. The GPG fingerprint of the security@redhat.com key is: CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E...
  • Page 3: Table Of Contents

    Table of Contents 1. Overview of Red Hat Enterprise Linux Developer Tools............1 2. Basic Principles of the Tools......................3 2.1. Compiler and Development Tools ..................3 2.2. Libraries ..........................3 2.3. Auxiliary Development Tools .................... 4 2.4. , the GNU Compiler Collection................... 4 2.5.
  • Page 5: Overview Of Red Hat Enterprise Linux Developer Tools

    Using binutils, the Gnu Binary Utilities • HTML, PDF, and RPM versions of the manuals are available on the Documentation CD and online at http://www.redhat.com/docs/. For more information on the tools and their history, see the following websites: http://sources.redhat.com/ •...
  • Page 6 Chapter 1. Overview of Red Hat Enterprise Linux Developer Tools...
  • Page 7: Basic Principles Of The Tools

    Chapter 2. Basic Principles of the Tools Red Hat Enterprise Linux Developer Tools’s C and C++ compilers, macro-assembler, debugger, bi- nary utilities, libraries, and other development tools provide productivity, flexibility, performance, and portability. This chapter begins with a summary of the tools, then describes each tool in more detail. To use a tool, open your system’s terminal shell window and enter the tool’s name as a command , for instance, invokes the compiler.
  • Page 8: Libraries

    Chapter 2. Basic Principles of the Tools 2.2. Libraries Library Description ANSI C runtime library libc C math subroutine library libm C++ class library libstdc++ 2.3. Auxiliary Development Tools The following components are also provided for general development: Component Description Assembler (refer to Section 2.6 , the GNU Assembler and Using as, the Gnu Assembler)
  • Page 9 Chapter 2. Basic Principles of the Tools GNU preprocessor that processes all the header files and macros that your target requires (refer • to Section 2.5 , the GNU Preprocessor). GNU assembler that produces binary code from assembly language code and puts it in an object •...
  • Page 10: The Gnu Preprocessor

    Chapter 2. Basic Principles of the Tools For more information on the GNU compiler and its options, refer to Using the GNU Compiler Col- lection (GCC). 2.5. , the GNU Preprocessor is a C-compatible macro preprocessor that works with the GNU compiler to direct the parsing of C preprocessor directives.
  • Page 11: Object Files

    Chapter 2. Basic Principles of the Tools 2.6.1. Object Files The assembler creates object files that, by convention, have the extension. These are binary files that contain the assembled source code, information to help the linker integrate the object file into an executable program, debugging information and tables of all of the symbols used in the source code.
  • Page 12: Gdb, The Debugging Tool

    Chapter 2. Basic Principles of the Tools The linker is controlled by a linker script which is a text file containing commands in a simple lan- guage. The main purpose of the script is to describe how sections in the input files should be mapped into sections in the output file and to control memory layout of the output file.
  • Page 13: Makefile

    Chapter 2. Basic Principles of the Tools . The has rules which explain how and when to remake certain files that are the makefile makefile targets of a particular rule. A simple rule has the following form: makefile target... : dependency... command target is usually the name of a file that a program generates;...
  • Page 14: Binutils, The Gnu Binary Utilities

    Chapter 2. Basic Principles of the Tools depends on eight object files; the object file, , depends on the source file, , and on main.o main.c header file. A shell command follows each line that contains a target and dependencies, defs.h saying how to update the target file;...
  • Page 15: Reading Info Documentation

    2.13. Learn More About the Tools There are many sources to teach you more about GNU tools: For general information about the tools, see: http://www.redhat.com/docs/manuals/gnupro/ • For help with using the tools, see Chapter 3 Developing with Red Hat Enterprise Linux Developer •...
  • Page 16 Chapter 2. Basic Principles of the Tools...
  • Page 17: Developing With Red Hat Enterprise Linux Developer Tools

    Developer Tools Use the tutorials in this chapter to learn about standard native development with the tools. See http://www.redhat.com/docs/manuals/gnupro/ for details about the tools. 3.1. Create Source Code To start, create the following sample source code file and save it as .
  • Page 18: Debug The Executable

    Chapter 3. Developing with Red Hat Enterprise Linux Developer Tools 3.3. Run the Executable To run the program, use the following example: ./hello The program generates hello world! 3 + 4 = 7 and returns when the program exits. 3.4. Debug the Executable To start GDB, use the following commands: gdb hello After the initial copyright and configuration information, GDB returns its own prompt,...
  • Page 19 Chapter 3. Developing with Red Hat Enterprise Linux Developer Tools The following output displays: main (void) int b; a = 3; b = 4; printf ("Hello, world!\n"); foo (b); return 0; 7. To list a specific function code, use the command with the name of the function to be list display.
  • Page 20: Assembler Listings

    Chapter 3. Developing with Red Hat Enterprise Linux Developer Tools #1 0x15c in main () at hello.c:18 13. To exit the program and quit the debugger, type: quit 3.5. Assembler Listings The compiler normally turns a text based source file into a binary object file. It is possible however to instruct it to just convert the source code into assembler and stop there.
  • Page 21 Chapter 3. Developing with Red Hat Enterprise Linux Developer Tools You could also use the option to produce a dissassembly of all of the sections in an object file, not only those that have been marked as containing instructions, and to tell to disassemble objdump...
  • Page 22 Chapter 3. Developing with Red Hat Enterprise Linux Developer Tools...
  • Page 23: Index

    Index make example makefile, 9 overview, 8 as (GNU assembler) overview, 6 assembler directives, 7 objdump assembler listings disassembles an object file, 16 overview, 16 object files, 7 auxiliary development tools overview, 4 run the executable tutorial, 14 binutils (GNU binary utilities) overview, 10 tools basic principles, 3...

Table of Contents