aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-12-29 12:42:18 -0700
committerTom Tromey <tom@tromey.com>2018-12-30 08:54:13 -0700
commit95bc9f0bf06637cf9c1147008ac32d6b00c42707 (patch)
tree8af056bf84c73a05ff6c6c85068c90a5bf5f2e66 /gdb/top.h
parentecad3b215d34263968bb7c74701e3ca9483ac710 (diff)
downloadbinutils-95bc9f0bf06637cf9c1147008ac32d6b00c42707.zip
binutils-95bc9f0bf06637cf9c1147008ac32d6b00c42707.tar.gz
binutils-95bc9f0bf06637cf9c1147008ac32d6b00c42707.tar.bz2
Change input_handler to take a unique_xmalloc_ptr
This changes ui::input_handler to take a unique_xmalloc_ptr. This clarifies the ownership transfer of input_handler's argument. gdb/ChangeLog 2018-12-30 Tom Tromey <tom@tromey.com> * event-top.h (command_line_handler): Update. * top.c (class gdb_readline_wrapper_cleanup) <m_handler_orig>: Update. (gdb_readline_wrapper_line): Update. * top.h (struct ui) <input_handler>: Take a unique_xmalloc_ptr. (handle_line_of_input): Update. * event-top.c: Update. (gdb_readline_no_editing_callback): Update. (command_line_handler): Take a unique_xmalloc_ptr. (handle_line_of_input): Take a const char *. (command_line_append_input_line): Take a const char *.
Diffstat (limited to 'gdb/top.h')
-rw-r--r--gdb/top.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/top.h b/gdb/top.h
index b34defa..4d11f34 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -81,7 +81,7 @@ struct ui
/* The function to invoke when a complete line of input is ready for
processing. */
- void (*input_handler) (char *);
+ void (*input_handler) (gdb::unique_xmalloc_ptr<char> &&);
/* True if this UI is using the readline library for command
editing; false if using GDB's own simple readline emulation, with
@@ -297,7 +297,7 @@ extern void show_history (const char *, int);
extern void set_verbose (const char *, int, struct cmd_list_element *);
extern char *handle_line_of_input (struct buffer *cmd_line_buffer,
- char *rl, int repeat,
+ const char *rl, int repeat,
const char *annotation_suffix);
#endif