Print Settings Debugging with GDB — Volkswagen Pointer I

6 Июн 2015 | Author: | Комментарии к записи Print Settings Debugging with GDB — Volkswagen Pointer I отключены
Volkswagen Pointer I

10.8 Print Settings

gdb the following ways to control how structures, and symbols are printed.

settings are useful for debugging in any language: set print address set address on gdb prints memory showing the location of stack structure values, pointer breakpoints, and so forth, even it also displays the contents of addresses. The default is on. For example, is what a stack frame looks like with set address on.

set print address off Do not addresses when displaying contents. For example, this is the stack frame displayed set print address off :

You can use ‘ set address off ’ to eliminate all dependent displays from the gdb For example, with print off. you should get the same for backtraces on all machines whether or not involve pointer arguments.

print address Show or not addresses are to be printed.

When gdb a symbolic address, it normally the closest earlier symbol an offset. If that symbol not uniquely identify the address example, it is a name whose is a single source file), you may to clarify. One way to do this is with line. for example ‘ line *0x4537 ’. you can set gdb to print the source file and number when it prints a address: set print symbol-filename on gdb to print the source file and line number of a symbol in the form of an address.

set print off Do not print source file and line number of a symbol. is the default.

show print Show whether or not gdb will the source file name and number of a symbol in the symbolic of an address.

Another situation it is helpful to show symbol and line numbers is when code; gdb shows you the line and source file that to each instruction.

Also, you may to see the symbolic form only if the being printed is reasonably to the closest earlier symbol: set max-symbolic-offset max-offset set print unlimited Tell gdb to only the symbolic form of an address if the between the closest earlier and the address is less than The default is unlimited. which gdb to always print the symbolic of an address if any symbol precedes it. is equivalent to unlimited.

show print max-symbolic-offset Ask how the maximum offset is that gdb in a symbolic address.

If you have a and you are not sure where it points, try set print symbol-filename on ’. you can determine the name and source location of the variable where it using ‘ p/a pointer This interprets the address in form. For example, here gdb that a variable ptt points at variable t. defined in hi2.c. For pointers that point to a variable, ‘ p/a ’ not show the symbol name and of the referent, even with the set print options turned on.

You can enable ‘ /a ’-like all the time using ‘ set symbol on ’: set print on Tell gdb to print the symbol to an address, if one exists.

set print off Tell gdb not to print the symbol to an address. In this mode, gdb still print the symbol to pointers to functions. This is the

show print symbol whether gdb will display the corresponding to an address.

Other control how different kinds of are printed: set print array set array on Pretty print This format is more to read, but uses more The default is off.

set print off Return to compressed format for

show print array whether compressed or pretty is selected for displaying arrays.

set array-indexes set print array-indexes on the index of each element displaying arrays. May be more to locate a given element in the or quickly find the index of a element in that printed The default is off.

set print off Stop printing element when displaying arrays.

show print array-indexes whether the index of each is printed when displaying

set print elements number-of-elements set elements unlimited Set a limit on how elements of an array gdb will If gdb is printing a large array, it printing after it has printed the of elements set by the set print elements This limit also to the display of strings. When gdb this limit is set to 200. number-of-elements to unlimited or zero that the number of elements to is unlimited.

show print Display the number of elements of a array that gdb will If the number is 0, then the printing is

set print frame-arguments value command allows to control how the of arguments are printed when the prints a frame (see ). The possible values are: all The of all arguments are printed.

scalars the value of an argument only if it is a The value of more complex such as arrays, structures, etc, is replaced by. This is the Here is an example where scalar arguments are shown:

None of the argument values are Instead, the value of each is replaced by. In this case, the above now becomes:

By default, scalar arguments are printed. command can be used to configure the to print the value of all arguments, of their type. However, it is advantageous to not print the value of complex parameters. For instance, it the amount of information printed in frame, making the backtrace readable. Also, it improves when displaying Ada frames, the computation of large arguments can be CPU-intensive, especially in large Setting print frame-arguments to (the default) or none this computation, thus up the display of each Ada frame.

print frame-arguments Show how the of arguments should be displayed printing a frame.

set print raw on Print frame arguments in non pretty-printed, form.

set print raw frame-arguments off Print arguments in pretty-printed form, if is a pretty-printer for the value (see Printing ), otherwise print the in raw form. This is the default.

print raw frame-arguments Show to print frame arguments in raw

set print entry-values value Set of frame argument values at entry. In some cases gdb can the value of function argument was passed by the function caller, if the value was modified inside the function and therefore is different. optimized code, the current could be unavailable, but the entry may still be known.

