Page 3 - Summary of GDB
Table of Contents Summary of GDB ........................................................................................................................ 15 Free Software......................................................................................................................15Contributo...
Page 7 - and
14.10.8 Scenarios in memory debugging.....................................................................174 14.10.8.1 Stop when freeing unallocated or deallocated blocks.............................17414.10.8.2 Stop when freeing a block if bad writes occurred outside blockboundary....................
Page 12 - Interface; Miscellaneous GDB commands in; 2 Reporting Bugs in GDB; configure
20.7 Errors.........................................................................................................................30220.8 Information on breakpoints.......................................................................................30220.9 Invalidation notices......................
Page 13 - List of Tables
List of Tables 14-1 Memory Debugging Commands in Interactive and Batch Mode.............................177 16-1 Invocation commands...............................................................................................254 16-2 Window mode commands...............................................
Page 14 - Sample Output for the
List of Examples 14-1 Sample Output for the find command....................................................................198 14-2 Sample Commands to Print NaT Registers...............................................................214 14 List of Examples
Page 15 - Free Software; Contributors to GDB; GNU
Summary of GDB The purpose of a debugger such as GDB is to allow you to see what is going on “inside”another program while it executes―or what another program was doing at the momentit crashed. GDB allows you to do the following: • Load the executable along with any required arguments. • Stop your p...
Page 19 - A Sample GDB Session; foo
1 A Sample GDB Session This chapter describes the most common GDB commands with the help of an example. The following topics are discussed: • Loading the Executable • Setting the Display Width • Setting Breakpoints • Running the Executable under GDB • Stepping to the next line • Stepping into a Subr...
Page 20 - Setting Display width; m4 built-in changequote; Setting Breakpoints; run; Stepping to the next line in the source program; next
$ (gdb) m4 HP gdb 3.0 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.Copyright 1986 - 2001 Free Software Foundation, Inc.Hewlett-Packard Wildebeest 3.0 (based on GDB ) is covered by theGNU General Public License. Type "show copying" to see the conditions tochange it and/or distribute copies. T...
Page 25 - Getting In and Out of GDB; gdb
2 Getting In and Out of GDB This chapter discusses how to start GDB, and exit out of it. The essentials are: • type '(gdb)' to start GDB. • type quit or C-d to exit. 2.1 Invoking GDB Invoke GDB by running the program ( gdb ). Once started, GDB reads commands from the terminal until you tell it to ex...
Page 28 - Program exited normally.
' -n '). Exit with nonzero status if an error occurs in executing the GDB commands in the command files. Batch mode may be useful for running GDB as a filter,for example to download and run a program on anothercomputer; in order to make this more useful, the message Program exited normally. (which i...
Page 30 - Redirecting WDB input and output to a file; or
' xdb_trans.html ', which is usually installed in the directory /opt/langtools/wdb/doc on HP-UX systems. -interpreter interp Use the interpreter interp for interface with thecontrolling program or device. This option is meant tobe set by programs which communicate with GDB usingit as a back end. For...
Page 33 - GDB Commands; step; Command completion; TAB
3 GDB Commands You can abbreviate a GDB command to the first few letters of the command name, ifthat abbreviation is unambiguous; and you can repeat certain GDB commands bytyping just RET ). You can also use the TAB key to get GDB to fill out the rest of a word in a command (or to show you the alt...
Page 39 - Running Programs Under GDB
4 Running Programs Under GDB When you run a program under GDB, you must first generate debugging informationwhen you compile it using compiler option cc -g -O . You may start GDB with its arguments, if any, in an environment of your choice. Ifyou are doing native debugging, you may redirect your pro...
Page 41 - “Program Input and Output”
program. See “Program Input and Output” (page 43) . WARNING! You can redirect input and output, but you cannot use pipes to pass the output ofthe program you are debugging to anotherprogram; if you attempt this, GDB is likely towind up debugging the wrong program. NOTE: • When you issue the run comm...
Page 43 - directory; Program Input and Output
You can use the string '$cwd' to refer to whatever is the current working directory atthe time GDB searches the path. If you use '.' instead, it refers to the directory whereyou executed the path command. GDB replaces '.' in the directory argument (with the current path) before adding directory to t...
Page 44 - Debugging a Running Process; RET
NOTE: • You can redirect your program input and output using shell redirection with the run command. For example, run > outfile starts your program, diverting its output to the file ' outfile '. • An explicit redirection in run overrides the tty command's effect on the input/output device, but no...
Page 45 - “Optional warnings and messages” (page 284)
NOTE: • To use attach , your program must be running in an environment which supports processes; for example, attach does not work for programs on bare-board targets that lack an operating system. • You must also have permission to send the process a signal. • When you use attach , the debugger find...
Page 46 - Debugging programs with multiple threads; see the IDs of currently known threads.
On some operating systems, a program cannot be executed outside GDB while youhave breakpoints set on it inside GDB. You can use the kill command in this situation to permit running your program outside the debugger. The kill command is also useful if you wish to recompile and relink your program, si...
Page 49 - threadno
threadno is the internal GDB thread number, as shown in the first field of the ' info threads ' display. To apply a command to all threads, use thread apply all args. Whenever GDB stops your program, due to a breakpoint or a signal, it automaticallyselects the thread where that breakpoint or signal ...
Page 50 - mode
set follow-fork-mode mode Set the debugger response to a program call of fork or vfork . A call to fork or vfork creates a new process. The mode can be: parent The original process is debugged aftera fork. The child process runsunimpeded. This is the default. child The new process is debugged after ...
Page 51 - Stopping and Continuing
5 Stopping and Continuing The principal purpose of a debugger is to let you stop your program before it terminatesabnormally or runs into trouble, so that you can investigate and determine the reason. Inside GDB, your program can stop for several reasons, such as a signal, a breakpoint,or reaching a...
Page 58 - function
5.1.3 Deleting breakpoints It is often necessary to eliminate a breakpoint, watchpoint, or catchpoint once it hasdone its job and you no longer want your program to stop there. This is called deletingthe breakpoint. A breakpoint that has been deleted no longer exists; it is forgotten. With the clear...
Page 60 - “Expressions”
say, to just set a watchpoint on a variable name, and specify a condition that testswhether the new value is an interesting one. Break conditions can have side effects, and may even call functions in your program.This can be useful, for example, to activate functions that log program progress, or to...
Page 62 - “Commands for controlled
You can use breakpoint commands to start your program up again. Simply use the continue command, or step , or any other command that resumes execution. Any other commands in the command list, after a command that resumes execution,are ignored. This is because any time you resume execution (even with...
Page 64 - Continuing and stepping; “Break
When this message is printed, you need to disable or remove some of thehardware-assisted breakpoints and watchpoints, and then continue. 5.2 Continuing and stepping Continuing means resuming program execution until your program completes normally.In contrast, stepping means executing just one more “...
Page 68 - signal; print
NOTE: Use caution if you disable all signals from certain processes. Disabling ' SIGTRAP ' in your program may cause your program to hang. HP-UX uses ' SIGTRAP ' to communicate with the debugger. If you disable all signals from certain processes so that signals will be delivered to the right process...
Page 69 - “Giving your program a signal” (page 121); “Debugging programs with multiple
pass GDB should allow your program to see this signal; your program canhandle the signal, or else it may terminate if the signal is fatal and nothandled. nopass GDB should not allow your program to see this signal. When a signal stops your program, the signal is not visible to the program until youc...
Page 71 - Examining the Stack; main
6 Examining the Stack When your program has stopped, the first thing you need to know is where it stoppedand how it got there. Each time your program performs a function call, information about the call is generated.The information includes the location of the call in your program, the arguments oft...
Page 73 - addr
The names where and info stack (abbreviated info s ) are additional aliases for backtrace . Each line in the backtrace shows the frame number and the function name. The programcounter value is also shown―unless you use set print address off . The backtrace also shows the source file name and line nu...
Page 74 - Information about a frame
NOTE: • On the SPARC architecture, frame needs two addresses to select an arbitrary frame: a frame pointer and a stack pointer. • On the MIPS and Alpha architecture, it needs two addresses: astack pointer and a program counter. • On the 29k architecture, it needs three addresses: a register stackpoi...
Page 77 - Examining Source Files; linenum; linespecs
7 Examining Source Files GDB can print parts of the source code of your program, since the debugginginformation recorded in the program tells GDB what source files were used to buildit. When your program stops, GDB spontaneously prints the line where it stopped.Likewise, when you select a stack fram...
Page 78 - Searching source files
The following arguments can be given to the list command: list linespec Print lines centered around the line specified by linespec . list first,last Print lines from first to last . Both arguments must be linespecs. list, last Print lines ending with last . list first, Print lines starting with firs...
Page 79 - regexp; dirname
reverse-search regexp The command ' reverse-search regexp ' checks each line, starting with the one before the last linelisted and going backward, for a match for the regexp . It lists the line(s) that is found. You can abbreviate this command as rev . 7.3 Specifying source directories Executable pr...
Page 80 - Source and machine code; linespec
show directories Print the source path and display the directories itcontains. If your source path is cluttered with directories that are no longer of interest, GDB canend up detecting the wrong version of the source. To correct this situation, follow thesesteps: 1. Use directory with no arguments t...
Page 83 - Examining Data; expr
8 Examining Data The usual way to examine data in your program is with the print command (abbreviated p ), or its synonym inspect . It evaluates and prints the value of an expression of the language your program is written in (see Chapter 9 (page 101) ). The following forms of print command are supp...
Page 84 - Program variables; “Selecting a
:: ' :: ' allows you to specify a variable in terms of the file or function where it is defined. See “Program variables” (page 84) . {type} addr Refers to an object of type type stored at address addr in memory. addr may be any expression whose value is an integer or pointer (but parentheses are req...
Page 85 - ' should be the first element of the desired
This use of ' :: ' is very rarely in conflict with the very similar use of the same notation in C++. GDB also supports use of the C++ scope resolution operator in GDB expressions. WARNING! Occasionally, a local variable may appear to have the wrong value at certain points in a function just after en...
Page 86 - dtab
p *array@len The left operand of ' @ ' must reside in memory. Array values made with ' @ ' in this way behave just like other arrays in terms of subscripting, and are coerced to pointers whenused in expressions. Artificial arrays most often appear in expressions via the valuehistory (see “Value hist...
Page 89 - “Examining memory”
available for use in expressions in the convenience variable $_ . The contents of that address, as examined, are available in the convenience variable $__ . If the x command has a repeat count, the address and contents saved are from the last memory unit printed; this is not the same as the last add...
Page 91 - Show whether or not addresses are to be printed.
set print address off Do not print addresses when displaying theircontents. For example, this is the same stack framedisplayed with set print address off : ((gdb)) set print addr off((gdb)) f#0 set_quotes (lq="<<", rq=">>") at input.c:530530 if (lquote != def_lquote) You ...
Page 94 - style
} form;}; struct thing foo = {Tree, {Acorn}}; with set print union on in effect ' p foo ' would print $1 = {it = Tree, form = {tree = Acorn, bug = Cocoon}} and with set print union off in effect it would print $1 = {it = Tree, form = {...}} These settings are of interest when debugging C++ programs:...
Page 96 - num; Convenience variables
re-read or discarded (for example with the file or symbol-file commands). When the symbol table changes, the value history is discarded, since the values may containpointers back to the types defined in the symbol table. The values printed are given history numbers by which you can refer to them. Th...
Page 99 - To print both single and double-precision values:; Floating point hardware; info float
Some registers have distinct raw and virtual data formats. This means that the dataformat in which the register contents are saved by the operating system is not the sameone that your program normally sees. For example, the registers of the 68881 floatingpoint coprocessor are always saved in “extend...
Page 101 - Using GDB with Different Languages; set language; List of filename extensions and languages
9 Using GDB with Different Languages Although programming languages generally have common aspects, they are rarelyexpressed in the same manner. For instance, in ANSI C, dereferencing a pointer p is accomplished by *p , but in Modula-2, it is accomplished by p^ . Values can also be represented (and d...
Page 102 - lang; Having GDB infer the source language
' .cxx ', ' .c++ ' ' .f ', ' .F ', ' .f90 ' Fortran source file. GDB does not distinguish between Fortran 77 and Fortran90 files. ' .s ', ' .S ' Assembler source file. This actually behaves almost like C, but GDB doesnot skip over function prologues when stepping. In addition, you may set the langua...
Page 103 - language; Type and range checking
9.2 Displaying the language The following commands help you find out which language is the working language,and also what language source files were written in. show language Display the current working language. This is the language youcan use with commands such as print to build and compute expres...
Page 105 - “Supported languages”
For expressions you use in GDB commands, you can tell GDB to treat range errors inone of three ways: ignore them, always treat them as errors and abandon the expression,or issue warnings but evaluate the expression anyway. A range error can result from numerical overflow, from exceeding an array ind...
Page 115 - 0 Examining the Symbol Table
10 Examining the Symbol Table The commands described in this chapter allow you to inquire about the symbols (namesof variables, functions, and types) defined in your program. This information is inherentin the text of your program and does not change as your program executes. GDB findsit in your pro...
Page 119 - 1 Altering Execution
11 Altering Execution Once you think you have found an error in your program, you might want to find outfor certain whether correcting the apparent error would lead to correct results in therest of the run. You can find the answer by experiment, using the GDB features foraltering execution of the pr...
Page 120 - Continuing at a different address
((gdb)) p g$1 = 1((gdb)) set g=4((gdb)) p g$2 = 1((gdb)) r The program being debugged has been started already.Start it from the beginning? (y or n) yStarting program: /home/smith/cc_progs/a.out"/home/smith/cc_progs/a.out": can't open to read symbols:Invalid bfd target. ((gdb)) show gThe cur...
Page 121 - Returning from a function
or of local variables. For this reason, the jump command requests confirmation if the specified line is not in the function currentlyexecuting. However, even bizarre results are predictable if youare well acquainted with the machine-language code of yourprogram. jump *address Resume execution at the...
Page 122 - Calling program functions; Patching programs
return , return expression You can cancel execution of a function call with the return command. If you give an expression argument, its value is used as the return value from the function value. When you use return , GDB discards the selected stack frame (and all frames within it). You can think of ...
Page 123 - show write
show write Display whether executable files and core files are opened forwriting as well as reading. 11.6 Patching programs 123
Page 125 - file
12 GDB Files GDB needs to know the file name of the program to be debugged, both in order to readits symbol table and in order to start your program. To debug a core dump of a previousrun, you must also tell GDB the name of the core dump file. 12.1 Commands to specify files You can specify executabl...
Page 126 - symbol-file does not repeat if you press; set verbose
filename means to discard information on theexecutable file. symbol-file [ filename ] Read symbol table information from file filename.PATH is searched when necessary. Use the filecommand to get both symbol table and programto run from the same file. symbol-file with no argument clears out GDBinform...
Page 128 - section
To do this, use the kill command (see “Killing the child process” (page 45) ). add-symbol-file filename address , add-symbol-file The add-symbol-file command reads additionalsymbol table information from the file filename.You would use this command when filename filename address [ -readnow ] has bee...
Page 130 - Specifying shared library locations
show auto-solib-add Display the current autoloading size threshold,in megabytes. 12.2 Specifying shared library locations On HP-UX, when the shared libraries your program uses are in a different directorythan the path specified in the source or object files, specify the correct files to use withone ...
Page 133 - 3 Specifying a Debugging Target; target; Commands for managing targets
13 Specifying a Debugging Target A target is the execution environment occupied by your program. Often, GDB runs in the same host environment as your program; in that case, thedebugging target is specified as a side effect when you use the file or core commands. For HP-UX specific information, see u...
Page 134 - “Commands to specify files”
names or host names to connect with, processnumbers, and baud rates. The target command does not repeat if you press RET again after executing the command. help target Displays the names of all targets available. Todisplay targets currently selected, use either infotarget or info files (see “Command...
Page 135 - dev
target sim Builtin CPU simulator. GDB includes simulators formost architectures. In general,the following commandswork: target sim load run However, you cannot assume that a specific memorymap, device drivers, or even basic I/O is available,although some simulators do provide these. Some configurati...
Page 137 - 4 HP-UX Configuration-Specific Information
14 HP-UX Configuration-Specific Information While nearly all GDB commands are available for all native and cross versions of thedebugger, there are some exceptions. This chapter describes features, commands and,enhancements available only on HP-UX. 14.1 Summary of HP Enhancements to GDB WDB provides...
Page 140 - Dependent Standard Library Routines for Run Time Checking
• Support for evaluating macros. • Support for printing the execution path entries in the current frame, or thread. • New Command for Searching a Pattern in the Memory Address Space • New Option to Limit the Number of Frames Unwound • Updated Procedure to Process the Initialization File • Enhancemen...
Page 142 - Supported Platforms and Modes; finish
14.3 Supported Platforms and Modes • Supported Platforms HP WDB supports source-level debugging of programs written in HP C, HP aC++,and Fortran 90 on Integrity systems running on HP-UX 11i v2 or later and PA-RISC systems running HP-UX 11i v1 and later. • Support for assembly-level debugging HP WDB ...
Page 143 - Support for Alternate root; bin
NOTE: HP WDB cannot be attached to a process that is traced by tools which use ttrace, such as Caliper, adb, and tusc. The debugger displays the following error messageon attempting to attach to such a process: Attaching to process <pid> failed. Hint: Check if this process is already being tra...
Page 144 - Specifying object file directories; path
n/a /opt/langtools/ bin $WDB_ROOT/bin librtc.sl location n/a GDB_SERVER $WDB_ROOT/bin None $LIBRTC_SERVER n/a $WDB_ROOT/lib /opt/langtools/ bin NOTE: If you define WDB_ROOT or GDB_ROOT but do not create the correct directory structure below it, the debugger may fail. 14.6 Specifying object file dire...
Page 146 - edit; Fix and Continue compiler dependencies
The advantages include: • You do not have to recompile and relink the entire program. • You do not have to reload the program into the debugger. • You can resume execution of the program from the x location. • You can speed up the development cycle. NOTE: Fix and Continue is only supported with the ...
Page 148 - fix; The sum from 1 to 10 is = 0; gdb mysum; TERM=hpterm gdb mysum
NOTE: You must rebuild the program after you use the fix command because the changes you make are temporarily patched into the executable image. The changes arelost if you load a different executable and are not re ected in the original executablewhen you exit the debugger. 14.7.4 Example Fix and Co...
Page 151 - Inline Debugging in Integrity Systems; The following options available for the
3. You can use the following commands for debugging inline functions in HP 9000systems: step next list backtrace frame <n> info locals info args The following commands are not available for debugging inline functions in HP9000 systems: breakpoint info frame disassembly NOTE: Inline debugging c...
Page 153 - Viewing and Evaluating Macro Definitions; Displaying Macro Definitions
(gdb) set inline-debug inline_bp_all or$ gdb --inline = inline_bp_all • To set and modify individual breakpoints on specific instances of inlinefunctions and enable inline debugging, enter either of the following commandsbe- fore debugging the application: (gdb) set inline-debug inline_bp_individual...
Page 159 - Debugging Memory in Interactive Mode; info heap
HP WDB offers the following memory-debugging capabilities: • Reports memory leaks • Reports heap allocation profile • Stops program execution if bad writes occur with string operations such as strcpy and memcpy • Stops program execution when freeing unallocated or de-allocated blocks • Stops program...
Page 161 - address
info leaks filename Writes the complete leak report output to thespecified file. info leak leaknumber Produces detailed information on the specifiedleak including the allocation call stack. set heap-check block-size num-bytes Instructs WDB to stop the program whenever ittries to allocate a block lar...
Page 165 - Steps for Batch Mode Memory Debugging; rtcconfig
frame_count=no_frames (or) set heap-check frame-count <no_frames> Sets the number of frames to be printed for leakcontext. min_heap_size=block_size (or) set heap-check min-heap-size <block_size> Sets the minimum block size to use for heapreporting. min_leak_size=block_size (or) set heap-...
Page 167 - OR; Environment variable setting for Batch mode debugging
LD_PRELOAD=/opt/langtools/lib/librtc.sl <executable> – For 64-bit IPF applications, LD_PRELOAD=/opt/langtools/lib/pa20_64/librtc.sl <executable> If LD_PRELOAD and chatr +rtc are used to preload the librtc runtime library , the librtc runtime library is loaded from the path specified by L...
Page 173 - Configuring memory debugging settings
2. Run the program. 3. Start a debugging session as follows: gdb -leaks <executable-name> <process-id> 4. Use info heap and info leaks commands to obtain a memory analysis report of the application. NOTE: From HP WDB 5.7 onwards, the archive version of the run time check library, librtc....
Page 175 - set heap-check watch address; on
Syntax: info corruption [<file name>] The run time memory checking must be enabled before using the info corruption command to detect memory corruption. The corruption information is written to a filespecified in the .file name argument if provided. Otherwise, it is printed to the stdout . NOT...
Page 179 - info module ADDRESS
show heap-check Displays all current settings for memorychecking. 14.10.10.2 info heap arena The info heap arena command enables the user to view high level memory usage details of each arena. The info heap arena is not supported in batch mode. This command is available only for applications running...
Page 180 - 2 Commands to track the change in data segment value
4. When the program is stopped at a breakpoint, use the info heap command: (gdb) info heap Analyzing heap ...doneActual Heap Usage:Heap Start = 0x40408000Heap End = 0x4041a900Heap Size = 76288 bytesOutstanding Allocations:41558 bytes allocated in 28 blocks No. Total bytes Blocks Address Function0 34...
Page 181 - Support for Enabling and Disabling Specific Threads
set heap-check high-mem-count X_number Stops when brk() value has moved X_number of times. Limitations: • This feature assumes that an application has a deterministic memory allocationpattern from one run to another. • The high_mem feature is not supported in batch mode debugging. 14.11 Thread Debug...
Page 187 - pthread
num-waiters [num] The set thread-check num-waiters [num] command checks if the number of threads waiting on any pthread object exceeds thespecified threshold number [num] . The debugger transfers the execution control to the user andprints a warning message when this condition isdetected. 14.11.3.3 ...
Page 189 - librtc
$ chatr +dbg enable ./<executable> (This step is not required on Integrity systems.) To explicitly preload the librtc runtime library and start the target application,enter one of the following commands: — For 32 bit IPF applications, LD_PRELOAD=/opt/langtools/lib/hpux32/librtc.so <executab...
Page 190 - rtconfig; Steps to debug threads in batch mode
NOTE: Use the set frame-count setting in the rtconfig file to control the depth of the stack trace file. This command controls the depth of the call stack collected. Largervalues increase the run time. 14.11.5.1 Pre-requisites for Batch mode of Thread Debugging The various prerequisites for Batch mo...
Page 191 - The configuration file contains lines of the following form:; For more information, see
NOTE: The configuration file contains lines of the following form: set thread-check [on|off] | [option] [on|off] | [option] [num] And/Or set frame-count [num] And/Or files=<name of the executable on which the thread checking is to be done> For more information, see “Enabling and Disabling Adva...
Page 193 - Mode
If LD_PRELOAD and chatr +rtc are used to preload the librtc runtime library , the librtc runtime library is loaded from the path specified by LD_PRELOAD . If HP WDB detects any thread error condition during the application run, the errorlog is output to a file in the current working directory. The o...
Page 194 - Pthread analysis file missing!; exec; Error accessing memory address; Debugging MPI Programs
Behavior of the +check=thread option can be changed by users by providing their own rtcconfig file. The user specified rtcconfig file can be in the current directory or in a directory specified by the GDBRTC_CONFIG environment variable. If any thread error condition is detected during the applicatio...
Page 195 - fork; maint info unwind exp; exp
14.13 Debugging multiple processes ( programs with fork and vfork calls) 14.13.1 Ask mode for set follow-fork-mode The ask command prompts the user to select between parent and child as the debuggerresponse to a program call of fork/vfork . Based on the user selection, the parent or the child proces...
Page 196 - Command to Search for a Pattern in the Memory Address Space; find
0x40172b27: (b2) P3lc_gr gr=400x40172b29: (61) R3body rlen=330x40172b2b: (81) B1label_state label=10x40172b2c: (c0) B2epilogue t=440x40172b2e: (00) R1prologue rlen=00x40172b2f: (00) R1prologue rlen=0 14.13.4 Printing CFM and PFS registers On Integrity systems, HP WDB prints Current Frame Marker (CFM...
Page 201 - info target; The
the core file to be used if the packcore directory does not contain a core file. If used,this second argument causes a symbolic link to be created in the packcore directory inplace of the missing core file. The getcore command can be used to examine a packcore directory which was previously created ...
Page 202 - command
NOTE: Limitations for the enhanced info target command on corefile are as follows:• The enhanced info target command is not supported when the expanded_node_host_names kernel parameter is set. It is supported only for thedefault utsname . • The heap segment listed in the memory segment does not cont...
Page 203 - Support for display of run time type information; info rtti address
To analyze this core file with HP WDB on HP-UX 11i version 2, you must do thefollowing: • When starting from HP WDB command line: (gdb) core-file [core.pid | core-filename] • When starting from shell prompt: $ gdb -core a.out [core.pid | core-filename] 14.15.4 Support for display of run time type in...
Page 204 - info exec-path summary
For example, (gdb) i ep 4 10 • info exec-path summary Prints the summary information about all the local execution path entries in thecurrent frame. This command displays the total number of branches for the frame,the number of branches executed in this frame in the last iteration, and the lastexecu...
Page 205 - For more information on this feature, see the following example.; Example Illustrating Execution Path Recovery; Sample Debugging Session:
For more information on this feature, see the following example. 14.16.2 Example Illustrating Execution Path Recovery The following example illustrates the use of the execution path recovery feature in HPWDB: Sample Program: $cat execpath.c#include <stdio.h>#include <string.h>#include &l...
Page 207 - This; Aborting a Command Line Call; abort
14.18 Invoking GDB Before a Program Aborts This -crashdebug option enables GDB to monitor the execution of a process or a program. It invokes GDB when the program execution is about to abort. Once thedebugger is invoked, you can debug the application using the normal debuggercommands. This option en...
Page 208 - Instruction Level Stepping; continue; Enhanced support for watchpoints and breakpoints; HP WDB provides support for hardware watchpoints on HP-UX 11.x.
Abort gdb command line call? (y or n) y#0 main () at ./address_error.c:4141 fun (count, count*1.1);(gdb) bt#0 main () at ./address_error.c:41(gdb) quitThe program is running. Exit anyway? (y or n) y 14.20 Instruction Level Stepping During instruction level stepping with nexti and stepi, WDB prints t...
Page 209 - Support for procedural breakpoints; The breakpoint commands are
14.21.3.1 Setting breakpoints in unstripped shared library GDB will not be able to put breakpoints using symbolic names(of the symbols not inexport list) or line numbers in the stripped modules. GDB will be able to place breakpoints using symbol names in the unstripped sharedlibraries loaded into th...
Page 210 - Debugging support for shared libraries; deferred breakpoints; Using shared library as main program; is
Setting a breakpoint on a template method with multiple instantiations displays a menushowing all instantiations and the user can choose to set breakpoints on all or any oneor none. For example, (gdb) file testReading symbols from test...done.(gdb) b MyClass::MyMember[0] cancel[1] all[2] MyClass::My...
Page 211 - Setting Deferred Breakpoints in Shared Library; the debugger does not know whether; Privately mapping shared libraries
14.22.2 Setting Deferred Breakpoints in Shared Library On HP-UX, GDB automatically loads symbol definitions from shared libraries whenyou use the run command, or when you examine a core file. (Before you issue the runcommand, GDB does not understand references to a function in a shared library| unle...
Page 212 - Selectively Mapping Shared Libraries As Private; chatr
To set the breakpoint you must kill the program and then rerun it so that the dynamiclinker maps a copy of the shared library privately. There are two ways to run theprogram: • Rerun the program under GDB to have the debugger cause dld to map all sharedlibraries as private, enabling breakpoint debug...
Page 213 - info shared; Printing Decimal Floating point data types
The -mapshared option is implemented on both PA-RISC and Itanium platforms in HP WDB 5.2. This option is provided in the WDB GUI and HP WDB. The defaultbehavior does not change if the -mapshared option for all shared libraries in processes started under the debugger, or dynamically loaded after an a...
Page 214 - Handling Decimal Floating Point Data types
14.23.1.1 Printing Decimal floating point constant (gdb) print <num><df/dd/dl/DF/DD/DL>df, DF - _Decimal32dd, DD - _Decimal64dl, DL - _Decimal128 This prints the decimal floating point constant based on the data type. 14.23.1.2 Printing Decimal floating point variable (gdb) print/<fmt...
Page 216 - Additional Support for binary floating point data type
Conversion of types: GDB handles conversion of data types during assignment, printing, and arithmeticand comparison operation. (gdb) p 1.2df +1.2dd This converts double data type (1.2) to _Decimal64 data type and performs addition operation with _Decimal64 data type (1.2dd) and prints value in _Deci...
Page 218 - Commands for Examining Java Virtual Machine(JVM) internals; help java
Additional stack unwind features are available starting with SDK 1.4.2. These featuresfall into three categories: Java stack unwind enhancements, Java heap support, andJava threads support. These additional features are available as part of the Java stack unwind enhancements: • View Java compiled fr...
Page 219 - methodOop
Java VM Debugging Commands The following commands have been added to enhance Java debugging support: brbacktrace Prints backtrace of mixed Java and native frames. Standardbacktrace command of GDB has been enhanced to work with mixedJava and native stack frames. info frame Prints Java frame specific ...
Page 220 - GDB JAVA UNWINDLIB
14.25.1.3 Java corefile debugging support HP WDB shows stack traces of mixed Java, C, and C++ programs for java corefile. GDB_JAVA_UNWINDLIB environment variable must be set to the path name of the Java unwind library as explained above. Following are examples that illustrate the gdb command-line op...
Page 221 - ptype
2. Attach gdb to the running process: $ gdb -p 23989 HP gdb 5.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.Copyright 1986 - 2001 Free Software Foundation, Inc.Hewlett-Packard Wildebeest 5.0 (based on GDB) is covered by theGNU General Public License.Type "show copying" to see the co...
Page 222 - data type on IPF
/* off 453 bits, len 27 bits */float f;/* off 480 bits, len 32 bits */ 14.25.3 Support for _ _fpreg data type on IPF WDB internally converts __fpreg data type to long double data type to evaluate an expression or to print the value of the expression. Since long double data type has only15 bit expone...
Page 223 - Command for evaluating the address of an expression
You do not need to use fully qualified names to access symbols within a namespace.The debugger can compile a list of namespaces active in the scope that you are in and,when possible, choose an appropriate symbol. The debugger recognizes using declarations, using directives, namespace aliases, nested...
Page 224 - Support for output logging; Support for dumping array in an ASCII file
14.27 Support for output logging The Visual Interface for HP WDB terminal user interface (TUI) mode supports thecommand, log logfile_name , that saves the content of a session to the specified log file. When you use the log command, the debugger saves a snapshot of the current session, from the star...
Page 226 - Getting information from a non-debug executable
"Steplast is not meaningful for the current line." For example, (gdb) 4 int k = 10; (gdb) sl ---> alias to "steplast" command error: Steplastis not meaningful for the current line To execute the steplast command in C++ compiled applications, you must compile the application using ...
Page 229 - Debugging Optimized Code at Various Optimization Levels
14.29.1 Debugging Optimized Code at Various Optimization Levels The following sections describe debugging optimized code support at each optimizationlevel. 14.29.1.1 +O0 and +O1 At +O1 level, optimizations that affect the user visible state of a program are avoided. Line numbers are accurately assoc...
Page 231 - Debugging the application using GDB under ARIES
execution pattern and translates only the frequently executed code into native Itanium(R)code at runtime. 14.30.1 Debugging the application using GDB under ARIES ARIES supports debugging of HP 9000 HP-UX applications on HP-UX 11i Integrityservers using the HP 9000 HP-UX GDB. • Both the GDB and the a...
Page 232 - Attaching GDB to an already running emulated process; Invoke GDB as follows:; Detecting memory leaks using GDB under ARIES
identically. The exact behavior shown by HP 9000 GDB under ARIES may differfrom that on a HP 9000 HP-UX server. • If the debugged process is blocking in a system call, any attempt to get to the GDBcommand prompt by pressing ctrl-C does not work. The process needs to be killedfrom a different shell. ...
Page 233 - tty; Starting and stopping Visual Interface for WDB; quit
14.31 Visual Interface for WDB WDB includes an HP-supported Visual Interface for WDB with both graphical andterminal modes. The interface is based on Vim 5.7 and WDB. This interface replacesthe -tui mode on Itanium-based systems. When you use the interface you are actually using vim, which is a vi-c...
Page 234 - Navigating the Visual Interface for WDB display; The Visual Interface for WDB window consists of two areas:
(wdb) quit 14.31.2 Navigating the Visual Interface for WDB display The Visual Interface for WDB window consists of two areas: • Source pane at the top • Debugger pane at the bottom You can use the arrow and pagination keys on the keyboard to move the cursor: • Pagination keys move the cursor in the ...
Page 235 - Specifying foreground and background colors; hpterm
Run Resume Stop Up Visual Finish Print Type List Interface for WDB Faq Stop Next Down Prompt Print* Edit Credits You can click the softkey or press a function key on the keyboard to invoke thecommand. The function keys F1 through F8 correspond to the bottom row of softkeys. The functionkeys F9 and u...
Page 236 - Changing the size of the source or debugger pane
14.31.5 Using the TUI mode To start Visual Interface for WDB in terminal user interface (TUI) mode, run VisualInterface for WDB with the command: /opt/langtools/bin/vdb -tui This mode works well with hpterm and xterm and fairly well with dtterm and VT100 (telnet) terminals. NOTE: A defect in dtterm ...
Page 237 - Using commands to browse through source files; vim; Prompt; 1 Saving the contents of a debugging session to a file
14.31.7 Using commands to browse through source files browse. For example, CTRL-B , CTRL-F , CTRL-D , CTRL-U are useful for browsing the debugger window. These commands work whether or not you escape to ` vi ' mode. These ` vim ' commands require you to escape to ` vi ' mode. For example: `/' Search...
Page 238 - commands; GNU GDB Logging Commands
To save a session to a file: 1. Right-click an empty region of the source or debugger pane. 2. Choose "Save Session to vdb.pid" from the pop-up menu. The debugger writes the input and output to a file whose name ends in the pid of thedebugger. If you save the session more than once, the new ...
Page 240 - Support for debugging stripped binaries; Printing of locals and globals in a stripped module
14.35.2.2 For 64-bit applications To perform command line calls in a stripped executable, linked with end.o , you need to do the following: • In the +std link mode, GDB supports this feature without any changes. You must export the __wdb_call_dummy symbol as shown in the next line. • In the +compat ...
Page 241 - which
14.36 Displaying the current block scope information The which command takes a symbol as an argument and prints the information on a given symbol. It prints the following information: • current block scope addresses • line information of the definition of the symbol • filename in which the definitio...
Page 243 - 5 The HP-UX Terminal User Interface; Use the; Invoke the debugger using a command like the following:
15 The HP-UX Terminal User Interface By default, GDB runs in line mode. For users who prefer an interface similar (thoughnot identical) to that of the XDB debugger, HP provides a terminal user interface (TUI),which appears when you invoke the gdb command with the -tui option. Use the -xdb option to ...
Page 244 - Automatically running a program at startup; WDB does not start running the target executable at startup as do `
When you execute the program up to the first breakpoint by issuing the command run a right angle bracket (>) points to the current location. So after you issue thosecommands, the window looks something like this: |----------------------------------------------------------------------| |27 } | |28...
Page 245 - la src
The Command pane is always present. The possible configurations of the other panesare: • Source • Disassembly • Source/Disassembly • Disassembly/Register • Source/Register The layout command (abbreviated la ) enables you to change from one window configuration to another. NOTE: You can abbreviate an...
Page 246 - The Source/Disassembly pane appears when you issue the command:; la split; la regs; The window looks like this:
15.3.3 Source/Disassembly pane The Source/Disassembly pane appears when you issue the command: la split You can also reach this pane from the Source pane with the XDB command: td The window looks like this: :......................................................................:*>:32 print_averag...
Page 247 - The Source/Register pane appears when you issue the command:; when the current pane is the Source pane.
|;;; print_average (my_list, first, last); |*> |0x3524 <main+8> addil L'-0x800,%dp,%r1 | |0x3528 <main+12> ldo 0x730(%r1),%r26 | |0x352c <main+16> ldi 9,%r24 | |0x3530 <main+20> ldi 0,%r25 | |0x3534 <main+24> ldil L'0x3000,%r31 | |------------------------------------...
Page 248 - Cycling through the panes; la next; Changing pane focus; Page Up
15.4 Cycling through the panes Use the commands la next and la prev to move from one pane to another without specifying a window name. If you specify la next repeatedly, the order the debugger uses is: • Source ( src ) • Disassembly ( asm ) • Source/Disassembly ( split ) • Source/Register • Disassem...
Page 249 - fs regs; foc next; If you then use the; Page Down; key to scroll in the Register pane, the window looks
:.........................................................................::flags 29000041 r1 51a800 rp 7f6ce597 ::r3 7f7f0000 r4 1 r5 7f7f06f4 ::r6 7f7f06fc r7 7f7f0800 r8 7f7f0800 ::r9 40006b10 r10 0 r11 40004b78 ::r12 1 r13 0 r14 0 ::r15 0 r16 40003fb8 r17 4 ::.......................................
Page 250 - Changing the register display
(gdb) la split(gdb) la regs(gdb) la src(gdb) la regs(gdb) foc nextFocus set to REGS window.(gdb) 15.6 Scrolling panes To scroll within a pane, you can use the arrow keys or the Page Up and Page Down keys (on some keyboards these are Prev and Next ). You can also use the following commands: {+ | -} [...
Page 251 - winheight
*>:32 print_average (my_list, first, last); : :33 print_average (my_list, first, last - 3); : :34 } : :35 : :......................................................................:File: average.c Procedure: main Line: 32 pc: 0x3524(gdb) la regs(gdb) la src(gdb) la regs(gdb) foc nextFocus set to R...
Page 252 - For example, the command; Refreshing and updating the window; If the screen display is disrupted for some reason, use the; ref; If you use stack-navigation commands such as; upd
winheight [win_name] [+ | -] num_lines If you omit win_name, the pane with logical focus is resized. When you increase theheight of a pane, the height of the Command pane is decreased by the same amount,and vice versa. The height of any other panes remains unchanged. For example, the command wh src ...
Page 253 - 6 XDB to WDB Transition Guide
16 XDB to WDB Transition Guide This transition aid is designed for XDB users who are learning WDB, an HP-supportedversion of the industry-standard GDB debugger. Select one of these lists for a table thatshows WDB equivalents for many common XDB commands and other features. Invoke WDB with the comman...
Page 255 - Table 16-2 Window mode commands; Table 16-3 File viewing commands
Table 16-2 Window mode commands (continued) Meaning WDB Equivalent XDB Command Display general registers gr (with -xdb -tui),display $regs (with -tui) gr Display special registers sr (with -xdb -tui),display $sregs (with-tui) sr Toggle disassembly mode td (with -xdb -tui) td Toggle float register di...
Page 256 - apm; Data Viewing and modification commands
Table 16-3 File viewing commands (continued) Meaning WDB Equivalent XDB Command List source directory search path(list all directories) ld (with -xdb), showdirectories ld List all source files lf (with -xdb), infosources lf List matching files No equivalent lf [string] Repeat previous search fo or r...
Page 257 - Table 16-4 Data viewing and modification commands
Table 16-4 Data viewing and modification commands Meaning WDB Equivalent XDB Command Move view location forward orbackward in source file numberlines l (with -xdb) , info args followed by info locals l Search source forward for [last]string lc [string] (with -xdb) , info common string lc [string] Se...
Page 260 - Table 16-7 Job control commands; Overall breakpoint commands; Table 16-8 Overall breakpoint commands
Table 16-7 Job control commands (continued) Meaning WDB Equivalent XDB Command Go forward or back given # lines g {+ | -}lines (with-xdb) , go {+ | -}lines , tb {+ | -}lines followed by jump {+ | -}lines g {+ | -}lines Go forward or back 1 line g {+ | -} (with -xdb) , go {+ | -}1, tb {+ | -}1 follow...
Page 261 - Table 16-9 Auxillary breakpoint commands; The GDB equivalent of the
Table 16-9 Auxillary breakpoint commands Meaning WDB Equivalent XDB Command Print any string p "any string" any_string Conditionally execute cmds if expr cmds [else cmds]end if expr {cmds} [{cmds}] Quiet breakpoints Q (with -xdb) , silent (must be first command in a commandslist) Q 16.2.2 Br...
Page 265 - Table 16-15 Miscellaneous commands
Table 16-13 Macro facility commands Meaning WDB Equivalent XDB Command Define a user-defined command def name [GDB prompts for commands] def name replacement-text Toggle the macro substitutionmechanism No equivalent tm Remove the macro definition forname def name [follow with empty command list] und...
Page 266 - XDB data formats and HP WDB equivalents; The format of the
Table 16-15 Miscellaneous commands (continued) Meaning WDB Equivalent XDB Command Invoke a shell ! cmd line (with -xdb), she cmd line ! cmd line Execute command list (groupcommands) commands [number] ... end {cmd list} Interrupt the program Control-C Control-C A comment # [text] # [text] Activate mo...
Page 267 - Table 16-16 Data format commands
Table 16-16 Data format commands (continued) Meaning WDB Equivalent XDB Command Decimal integer d d Long decimal integer d D (1) e Floating-point notation as float No equivalent e e Foating-point notation as double No equivalent E (1) f floating-point notation as float No equivalent f f floating-poi...
Page 268 - XDB location syntax and HP WDB equivalents; Table 16-17 Macro facility commands; XDB special language operators and HP WDB equivalents
Table 16-16 Data format commands (continued) Meaning WDB Equivalent XDB Command Print in binary t z Print in long binary t Z (1) (1) HP WDB will display data in the size appropriate for the data. It will not extendthe length displayed in response to one of the uppercase formchars (for example, O,D, ...
Page 269 - Table 16-18 Special language operators; XDB special variables and HP WDB equivalents; Table 16-19 Special variables
Table 16-18 Special language operators Meaning WDB Equivalent XDB Language Operator Unary operator, address of object Depends on language $addr Unary Boolean operator, executionin procedure No equivalent $in Unary operator, size of object sizeof $sizeof 16.6 XDB special variables and HP WDB equivale...
Page 270 - XDB variable identifiers and HP WDB equivalents; Table 16-20 Variable Identifiers; Alphabetical lists of XDB commands and HP WDB equivalents
16.7 XDB variable identifiers and HP WDB equivalents Table 16-20 Variable Identifiers Meaning WDB Equivalent XDB Variable Identifier Search for var var var Search class for var (bug: not yet) class:: class:: Search proc for var (static variables only) proc:: var [[class]::]proc:[class::]var Search p...
Page 281 - 7 Controlling GDB; newprompt; Setting Command Editing Options in GDB
17 Controlling GDB You can alter the way GDB interacts with you by using the set command. For commandscontrolling how GDB displays data, see “Print settings” (page 90) . Other settings are described here. 17.1 Setting the GDB Prompt GDB indicates its readiness to read a command by printing a string ...
Page 283 - Supported Number Formats
show commands Display the last ten commands in the commandhistory. show commands n Print ten commands centered on commandnumber n . show commands + Print ten commands just after the commands lastprinted. 17.4 Setting the GDB Screen Size Certain commands to GDB may produce large amounts of informatio...
Page 284 - set; Optional warnings and messages
set radix 0xa sets the base to decimal. On the other hand, set radix 10 leaves the radix unchanged no matter what it was. set output-radix base Set the default base for numeric display. Supportedchoices for base are decimal 8, 10, or 16. base must itself be specified either unambiguously or using th...
Page 285 - gdbarch
set confirm on Enables confirmation requests (the default). show confirm Displays state of confirmation requests. 17.7 Optional messages about internal happenings set debug arch Turns on or off display of gdbarch debugging info. The default is off show debug arch Displays the current state of displa...
Page 286 - show debug varobj
show debug varobj Displays the current state of displaying GDB variableobject debugging info. 286 Controlling GDB
Page 287 - 8 Canned Sequences of Commands; define
18 Canned Sequences of Commands In addition to breakpoint commands (see “Breakpoint command lists” (page 61) ), GDB provides the following two ways to store sequence of commands for execution as aunit: • user-defined commands • command files 18.1 User-defined commands A user-defined command is a seq...
Page 289 - break fatal
enddefine hook-continuehandle SIGLARM passend You can define a hook for any single-word command in GDB, and not for commandaliases; Also you should define a hook for the basic command name, for example, backtrace rather than bt . If an error occurs during the execution of your hook, execution of GDB...
Page 290 - Commands for controlled output; text
• VxWorks (Wind River Systems real-time OS): .vxgdbinit • OS68K (Enea Data Systems real-time OS): .os68gdbinit • ES-1800 (Ericsson Telecom AB M68000 emulator): .esgdbinit You can also request the execution of a command file with the source command: source filename Execute the command file filename ....
Page 291 - fmt
not entered in the value history either. See “Expressions” (page 83) . output/fmt expression Print the value of expression in format fmt . You can use the same formats as for print. See “Output formats” (page 86) . printf string , expressions ... Print the values of the expressions under the control...
Page 293 - 9 Using GDB under gnu Emacs; All
19 Using GDB under gnu Emacs A special interface allows you to use gnu Emacs to view (and edit) the source files forthe program you are debugging with GDB. To use this interface, use the command M-x gdb in Emacs. Give the executable file youwant to debug as an argument. This command starts GDB as a ...
Page 297 - 0 GDB Annotations; The server prefix; server
20 GDB Annotations This chapter describes annotations in GDB. Annotations are designed to interface GDBto graphical user interfaces or other similar programs which want to interact with GDBat a relatively high level. 20.1 What is an annotation? To produce annotations, start GDB with the --annotate=2...
Page 298 - output
command history, nor will it affect GDB's notion of which command to repeat if RET is pressed on a line by itself. The server prefix does not affect the recording of values into the value history; to printa value without recording it into the value history, use the output command instead of the prin...
Page 301 - display; Annotation for GDB input
where source-intro-string separates for the user's benefit the reference from the text which precedes it, filename is the name of the source file, and line-number is the line number within that file (the first line is line 1). If GDB prints some information about where the frame is from (which libra...
Page 302 - Information on breakpoints
^Z^Zpre-prompt^Z^Zprompt^Z^Zpost-prompt The input types are:prompt When GDB is prompting for a command (the main GDBprompt). commands When GDB prompts for a set of commands, like in thecommands command . The annotations are repeated for each command which is input. overload-choice When GDB wants the...
Page 307 - Function and purpose; Command Syntax; Input syntax
21 The GDB/MI Interface Function and purpose GDB/MI is a line based machine oriented text interface to GDB. It is specifically intended to support the development of systems which use the debugger as just one smallcomponent of a larger system. This chapter is a specification of the GDB/MI interface....
Page 308 - Output syntax
Notes: • The CLI commands are still handled by the MI interpreter; their output is described below. • The token , when present, is passed back when the command finishes. • Some MI commands accept optional arguments as part of the parameter list. Each option is identified by a leading `-' (dash) and ...
Page 310 - interaction; Evaluate expression; compatibility with CLI
21.1.3 Simple examples of GDB/MI interaction This subsection presents several simple examples of interaction using the GDB/MI interface. In these examples, ' -> ' means that the following line is passed to GDB/MI as input, while ' <- ' means the output received from GDB/MI . Evaluate expressio...
Page 311 - output records; result records; results; stream records; Out-of-band records are used to notify the; command description format
21.3 GDB/MI output records 21.3.1 GDB/MI result records In addition to a number of out-of-band notifications, the response to a GDB/MI command includes one of the following result indications: "^done" [ "," results ] The synchronous operation was successful, results are the return va...
Page 312 - breakpoint table commands
Note the line breaks shown in the examples are here only for readability. They do notappear in the real output. Also note that the commands with a non-available example(N.A.) are not yet implemented. Motivation The motivation for this collection of commands. Introduction A brief introduction to this...
Page 318 - Here is an example of the result when there are no breakpoints:; ' option it will create an access watchpoint, that is a; GDB command; The corresponding GDB commands are '; Example; Setting a watchpoint on a variable in the
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignme...
Page 320 - Data manipulation
^done,BreakpointTable=nr_rows="1",nr_cols="6",hdr=[width="3",alignment="-1",col_name="number",colhdr="Num",width="14",alignment="-1",col_name="type",colhdr="Type",width="4",alignment="-1",col_name="di...
Page 322 - Evaluate; returns the
^done,asm_insns=[src_and_asm_line={line="31",file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \testsuite/gdb.mi/basics.c",line_asm_insn=[{address="0x000107bc",func-name="main",offset="0",inst="save %sp, -112, %sp"}]},src_and_asm_line={line="3...
Page 324 - info reg
(gdb)-data-list-register-names^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r...
Page 326 - gdbtk; bytes
' word-format ' The format to be used to print the memory words. The notationis the same as for GDB print command (see “Output formats” (page 86) ). ' word-size ' The size of each memory word in bytes. ' nr-rows ' The number of rows in the output table. ' nr-cols ' The number of columns in the outpu...
Page 330 - Show the current working directory.; The corresponding GDB command is '; program control; Program termination
The -environment-pwd command Synopsis -environment-pwd Show the current working directory. GDB command The corresponding GDB command is ' pwd '. Example (gdb)-environment-pwd~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.^done(gdb) 21.7 GDB/MI program control Program termination ...
Page 341 - show version; Stack Manipulation Commands; info frame
Show version information for GDB. Used mostly in testing. GDB command The corresponding GDB command is ' show version '. Example (gdb)-gdb-version~GNU gdb 5.2.1~Copyright 2000 Free Software Foundation, Inc.~GDB is free software, covered by the GNU General Public License, and~you are welcome to chang...
Page 343 - level
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"},frame={level="4 ",addr="0x000107e0",func="main",file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"}](gdb)-stack-list-arguments 0^done,stack-args=[frame={level="0",a...
Page 344 - Full stack backtrace:
arguments (inclusive). If the two arguments are equal, it shows the single frame at thecorresponding level. GDB command The corresponding GDB commands are ' backtrace ' and ' where '. Example Full stack backtrace: (gdb)-stack-list-frames^done,stack=[frame={level="0 ",addr="0x0001076c"...
Page 346 - Symbol query commands; Describe where
21.10 GDB/MI Symbol query commands The -symbol-info-address command Synopsis -symbol-info-address symbol Describe where symbol is stored. GDB command The corresponding GDB command is ' info address '. Example N.A. The -symbol-info-file command Synopsis -symbol-info-file Show the file for the symbol....
Page 349 - Target Manipulation Commands; pid
Example N.A. 21.11 GDB/MI Target Manipulation Commands The -target-attach command Synopsis -target-attach pid | file Attach to a process pid or a file file outside of GDB. GDB command The corresponding GDB command is ' attach '. Example N.A. The -target-compare-sections command Synopsis -target-comp...
Page 351 - There is no equivalent GDB command.
+download,{section=".text",section-sent="1536",section-size="6668",total-sent="1536",total-size="9880"}+download,{section=".text",section-sent="2048",section-size="6668",total-sent="2048",total-size="9880"}+download,{sec...
Page 353 - thread commands
The -target-select command Synopsis -target-select type parameters ... Connect GDB to the remote target. This command takes two args: ' type ' The type of target, for instance ' async ', ' remote ', and so on. ' parameters ' Device names, host names and the like. See “Commands for managing targets” ...
Page 355 - Motivation for variable objects in
^running(gdb)~"0x7f7f0aec"*stopped,reason="end-stepping-range",thread-id="2",frame=addr="0x00002ca4",func="printme",args=[name="ip"],file="multithread.c",line="9"(gdb)-thread-list-ids^done,thread-ids=thread-id="2",thread-id="...
Page 361 - Your bug reports play an essential role in making GDB reliable.; How to report bugs
22 Reporting Bugs in GDB Your bug reports play an essential role in making GDB reliable. Reporting a bug may help you by bringing a solution to your problem, or it may not.But in any case the principal function of a bug report is to help the entire communityby making the next version of GDB work bet...
Page 365 - A Installing GDB; tar
A Installing GDB If you obtain GDB (WDB) as part of the HP ANSI C, HP ANSI C++ Developer's Kit forHP-UX Release 11.x, or HP Fortran, you do not have to take any special action to buildor install GDB.If you obtain GDB (WDB) from an HP web site, you may download either an swinstallpackage or a source ...
Page 366 - host; sh configure host; A.1 Compiling GDB in another directory
gdb-gdb-199991101/mmalloc source for the gnu memory-mapped mallocpackage The simplest way to configure and build GDB is to run configure from the gdb-version-number source directory, which in this example is the gdb-gdb-199991101 directory. First switch to the gdb-version-number source directory if ...