aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-06-14 15:32:46 -0700
committerTom Tromey <tom@tromey.com>2018-09-17 00:42:17 -0600
commitdd848631cb96f7d25270faeee4c9736577230a29 (patch)
tree74e58b6378972ec36458a95164517f54122d7229 /gdb/infrun.c
parent1a3389079dd5c93419846f44d42027a526ce19cf (diff)
downloadgdb-dd848631cb96f7d25270faeee4c9736577230a29.zip
gdb-dd848631cb96f7d25270faeee4c9736577230a29.tar.gz
gdb-dd848631cb96f7d25270faeee4c9736577230a29.tar.bz2
Use new and delete for struct infcall_suspend_state
This changes infrun.c to use new and delete for infcall_suspend_state. This enables the coming cleanups. gdb/ChangeLog 2018-09-17 Tom Tromey <tom@tromey.com> * gdbthread.h (struct thread_suspend_state): Add initializers. (class thread_info) <suspend>: Remove initializer. * infrun.c (struct infcall_suspend_state): Add initializers. (save_infcall_suspend_state): Use new. (discard_infcall_suspend_state): Use delete.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 7731ccd..6039ae3 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -8810,15 +8810,15 @@ struct infcall_suspend_state
struct thread_suspend_state thread_suspend;
/* Other fields: */
- readonly_detached_regcache *registers;
+ readonly_detached_regcache *registers = nullptr;
/* Format of SIGINFO_DATA or NULL if it is not present. */
- struct gdbarch *siginfo_gdbarch;
+ struct gdbarch *siginfo_gdbarch = nullptr;
/* The inferior format depends on SIGINFO_GDBARCH and it has a length of
TYPE_LENGTH (gdbarch_get_siginfo_type ()). For different gdbarch the
content would be invalid. */
- gdb_byte *siginfo_data;
+ gdb_byte *siginfo_data = nullptr;
};
struct infcall_suspend_state *
@@ -8850,7 +8850,7 @@ save_infcall_suspend_state (void)
}
}
- inf_state = XCNEW (struct infcall_suspend_state);
+ inf_state = new struct infcall_suspend_state;
if (siginfo_data)
{
@@ -8916,7 +8916,7 @@ discard_infcall_suspend_state (struct infcall_suspend_state *inf_state)
{
delete inf_state->registers;
xfree (inf_state->siginfo_data);
- xfree (inf_state);
+ delete inf_state;
}
readonly_detached_regcache *