The default is default (see below for its Older gdb behaved as with the no. Compilers not supporting this will behave in the default the same way as with the no setting.

functionality is currently supported by DWARF 2 debugging format and the has to produce ‘ DW_TAG_GNU_call_site tags. With gcc. you to specify -O -g during compilation, to get information.

The value parameter can be one of the no Print only actual values, never print from function entry

only Print only values from function point. The actual parameter are never printed.

preferred only parameter values function entry point. If from function entry is not known while the actual is known, print the actual for such parameter.

if-needed actual parameter values. If parameter value is not known value from function point is known, print the point value for such

both Always print the actual parameter value and its from function entry even if values of one or both are not due to compiler optimizations.

compact the actual parameter value if it is and also its value from entry point if it is known. If is known, print for the actual . If not in MI mode (see GDB/MI ) and if values are known and identical, the shortened param=param@entry=VALUE notation.

default Always print the parameter value. Print its value from function point, but only if it is known. If not in MI (see GDB/MI ) and if both are known and identical, print the param=param@entry=VALUE notation.

For analysis on possible failures of frame values at function entry see set debug entry-values.

show entry-values Show the method used for printing of frame values at function entry.

set repeats number-of-repeats set print unlimited Set the threshold for suppressing of repeated array elements. the number of consecutive identical of an array exceeds the threshold, gdb the string . where n is the number of repetitions, instead of displaying the elements themselves. Setting the to unlimited or zero will all elements to be individually printed. The threshold is 10.

show print Display the current threshold for repeated identical elements.

set null-stop Cause gdb to stop the characters of an array when the null is encountered. This is when large arrays contain only short The default is off.

show null-stop Show whether gdb printing an array on the first character.

set print pretty on gdb to print structures in an indented with one member per line, this:

set print pretty off gdb to print structures in a compact like this:

This is the format.

show print Show which format gdb is to print structures.

set print on Print using only characters; if this option is gdb displays any eight-bit characters (in or character values) using the nnn. This setting is if you are working in English ( ascii ) and you use the bit of characters as a marker or “meta”

set print sevenbit-strings off Print eight-bit characters. This the use of more international character and is the default.

show print Show whether or not gdb is printing seven-bit characters.

Volkswagen Pointer I

set print union on Tell gdb to unions which are contained in and other unions. This is the setting.

set print union off gdb not to print unions which are in structures and other unions. gdb print instead.

show union Ask gdb whether or not it will unions which are contained in and other unions.

For example, the declarations

with set print on in effect ‘ p foo ’ print

and with set print off in effect it would print

set union affects programs in C-like languages and in Pascal.

settings are of interest when C ++ programs: set print demangle set demangle on Print C ++ names in source form rather in the encoded (“mangled”) form to the assembler and linker for type-safe The default is on.

show print Show whether C ++ names are in mangled or demangled form.

set asm-demangle set print asm-demangle on C ++ names in their source rather than their form, even in assembler printouts such as instruction The default is off.

show asm-demangle Show whether C ++ in assembly listings are printed in or demangled form.

set demangle-style Choose among several schemes used by different to represent C ++ names. The choices for are currently: auto Allow gdb to a decoding style by inspecting program. This is the default.

gnu based on the gnu C ++ compiler ( g++ ) encoding

hp Decode based on the HP ANSI C ++ ( aCC ) algorithm.

lucid Decode on the Lucid C ++ compiler ( lcc ) encoding

arm Decode using the algorithm in the C ++ Reference Manual. Warning: setting alone is not sufficient to debugging cfront -generated gdb would require further to permit that. If you omit you will see a list of possible

show demangle-style Display the style currently in use for decoding C ++

set print object set print on When displaying a pointer to an identify the actual (derived) of the object rather than the type, using the virtual table. Note that the function table is required feature can only work for that have run-time identification; a single virtual in the object’s declared type is Note that this is also taken into when working with objects via MI (see GDB/MI ).

set object off Display only the type of objects, without to the virtual function table. is the default setting.

show object Show whether or declared, object types are

set print static-members set print on Print static members displaying a C ++ object. The default is on.

set static-members off Do not print static when displaying a C ++ object.

print static-members Show C ++ static members are printed or

set print pascal_static-members set print on Print static members displaying a Pascal object. The is on.

set print pascal_static-members off Do not print members when displaying a object.

show print Show whether Pascal members are printed or not.

set vtbl set print vtbl on print C ++ virtual function The default is off. (The commands do not work on programs with the HP ANSI C ++ compiler ( aCC ).)

set vtbl off Do not pretty print C ++ function tables.

show vtbl Show whether C ++ function tables are pretty or not.

Volkswagen Pointer I
Volkswagen Pointer I
Volkswagen Pointer I
Volkswagen Pointer I

Interesting Articles

Смотрите также:

Other articles of the category "Pointer":

Our partners
Follow us
Contact us
Our contacts

Born in the USSR

About this site

For all questions about advertising, please contact listed on the site.

Volkswagen all cars catalog with specifications, pictures, ratings, reviews and discusssions about cars Volkswagen.