diff options
author | Tom Tromey <tom@tromey.com> | 2018-06-14 15:59:55 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-09-17 00:42:18 -0600 |
commit | ee841dd8fee73c355587533027aecc8983bd5478 (patch) | |
tree | fda1bcc80220de90f052a0ea8461fa154cacff2b /gdb/infrun.c | |
parent | 117f580a97f721465d62d0630594dafdcd89e4e8 (diff) | |
download | gdb-ee841dd8fee73c355587533027aecc8983bd5478.zip gdb-ee841dd8fee73c355587533027aecc8983bd5478.tar.gz gdb-ee841dd8fee73c355587533027aecc8983bd5478.tar.bz2 |
Use new and delete for struct infcall_control_state
This changes infrun.c to use new and delete for infcall_control_state.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* gdbthread.h (struct thread_control_state): Add initializer.
(class thread_info) <control>: Remove initializer.
* inferior.h (struct inferior_control_state): Add initializer.
(class inferior) <control>: Remove initializer.
(exit_inferior_1): Update.
* infrun.c (struct infcall_control_state): Add constructors.
(save_infcall_control_state): Use new.
(restore_infcall_control_state, discard_infcall_control_state):
Use delete.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index d350ad1..0df539a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -8928,11 +8928,11 @@ struct infcall_control_state struct inferior_control_state inferior_control; /* Other fields: */ - enum stop_stack_kind stop_stack_dummy; - int stopped_by_random_signal; + enum stop_stack_kind stop_stack_dummy = STOP_NONE; + int stopped_by_random_signal = 0; /* ID if the selected frame when the inferior function call was made. */ - struct frame_id selected_frame_id; + struct frame_id selected_frame_id {}; }; /* Save all of the information associated with the inferior<==>gdb @@ -8941,8 +8941,7 @@ struct infcall_control_state struct infcall_control_state * save_infcall_control_state (void) { - struct infcall_control_state *inf_status = - XNEW (struct infcall_control_state); + struct infcall_control_state *inf_status = new struct infcall_control_state; struct thread_info *tp = inferior_thread (); struct inferior *inf = current_inferior (); @@ -9028,7 +9027,7 @@ restore_infcall_control_state (struct infcall_control_state *inf_status) END_CATCH } - xfree (inf_status); + delete inf_status; } static void @@ -9058,7 +9057,7 @@ discard_infcall_control_state (struct infcall_control_state *inf_status) /* See save_infcall_control_state for info on stop_bpstat. */ bpstat_clear (&inf_status->thread_control.stop_bpstat); - xfree (inf_status); + delete inf_status; } /* See infrun.h. */ |