Skip to content

Commit 595915c

Browse files
committed
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.
1 parent e946b68 commit 595915c

2 files changed

Lines changed: 12 additions & 17 deletions

File tree

gdb/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2019-03-20 Tom Tromey <tromey@adacore.com>
2+
3+
* infrun.c (handle_inferior_event): Rename from
4+
handle_inferior_event_1. Create a scoped_value_mark.
5+
(handle_inferior_event): Remove.
6+
17
2019-03-19 Tom Tromey <tromey@adacore.com>
28

39
* mi/mi-interp.c (mi_on_normal_stop_1): Only show displays once.

gdb/infrun.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4591,8 +4591,13 @@ handle_no_resumed (struct execution_control_state *ecs)
45914591
once). */
45924592

45934593
static void
4594-
handle_inferior_event_1 (struct execution_control_state *ecs)
4594+
handle_inferior_event (struct execution_control_state *ecs)
45954595
{
4596+
/* Make sure that all temporary struct value objects that were
4597+
created during the handling of the event get deleted at the
4598+
end. */
4599+
scoped_value_mark free_values;
4600+
45964601
enum stop_kind stop_soon;
45974602

45984603
if (ecs->ws.kind == TARGET_WAITKIND_IGNORE)
@@ -5189,22 +5194,6 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
51895194
}
51905195
}
51915196

5192-
/* A wrapper around handle_inferior_event_1, which also makes sure
5193-
that all temporary struct value objects that were created during
5194-
the handling of the event get deleted at the end. */
5195-
5196-
static void
5197-
handle_inferior_event (struct execution_control_state *ecs)
5198-
{
5199-
struct value *mark = value_mark ();
5200-
5201-
handle_inferior_event_1 (ecs);
5202-
/* Purge all temporary values created during the event handling,
5203-
as it could be a long time before we return to the command level
5204-
where such values would otherwise be purged. */
5205-
value_free_to_mark (mark);
5206-
}
5207-
52085197
/* Restart threads back to what they were trying to do back when we
52095198
paused them for an in-line step-over. The EVENT_THREAD thread is
52105199
ignored. */

0 commit comments

Comments
 (0)