aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-21 12:35:59 -0600
committerTom Tromey <tom@tromey.com>2018-06-18 12:51:02 -0600
commitb4be9fadea469e2c937c81a8f1d3243206f9bcfc (patch)
tree7ffa8ba6e9cc9c630d8775e71e30963d390e53c6 /gdb/valprint.h
parent3f0dbd670b59aade6224aadcbc3a1943a4645a68 (diff)
downloadbinutils-b4be9fadea469e2c937c81a8f1d3243206f9bcfc.zip
binutils-b4be9fadea469e2c937c81a8f1d3243206f9bcfc.tar.gz
binutils-b4be9fadea469e2c937c81a8f1d3243206f9bcfc.tar.bz2
Use unique_xmalloc_ptr for read_string
This changes read_string's "buffer" out-parameter to be a unique_xmalloc_ptr, then updates the users. This allows for the removal of some cleanups. I chose unique_xmalloc_ptr rather than byte_vector here due to the way Guile unwinding seems to work. Tested by the buildbot. gdb/ChangeLog 2018-06-18 Tom Tromey <tom@tromey.com> * valprint.h (read_string): Update. * valprint.c (read_string): Change type of "buffer". (val_print_string): Update. * python/py-value.c (valpy_string): Update. * language.h (struct language_defn) <la_get_string>: Change type of "buffer". (default_get_string, c_get_string): Update. * language.c (default_get_string): Change type of "buffer". * guile/scm-value.c (gdbscm_value_to_string): Update. * c-lang.c (c_get_string): Change type of "buffer".
Diffstat (limited to 'gdb/valprint.h')
-rw-r--r--gdb/valprint.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/valprint.h b/gdb/valprint.h
index 16f53f0..81638d4 100644
--- a/gdb/valprint.h
+++ b/gdb/valprint.h
@@ -150,7 +150,8 @@ extern void print_function_pointer_address (const struct value_print_options *op
extern int read_string (CORE_ADDR addr, int len, int width,
unsigned int fetchlimit,
- enum bfd_endian byte_order, gdb_byte **buffer,
+ enum bfd_endian byte_order,
+ gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
int *bytes_read);
extern void val_print_optimized_out (const struct value *val,