summaryrefslogtreecommitdiff
path: root/gdb/common/common-utils.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-02-14 17:11:38 +0000
committerPedro Alves <palves@redhat.com>2013-02-14 17:11:38 +0000
commit25fb808b26426d2068194ae170052cc3a363943f (patch)
tree868ce60ee29e86792aa9d6182646a8d1704abd4f /gdb/common/common-utils.h
parent201a98005e53f66a7f3d4bd51d7b28f592a250a7 (diff)
downloadgdb-25fb808b26426d2068194ae170052cc3a363943f.tar.gz
Move savestring to common/common-utils.c, make gdbserver use it.
This makes gdbserver share gdb's savestring, instead of baking its own. Tested on x86_64 Fedora 17. gdb/ 2013-02-14 Pedro Alves <palves@redhat.com> * utils.c (savestring): Don't #undef it. Move function to common/common-utils.c. * common/common-utils.c: Include gdb_string.h. (savestring): Move here from utils.c. * common/common-utils.h (savestring): Declare. gdb/gdbserver/ 2013-02-14 Pedro Alves <palves@redhat.com> * tracepoint.c (save_string): Delete. (add_tracepoint_action): Use savestring instead of save_string.
Diffstat (limited to 'gdb/common/common-utils.h')
-rw-r--r--gdb/common/common-utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
index 2abc6d1ff42..9b659d8dace 100644
--- a/gdb/common/common-utils.h
+++ b/gdb/common/common-utils.h
@@ -47,4 +47,10 @@ char *xstrvprintf (const char *format, va_list ap)
int xsnprintf (char *str, size_t size, const char *format, ...)
ATTRIBUTE_PRINTF (3, 4);
+/* Make a copy of the string at PTR with LEN characters
+ (and add a null character at the end in the copy).
+ Uses malloc to get the space. Returns the address of the copy. */
+
+char *savestring (const char *ptr, size_t len);
+
#endif