diff options
author | Tom Tromey <tom@tromey.com> | 2018-12-29 12:42:18 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-12-30 08:54:13 -0700 |
commit | 95bc9f0bf06637cf9c1147008ac32d6b00c42707 (patch) | |
tree | 8af056bf84c73a05ff6c6c85068c90a5bf5f2e66 /gdb/top.c | |
parent | ecad3b215d34263968bb7c74701e3ca9483ac710 (diff) | |
download | gdb-95bc9f0bf06637cf9c1147008ac32d6b00c42707.zip gdb-95bc9f0bf06637cf9c1147008ac32d6b00c42707.tar.gz gdb-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.c')
-rw-r--r-- | gdb/top.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -900,10 +900,10 @@ gdb_in_secondary_prompt_p (struct ui *ui) text. */ static void -gdb_readline_wrapper_line (char *line) +gdb_readline_wrapper_line (gdb::unique_xmalloc_ptr<char> &&line) { gdb_assert (!gdb_readline_wrapper_done); - gdb_readline_wrapper_result = line; + gdb_readline_wrapper_result = line.release (); gdb_readline_wrapper_done = 1; /* Prevent operate-and-get-next from acting too early. */ @@ -972,7 +972,7 @@ public: private: - void (*m_handler_orig) (char *); + void (*m_handler_orig) (gdb::unique_xmalloc_ptr<char> &&); int m_already_prompted_orig; /* Whether the target was async. */ |