Red Hat Developer Toolset 1.X User Guide 1 Red Hat Developer Toolset 1.1
Total Page:16
File Type:pdf, Size:1020Kb
Red Hat Developer Toolset 1.x User Guide 1 Red Hat Developer Toolset 1.1 User Guide Installing and Using Red Hat Developer Toolset Edition 1 Jaromír Hradílek Red Hat Engineering Content Services [email protected] Jacquelynn East Red Hat Engineering Content Services [email protected] Matt Newsome Red Hat Software Engineering [email protected] 2 Legal Notice Legal Notice Copyright © 2012, 2013 Red Hat, Inc. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux® is the registered trademark of Linus Torvalds in the United States and other countries. Java® is a registered trademark of Oracle and/or its affiliates. XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries. All other trademarks are the property of their respective owners. 1801 Varsity Drive Raleigh, NC 27606-2072 USA Phone: +1 919 754 3700 Phone: 888 733 4281 Fax: +1 919 754 3701 Red Hat Developer Toolset 1.x User Guide 3 Abstract Red Hat Developer Toolset is a Red Hat offering for developers on the Red Hat Enterprise Linux platform. The Red Hat Developer Toolset User Guide provides an overview of this product, explains how to invoke and use the Developer Toolset versions of the tools, and links to resources with more in-depth information. 4 Table of Contents Table of Contents Preface 1. Document Conventions 1.1. Typographic Conventions 1.2. Pull-quote Conventions 1.3. Notes and Warnings 2. Getting Help and Giving Feedback 2.1. Do You Need Help? 2.2. We Need Feedback! I. Introduction 1. Red Hat Developer Toolset 1.1. About Red Hat Developer Toolset 1.2. Main Features 1.3. Compatibility 1.4. Getting Access to Red Hat Developer Toolset 1.4.1. Using RHN Classic 1.4.2. Using Red Hat Subscription Management 1.5. Installing Red Hat Developer Toolset 1.6. Updating Red Hat Developer Toolset 1.7. Uninstalling Red Hat Developer Toolset 1.8. Additional Resources II. Development Tools 2. GNU Compiler Collection (GCC) 2.1. GNU C Compiler 2.1.1. Installing the C Compiler 2.1.2. Using the C Compiler 2.1.3. Running a C Program 2.2. GNU C++ Compiler 2.2.1. Installing the C++ Compiler 2.2.2. Using the C++ Compiler 2.2.3. Running a C++ Program 2.3. GNU Fortran Compiler 2.3.1. Installing the Fortran Compiler 2.3.2. Using the Fortran Compiler 2.3.3. Running a Fortran Program 2.4. Additional Resources 3. GNU Debugger (GDB) 3.1. Installing the GNU Debugger 3.2. Preparing a Program for Debugging 3.3. Running the GNU Debugger 3.4. Listing Source Code 3.5. Setting Breakpoints 3.6. Starting Execution 3.7. Displaying Current Values 3.8. Continuing Execution 3.9. Additional Resources Red Hat Developer Toolset 1.x User Guide 5 4. binutils 4.1. Installing binutils 4.2. Using the GNU Assembler 4.3. Using the GNU Linker 4.4. Using Other Binary Tools 4.5. Additional Resources 5. elfutils 5.1. Installing elfutils 5.2. Using elfutils 5.3. Additional Resources 6. dwz 6.1. Installing dwz 6.2. Using dwz 6.3. Additional Resources III. Performance Monitoring Tools 7. SystemTap 7.1. Installing SystemTap 7.2. Using SystemTap 7.3. Additional Resources 8. Valgrind 8.1. Installing Valgrind 8.2. Using Valgrind 8.3. Additional Resources 9. OProfile 9.1. Installing OProfile 9.2. Using OProfile 9.3. Additional Resources IV. Integrated Development Environments 10. Eclipse 10.1. Installing Eclipse 10.2. Running Eclipse 10.3. Additional Resources V. Getting Help 11. Accessing Red Hat Product Documentation 12. Accessing the Customer Portal 12.1. The Plan Menu 12.2. The Deploy Menu 12.3. The Connect Menu 13. Contacting Global Support Services 13.1. Gathering Required Information 13.2. Escalating an Issue 13.3. Re-opening a Service Request 13.4. Additional Resources A. Changes in Version 1.0 A.1. Changes in GCC 4.7.0 6 Table of Contents A.1.1. Status and Features A.1.2. Language Compatibility A.1.3. ABI Compatibility A.1.4. Debugging Compatibility A.1.5. Other Compatibility A.2. Changes in GDB 7.4 A.2.1. New Features A.2.2. Compatibility Changes A.3. Changes in binutils 2.22.52 A.3.1. GNU Linker A.3.2. GNU Assembler A.3.3. Other Binary Tools B. Changes in Version 1.1 B.1. Changes in GCC 4.7.2 B.1.1. C++11 Compatibility B.1.2. Fortran B.1.3. Architecture-specific Options B.2. Changes in GDB 7.5 B.3. Changes in binutils 2.23.51 B.3.1. GNU Linker B.3.2. GNU Assembler B.3.3. Other Binary Tools B.4. Changes in elfutils 0.154 B.5. Changes in Valgrind 3.8.1 B.6. Changes in OProfile 0.154 C. Revision History Index Red Hat Developer Toolset 1.x User Guide 7 Preface 1. Document Conventions This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information. In PDF and paper editions, this manual uses typefaces drawn from the Liberation Fonts set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later includes the Liberation Fonts set by default. 1.1. Typographic Conventions Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows. Mono-spaced Bold Used to highlight system input, including shell commands, file names and paths. Also used to highlight keys and key combinations. For example: To see the contents of the file my_next_bestselling_novel in your current working directory, enter the cat my_next_bestselling_novel command at the shell prompt and press Enter to execute the command. The above includes a file name, a shell command and a key, all presented in mono-spaced bold and all distinguishable thanks to context. Key combinations can be distinguished from an individual key by the plus sign that connects each part of a key combination. For example: Press Enter to execute the command. Press Ctrl+Alt+F2 to switch to a virtual terminal. The first example highlights a particular key to press. The second example highlights a key combination: a set of three keys pressed simultaneously. If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in mono-spaced bold. For example: File-related classes include filesystem for file systems, file for files, and dir for directories. Each class has its own associated set of permissions. Proportional Bold This denotes words or phrases encountered on a system, including application names; dialog box text; labeled buttons; check-box and radio button labels; menu titles and sub-menu titles. For example: Choose System → Preferences → Mouse from the main menu bar to launch Mouse Preferences. In the Buttons tab, click the Left-handed mouse check box and click Close to switch the primary mouse button from the left to the right (making the mouse suitable for use in the left hand). To insert a special character into a gedit file, choose Applications → Accessories → Character Map from the main menu bar. Next, choose Search → Find… from the 8 Preface Character Map menu bar, type the name of the character in the Search field and click Next. The character you sought will be highlighted in the Character Table. Double-click this highlighted character to place it in the Text to copy field and then click the Copy button. Now switch back to your document and choose Edit → Paste from the gedit menu bar. The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context. Mono-spaced Bold Italic or Proportional Bold Italic Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example: To connect to a remote machine using ssh, type ssh [email protected] at a shell prompt. If the remote machine is example.com and your username on that machine is john, type ssh [email protected]. The mount -o remount file-system command remounts the named file system. For example, to remount the /home file system, the command is mount -o remount /home. To see the version of a currently installed package, use the rpm -q package command.