aboutsummaryrefslogtreecommitdiff
path: root/gdb/findcmd.c
diff options
context:
space:
mode:
authorDominik Czarnota <dominik.b.czarnota@gmail.com>2017-11-26 22:42:18 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2017-11-26 22:42:19 -0500
commitee9a09e959a5b7c152cc72028d4f6c879bc901c9 (patch)
treee4a0aa2cf3552f6f7286d6f0151f5bb2fd75e461 /gdb/findcmd.c
parente8e7d10c39955e7ff99ff42f6f16d6befe2fa12e (diff)
downloadgdb-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/findcmd.c')
-rw-r--r--gdb/findcmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/findcmd.c b/gdb/findcmd.c
index b43fefc..d437b56 100644
--- a/gdb/findcmd.c
+++ b/gdb/findcmd.c
@@ -293,7 +293,9 @@ and if not specified the size is taken from the type of the expression\n\
in the current language.\n\
Note that this means for example that in the case of C-like languages\n\
a search for an untyped 0x42 will search for \"(int) 0x42\"\n\
-which is typically four bytes.\n\
+which is typically four bytes, and a search for a string \"hello\" will\n\
+include the trailing '\\0'. The null terminator can be removed from\n\
+searching by using casts, e.g.: {char[5]}\"hello\".\n\
\n\
The address of the last match is stored as the value of \"$_\".\n\
Convenience variable \"$numfound\" is set to the number of matches."),