From 2669cade3dcebf5d572bcd535cf21934cbc1633c Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 9 Mar 2016 18:25:00 +0000 Subject: Simplify saved_command_line handling There doesn't seem to be much point in trying to reuse this buffer. Prefer simplicity instead. (In case you're wondering whether this fixes an off-by-one: linelength is misnamed; it's really a size including terminating null char.) gdb/ChangeLog: 2016-03-09 Pedro Alves * event-top.c (command_line_handler): Use xfree + xstrdup instead of xrealloc + strcpy. * main.c (captured_main): Use xstrdup instead of xmalloc plus manual clear. * top.c (saved_command_line): Rewrite comment. (saved_command_line_size): Delete. (command_line_input): Use xfree + xstrdup instead of xrealloc + strcpy. * top.h (saved_command_line_size): Delete declaration. --- gdb/ChangeLog | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gdb/ChangeLog') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 881d231..bc2e99e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 2016-03-09 Pedro Alves + * event-top.c (command_line_handler): Use xfree + xstrdup instead + of xrealloc + strcpy. + * main.c (captured_main): Use xstrdup instead of xmalloc plus + manual clear. + * top.c (saved_command_line): Rewrite comment. + (saved_command_line_size): Delete. + (command_line_input): Use xfree + xstrdup instead of xrealloc + + strcpy. + * top.h (saved_command_line_size): Delete declaration. + +2016-03-09 Pedro Alves + * event-top.c: Include buffer.h. (gdb_readline_no_editing_callback): Use struct buffer instead of xrealloc. -- cgit v1.1