diff options
author | Dominik Czarnota <dominik.b.czarnota@gmail.com> | 2017-11-26 22:42:18 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2017-11-26 22:42:19 -0500 |
commit | ee9a09e959a5b7c152cc72028d4f6c879bc901c9 (patch) | |
tree | e4a0aa2cf3552f6f7286d6f0151f5bb2fd75e461 /gdb/doc | |
parent | e8e7d10c39955e7ff99ff42f6f16d6befe2fa12e (diff) | |
download | gdb-ee9a09e959a5b7c152cc72028d4f6c879bc901c9.zip gdb-ee9a09e959a5b7c152cc72028d4f6c879bc901c9.tar.gz gdb-ee9a09e959a5b7c152cc72028d4f6c879bc901c9.tar.bz2 |
Update find command help and search memory docs
This patch updates the `find` command help and docs description to show
how to search for not null terminated strings when current language's
strings includes it.
gdb/ChangeLog:
PR gdb/21945
* findcmd.c (_initialize_mem_search): Update find command help
text.
gdb/doc/ChangeLog:
PR gdb/21945
* gdb.texinfo (Search Memory): Update description and example
about how to search a string without NULL terminator.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 988b7b8..2a1eb76 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2017-11-26 Dominik Czarnota <dominik.b.czarnota@gmail.com> + + PR gdb/21945 + * gdb.texinfo (Search Memory): Update description and example + about how to search a string without NULL terminator. + 2017-11-24 Joel Brobecker <brobecker@adacore.com> * gdb.texinfo (GDB/MI Ada Exception Information): Document diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 00451d2..675f6e7 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -11920,6 +11920,8 @@ giant words (eight bytes) All values are interpreted in the current language. This means, for example, that if the current source language is C/C@t{++} then searching for the string ``hello'' includes the trailing '\0'. +The null terminator can be removed from searching by using casts, +e.g.: @samp{@{char[5]@}"hello"}. If the value size is not specified, it is taken from the value's type in the current language. @@ -11969,7 +11971,11 @@ you get during debugging: (gdb) find &hello[0], +sizeof(hello), 'h', 'e', 'l', 'l', 'o' 0x8049567 <hello.1620> 0x804956d <hello.1620+6> -2 patterns found +2 patterns found. +(gdb) find &hello[0], +sizeof(hello), @{char[5]@}"hello" +0x8049567 <hello.1620> +0x804956d <hello.1620+6> +2 patterns found. (gdb) find /b1 &hello[0], +sizeof(hello), 'h', 0x65, 'l' 0x8049567 <hello.1620> 1 pattern found |