diff options
author | Tom Tromey <tromey@adacore.com> | 2019-03-20 07:57:09 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-03-20 11:09:10 -0600 |
commit | 595915c1c135a77afa01d30a888a48fcc55a08ec (patch) | |
tree | 6f00f75289ee8f7139451798022510310c6b6392 /gdb | |
parent | e946b687baa552034ee57f3c119e56a20961452e (diff) | |
download | fsf-binutils-gdb-595915c1c135a77afa01d30a888a48fcc55a08ec.zip fsf-binutils-gdb-595915c1c135a77afa01d30a888a48fcc55a08ec.tar.gz fsf-binutils-gdb-595915c1c135a77afa01d30a888a48fcc55a08ec.tar.bz2 |
Merge handle_inferior_event and handle_inferior_event_1
I noticed that handle_inferior_event is just a small wrapper that
frees the value chain. This patch replaces it with a
scoped_value_mark, reducing the number of lines of code here.
Regression tested on x86-64 Fedora 29.
gdb/ChangeLog
2019-03-20 Tom Tromey <tromey@adacore.com>
* infrun.c (handle_inferior_event): Rename from
handle_inferior_event_1. Create a scoped_value_mark.
(handle_inferior_event): Remove.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/infrun.c | 23 |
2 files changed, 12 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index be65681..4345e01 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-03-20 Tom Tromey <tromey@adacore.com> + + * infrun.c (handle_inferior_event): Rename from + handle_inferior_event_1. Create a scoped_value_mark. + (handle_inferior_event): Remove. + 2019-03-19 Tom Tromey <tromey@adacore.com> * mi/mi-interp.c (mi_on_normal_stop_1): Only show displays once. diff --git a/gdb/infrun.c b/gdb/infrun.c index 550fbe7..ad78921 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4591,8 +4591,13 @@ handle_no_resumed (struct execution_control_state *ecs) once). */ static void -handle_inferior_event_1 (struct execution_control_state *ecs) +handle_inferior_event (struct execution_control_state *ecs) { + /* Make sure that all temporary struct value objects that were + created during the handling of the event get deleted at the + end. */ + scoped_value_mark free_values; + enum stop_kind stop_soon; if (ecs->ws.kind == TARGET_WAITKIND_IGNORE) @@ -5189,22 +5194,6 @@ Cannot fill $_exitsignal with the correct signal number.\n")); } } -/* A wrapper around handle_inferior_event_1, which also makes sure - that all temporary struct value objects that were created during - the handling of the event get deleted at the end. */ - -static void -handle_inferior_event (struct execution_control_state *ecs) -{ - struct value *mark = value_mark (); - - handle_inferior_event_1 (ecs); - /* Purge all temporary values created during the event handling, - as it could be a long time before we return to the command level - where such values would otherwise be purged. */ - value_free_to_mark (mark); -} - /* Restart threads back to what they were trying to do back when we paused them for an in-line step-over. The EVENT_THREAD thread is ignored. */ |