diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-09-05 00:51:49 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-09-05 00:51:49 +0000 |
commit | ea37ba09261f349ac2748da0d4f8f513184776f9 (patch) | |
tree | e809a75cbee45334e9521254235524a6394f406c /gdb/doc | |
parent | fcd776e5474bde02e7555b33ef57905eae0f7d3e (diff) | |
download | gdb-ea37ba09261f349ac2748da0d4f8f513184776f9.zip gdb-ea37ba09261f349ac2748da0d4f8f513184776f9.tar.gz gdb-ea37ba09261f349ac2748da0d4f8f513184776f9.tar.bz2 |
* NEWS: Update description of string changes. Mention print/s.
* c-valprint.c (textual_element_type): New.
(c_val_print): Use it. Do not skip address printing for pointers
with a string format.
(c_value_print): Doc update.
* dwarf2read.c (read_array_type): Use make_vector_type.
* gdbtypes.c (make_vector_type): New.
(init_vector_type): Use it.
(gdbtypes_post_init): Initialize builtin_true_unsigned_char.
(_initialize_gdbtypes): Mark int8_t and uint8_t as TYPE_FLAG_NOTTEXT.
* gdbtypes.h (struct builtin_type): Add builtin_true_unsigned_char.
(TYPE_FLAG_NOTTEXT, TYPE_NOTTEXT): New.
(make_vector_type): New.
* printcmd.c (print_formatted): Only handle 's' and 'i' for examine.
Call the language print routine for string format.
(print_scalar_formatted): Call val_print for string format. Handle
unsigned original types for char format.
(validate_format): Do not reject string format.
* stabsread.c (read_type): Use make_vector_type.
* xml-tdesc.c (tdesc_start_vector): Use init_vector_type.
* gdb.texinfo (Output Formats): Update 'c' description. Describe 's'.
(Examining Memory): Update mentions of the 's' format.
(Automatic Display): Likewise.
* gdb.arch/i386-sse.exp: Do not expect character constants.
* gdb.base/charsign.c, gdb.base/charsign.exp: Delete.
* gdb.base/display.exp: Allow print/s.
* gdb.base/printcmds.exp, gdb.base/setvar.exp: Revert signed
and unsigned char array changes.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 32 |
2 files changed, 31 insertions, 8 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index ddb643d..ad0ed2f 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,10 @@ +2007-09-04 Daniel Jacobowitz <dan@codesourcery.com> + Jim Blandy <jimb@codesourcery.com> + + * gdb.texinfo (Output Formats): Update 'c' description. Describe 's'. + (Examining Memory): Update mentions of the 's' format. + (Automatic Display): Likewise. + 2007-09-02 Daniel Jacobowitz <dan@codesourcery.com> * gdb.texinfo: Update the FSF's Back-Cover Text. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 334e5c3..38e6f6a 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -5767,9 +5767,27 @@ prints both the numerical value and its character representation. The character representation is replaced with the octal escape @samp{\nnn} for characters outside the 7-bit @sc{ascii} range. +Without this format, @value{GDBN} displays @code{char}, +@w{@code{unsigned char}}, and @w{@code{signed char}} data as character +constants. Single-byte members of vectors are displayed as integer +data. + @item f Regard the bits of the value as a floating point number and print using typical floating point syntax. + +@item s +@cindex printing strings +@cindex printing byte arrays +Regard as a string, if possible. With this format, pointers to single-byte +data are displayed as null-terminated strings and arrays of single-byte data +are displayed as fixed-length strings. Other values are displayed in their +natural types. + +Without this format, @value{GDBN} displays pointers to and arrays of +@code{char}, @w{@code{unsigned char}}, and @w{@code{signed char}} as +strings. Single-byte members of a vector are displayed as an integer +array. @end table For example, to print the program counter in hex (@pxref{Registers}), type @@ -5817,10 +5835,9 @@ how much memory (counting by units @var{u}) to display. @item @var{f}, the display format The display format is one of the formats used by @code{print} (@samp{x}, @samp{d}, @samp{u}, @samp{o}, @samp{t}, @samp{a}, @samp{c}, -@samp{f}), and in addition @samp{s} (for null-terminated strings) and -@samp{i} (for machine instructions). The default is @samp{x} -(hexadecimal) initially. The default changes each time you use either -@code{x} or @code{print}. +@samp{f}, @samp{s}), and in addition @samp{i} (for machine instructions). +The default is @samp{x} (hexadecimal) initially. The default changes +each time you use either @code{x} or @code{print}. @item @var{u}, the unit size The unit size is any of @@ -5936,10 +5953,9 @@ The automatic display looks like this: This display shows item numbers, expressions and their current values. As with displays you request manually using @code{x} or @code{print}, you can specify the output format you prefer; in fact, @code{display} decides -whether to use @code{print} or @code{x} depending on how elaborate your -format specification is---it uses @code{x} if you specify a unit size, -or one of the two formats (@samp{i} and @samp{s}) that are only -supported by @code{x}; otherwise it uses @code{print}. +whether to use @code{print} or @code{x} depending your format +specification---it uses @code{x} if you specify either the @samp{i} +or @samp{s} format, or a unit size; otherwise it uses @code{print}. @table @code @kindex display |