Red Hat Enterprise Linux 6Developer GuideAn introduction to application developmenttools in Red Hat Enterprise Linux 6Dave BrolleyWilliam CohenRoland
Prefacex• search or browse through a knowledgebase of technical support articles about Red Hat products.• submit a support case to Red Hat Global Supp
Index90VValgrindprofiling, 62commands, 62documentation, 64plug-in for Eclipse, 63tools, 62usage, 63toolscachegrind, 63callgrind, 63helgrind, 63massif,
Chapter 1.1Introduction to EclipseEclipse is a powerful development environment that provides tools for each phase of the developmentprocess. It is in
Chapter 1. Introduction to Eclipse2A project can be imported directly into Eclipse if it contains the necessary Eclipse metafiles. Eclipseuses these f
Help In Eclipse3Figure 1.3. Import Wizard1.2. Help In EclipseEclipse features a comprehensive internal help library that covers nearly every facet of
Chapter 1. Introduction to Eclipse4Figure 1.4. HelpTo open the main Help menu, navigate to Help > Help Contents. The Help menu displays all theavai
Development Toolkits5The tabs at the bottom of the Contents field provides different options for accessing Eclipsedocumentation. You can navigate thr
Chapter 1. Introduction to Eclipse6editor, for example, provides error parsing in the context of a single file, but some errors may onlybe visible whe
Chapter 2.7The Eclipse Integrated DevelopmentEnvironment (IDE)The entire user interface in Figure 2.1, “Eclipse User Interface (default)” is referred
Chapter 2. The Eclipse Integrated Development Environment (IDE)8Figure 2.1, “Eclipse User Interface (default)” displays the default workbench for C/C+
User Interface9The View Menu button in the Project Explorer View allows you to configure whether projects orworking sets are the top-level items in th
Developer GuideJeff JohnstonBenjamin KosnikAleksander KurtakovChris MollerPhil MuldoonAndrew OverholtCharley WangKent Sebastian
Chapter 2. The Eclipse Integrated Development Environment (IDE)10The Tasks view allows you to track specially-marked reminder comments in the code. Th
Useful Hints11Alternatively, you can also use Edit > Add Task to open the task Properties menu (Figure 2.8, “TaskProperties”). This will allow you
Chapter 2. The Eclipse Integrated Development Environment (IDE)12Figure 2.10. Quick Access MenuIn Figure 2.10, “Quick Access Menu”, clicking Views >
The quick access menu13Figure 2.11. Keyboard ShortcutsTo configure Eclipse keyboard shortcuts, press Shift+Ctrl+L again while the Keyboard Shortcutsli
Chapter 2. The Eclipse Integrated Development Environment (IDE)14To customize the current perspective, navigate to Window > Customize Perspective.
The quick access menu15Figure 2.15. Menu Visibility TabThe Menu Visibility tab configures what functions are visible in each main menu item. For a bri
Chapter 2. The Eclipse Integrated Development Environment (IDE)16Figure 2.16. Command Group Availability TabCommand groups add functions or options to
libhover Plug-in17Figure 2.17. Shortcuts TabThe Shortcuts tab configures what menu items are available under the following submenus:• File > New• W
Chapter 2. The Eclipse Integrated Development Environment (IDE)18In addition, C++ also has type definitions and templated classes to deal with. Such i
libhover Plug-in19Figure 2.19. Using Hover HelpTo use code completion, select a string in the code and press Ctrl+Space. This will display allpossible
Red Hat Enterprise Linux 6 Developer GuideAn introduction to application development tools in Red HatEnterprise Linux 6Edition 0Author Dave Brolley br
20
Chapter 3.21Libraries and Runtime SupportRed Hat Enterprise Linux 6 supports the development of custom applications in a wide variety ofprogramming la
Chapter 3. Libraries and Runtime Support22This type of compatibility is defined by conformance with specified Application Binary Interfaces(ABIs).3.2.
Static Linking23compliant to the latest revision of the language standards available in more recent Red Hat EnterpriseLinux releases.As such, Red Hat
Chapter 3. Libraries and Runtime Support24• bo_CN• bo_IN• shs_CA• ber_DZ• ber_MA• en_NG• fil_PH• fur_IT• fy_DE• ha_NG• ig_NG• ik_CA• iu_CA• li_BE• li_
The GNU C Library25• sched_getcpu• accept4• fallocate• fallocate64• inotify_init1• dup3• epoll_create1• pipe2• signalfd• eventfd• eventfd_read• eventf
Chapter 3. Libraries and Runtime Support263.3.2. The GNU C++ Standard LibraryThe libstdc++ package contains the GNU C++ Standard Library, which is an
The GNU C++ Standard Library27• <mutex>• <random,• <ratio>• <regex>• <system_error>• <thread>• <tuple>• <typ
Chapter 3. Libraries and Runtime Support28SYNOPSIS Inherits std::_Vector_base< _Tp, _Alloc >. Public Types typedef _Alloc allocato
Boost29• boost-test• boost-thread• boost-waveNot included in the meta-package are packages for static linking or packages that depend on theunderlying
Developer Guide This document describes the different features and utilities that make Red Hat Enterprise Linux 6an ideal enterprise platform for app
Chapter 3. Libraries and Runtime Support30• Statechart• TR1• Typeof• Xpressive• Asio• Bitmap• Circular Buffer• Function Types• Fusion• GIL• Interproce
Qt31The main site for the development of Boost is hosted on boost.org11.3.3.4. QtThe qt package provides the Qt (pronounced "cute") cross-pl
Chapter 3. Libraries and Runtime Support32• http://doc.qt.nokia.com/4.6/qt4-intro.html3.3.4.2. Qt CreatorQt Creator is a cross-platform IDE tailored t
KDE Development Framework33SonnetSonnet is a multilingual spell-checking application that supports automatic language detection,primary/backup diction
Chapter 3. Libraries and Runtime Support34KNewStuff2KNewStuff2 is a collaborative data sharing library used by many KDE4 applications. For moreinforma
Java35Help on module math:NAME mathFILE /usr/lib64/python2.6/lib-dynload/mathmodule.soDESCRIPTION This module is always available. It provides access
Chapter 3. Libraries and Runtime Support363.3.8. RubyThe ruby package provides the Ruby interpreter and adds support for the Ruby programminglanguage.
Perl37The main site for the development of Ruby is hosted on http://www.ruby-lang.org. The http://www.ruby-doc.org site also contains Ruby documentati
Chapter 3. Libraries and Runtime Support383.3.9.3. Perl DocumentationThe perldoc tool provides documentation on language and core modules. To learn mo
Chapter 4.39Compiling and BuildingRed Hat Enterprise Linux 6 includes many packages used for software development, inluding tools forcompiling and bui
vPreface vii1.
Chapter 4. Compiling and Building40• Updates in the 4.2 Series: http://gcc.gnu.org/gcc-4.2/changes.html• Updates in the 4.3 Series: http://gcc.gnu.or
Language Compatibility41The default system C++ compiler included with Red Hat Enterprise Linux 6 conforms to the C++ ABIdefined by the Itanium C++ ABI
Chapter 4. Compiling and Building42The C ABI is considered to be stable, and has been so since at least RHEL3 (again, barring anyincompatibilities me
Backwards Compatibility Packages43Object file changes, such as the ones listed above, may interfere with the portable use of prelink.4.1.4. Backwards
Chapter 4. Compiling and Building44In brief, the tools work via the gcc command. This is the main driver for the compiler. It can be usedfrom the com
Running GCC45}The following procedure illustrates the compilation process for C++ in its most basic form.Procedure 4.2. Compiling a 'Hello World&
Chapter 4. Compiling and Building464.1.6.4. Recommended Optimization OptionsDifferent projects require different optimization options. There is no on
Running GCC47String dump of section '.GCC.command.line': [ 0] hello.c [ 8] -mtune=generic [ 17] -O3 [ 1b] -Wall [
Chapter 4. Compiling and Building483. Recompile and optimize source.c with profiling information gathered in step one:gcc source.c -fprofile-use -O2
Running GCC49$ file hello64hello64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6
Developer Guidevi5.2. GDB ...
Chapter 4. Compiling and Building50Also important is to note that building with -m32 will in not adapt or convert a program to resolve anyissues aris
Autotools Plug-in for Eclipse51The Autotools suite's most commonly-used tools are:autoconfGenerates the configure script from an input file (e.g.
Chapter 4. Compiling and Building52If a configure.ac file is available instead, then autoconf will automatically create the configurescript based on
Chapter 5.53DebuggingUseful, well-written software generally goes through different phases of application development,and mistakes can occur in each p
Chapter 5. Debugging54not only the characteristics of each individual elements in the structure, but the morphology of thestructure as well.GDB requir
Running GDB55The execution of a stopped program can be resumed in a number of ways. The following are the mostcommon.c (continue)The continue command
Chapter 5. Debugging56Ensure that the resulting binary hello is in the same directory as hello.c.2. Run gdb on the hello binary, i.e. gdb hello.3. Aft
Conditional Breakpoints57 (gdb) n Hello, World! 9 return (0);The following sections describe more complex applications of GDB.5.2.3.
Chapter 5. Debugging58 1 breakpoint keep y 0x080483f5 in main at iterations.c:8 stop only if i == 8936 brea
Variable Tracking at Assignments59NoteNot all documented characteristics will apply to all instances of GDB because it is still in activedevelopment,
viiPrefaceThis book describes the some of the more commonly-used programming resources in Red HatEnterprise Linux 6. Each phase of the application dev
Chapter 5. Debugging60To address this, the Red Hat Enterprise Linux 6 version of GDB is now compatible with Python pretty-printers. This allows the re
Chapter 6.61ProfilingDevelopers profile programs to focus attention on the areas of the program that have the largestimpact on performance. The types
Chapter 6. Profiling62Figure 6.2. Profile ConfigurationFor more information on configuring and performing a profile run with each tool in Eclipse, ref
Using Valgrind63cachegrindCachegrind is a cache profiler that accurately pinpoints sources of cache misses in code byperforming a detailed simulation
Chapter 6. Profiling64• Memcheck• Massif• CachegrindThe Valgrind plug-in for Eclipse is provided by the eclipse-valgrind package. For moreinformation
Using OProfile65oparchiveThe oparchive command generates a directory populated with executable, debug, and OProfilesample files. This directory can be
Chapter 6. Profiling66Ease of UseThe OProfile Plug-in provides generally useful defaults for all options, usable for a majority of profilingruns. In a
SystemTap Compile Server67The following sections describe new SystemTap features available in the Red Hat Enterprise Linux 6release.6.4.1. SystemTap C
Chapter 6. Profiling68• The module was compiled using the --unprivileged option.• The module meets the restrictions required for use by an unprivilege
Eclipse-Callgraph69• SystemTap Beginner's Guide• SystemTap Tapset Reference• SystemTap Language Reference (documentation supplied by IBM)The Sys
PrefaceviiiFile-related classes include filesystem for file systems, file for files, and dir fordirectories. Each class has its own associated set of
Chapter 6. Profiling70Figure 6.3. Eclipse-Callgraph ProfileAfter selecting an executable to profile, Eclipse-Callgraph will ask which files to probe.
The Callgraph View71Figure 6.4. Selecting Files to Probe6.5.2. The Callgraph ViewThe Callgraph view's toolbar allows you to select a perspective
Chapter 6. Profiling72Figure 6.6. Radial ViewThe Radial View displays all functions branching out from main(), with each function represented asa node
The Callgraph View73Tree View also includes a thumbnail viewer to help you navigate through different call depths of thefunction tree.Figure 6.8. Leve
Chapter 6. Profiling74Figure 6.10. Aggregate ViewThe Aggregate View depicts all functions as boxes; the size of each box represents a function'se
Perf Tool Commands75switches. For example, PCL counters can compute the Instructions Per Clock (IPC) from a process'scounts of instructions retir
Chapter 6. Profiling76The perf tool can also record samples. For example, to record data on the make command and itschildren, use:perf record -- make
ftrace77 11.63%54959620202 libxml2.so.2.7.6 [.] xmlXPathNodeSetAdd__internal_alias 8.60%40634845107 libxml2.so.2.7.6
Chapter 6. Profiling786.7.2. ftrace DocumentationThe ftrace framework is fully documented in the following files:• ftrace - Function Tracer: file:///u
79Appendix A. Revision HistoryRevision 1.0 Thu Oct 08 2009 Don Domingo [email protected] push
Notes and Warningsixbooks Desktop documentation drafts mss photos stuff svnbooks_tests Desktop1 downloads images notes scrip
80
81IndexSymbols.spec filespecfile Editorcompiling and building, 52Aadded localesGNU C Librarylibraries and runtime support, 24advantagesPython pretty-p
Index82SystemTap, 67compiling a C Hello World programusageGCC, 44compiling a C++ Hello World programusageGCC, 45compiling and buildingAutotools, 50com
83Rubylibraries and runtime support, 36SystemTapprofiling, 68Valgrindprofiling, 64DTK (development toolkits)development toolkitsEclipse, 5Dynamic Help
Index84function tracerprofilingftrace, 77fundamental commandsfundamentalsGNU debugger, 54fundamental mechanismsGNU debuggerdebugging, 53fundamentalsGN
85installationdebuginfo-packagesdebugging, 53integrated development environmentEclipse, 7interfaces (added new)GNU C Librarylibraries and runtime supp
Index86Java, 35documentation, 35KDE Development Framework, 32Akonadi, 33documentation, 34KDE4 architecture, 32kdelibs-devel, 32KHTML, 33KIO, 33KJS, 33
87new librariesBoostlibraries and runtime support, 29New Project WizardprojectsEclipse, 2nexttoolsGNU debugger, 55OopannotatetoolsOProfile, 64oparchiv
Index88oprofiled, 64Performance Counters for Linux (PCL) andperf, 74plug-in for EclipseEclipse-Callgraph, 69SystemTap, 66Valgrind, 62Project Exploreru
89Boostlibraries and runtime support, 28subsystem (PCL)profilingPerformance Counters for Linux (PCL) andperf, 74supported templatesAutotoolscompiling
Commentaires sur ces manuels