diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2007-01-26 20:53:52 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2007-01-26 20:53:52 +0000 |
commit | 3a60f64edda5bf2b464ad841704c225893a1cd73 (patch) | |
tree | fa586a1cf52648a2d380b751ecb5105c54c9c134 /gdb/doc | |
parent | e784b426e6a8bba4407def53f1cc3a318be7abd1 (diff) | |
download | gdb-3a60f64edda5bf2b464ad841704c225893a1cd73.zip gdb-3a60f64edda5bf2b464ad841704c225893a1cd73.tar.gz gdb-3a60f64edda5bf2b464ad841704c225893a1cd73.tar.bz2 |
* gdb.texinfo: Describe CHAR array vs. string identifcation rules.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 1dc1718..350c01d 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2007-01-26 Jan Kratochvil <jan.kratochvil@redhat.com> + Eli Zaretskii <eliz@gnu.org> + + * gdb.texinfo: Describe CHAR array vs. string identifcation rules. + 2007-01-26 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Compilation, Files, Bootstrapping, Bug Reporting): diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 2cb6e06..de740ac 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -5632,6 +5632,26 @@ If you ask to print an object whose contents are unknown to by the debug information, @value{GDBN} will say @samp{<incomplete type>}. @xref{Symbols, incomplete type}, for more about this. +Strings are identified as arrays of @code{char} values without specified +signedness. Arrays of either @code{signed char} or @code{unsigned char} get +printed as arrays of 1 byte sized integers. @code{-fsigned-char} or +@code{-funsigned-char} @value{NGCC} options have no effect as @value{GDBN} +defines literal string type @code{"char"} as @code{char} without a sign. +For program code + +@smallexample +char var0[] = "A"; +signed char var1[] = "A"; +@end smallexample + +You get during debugging +@smallexample +(gdb) print var0 +$1 = "A" +(gdb) print var1 +$2 = @{65 'A', 0 '\0'@} +@end smallexample + @node Arrays @section Artificial arrays |