/* Variables that describe the inferior process running under GDB:
Where it is, why it stopped, and how to step it.
- Copyright (C) 1986-2018 Free Software Foundation, Inc.
+ Copyright (C) 1986-2019 Free Software Foundation, Inc.
This file is part of GDB.
#include "frame.h"
/* For gdb_environ. */
-#include "environ.h"
+#include "common/environ.h"
#include "progspace.h"
#include "registry.h"
#include "symfile-add-flags.h"
#include "common/refcounted-object.h"
+#include "common/forward-scope-exit.h"
-#include "common-inferior.h"
+#include "common/common-inferior.h"
#include "gdbthread.h"
struct infcall_suspend_state;
{
void operator() (struct infcall_suspend_state *state) const
{
- restore_infcall_suspend_state (state);
+ try
+ {
+ restore_infcall_suspend_state (state);
+ }
+ catch (const gdb_exception_error &e)
+ {
+ /* If we are restoring the inferior state due to an exception,
+ some error message will be printed. So, only warn the user
+ when we cannot restore during normal execution. */
+ if (!std::uncaught_exception ())
+ warning (_("Failed to restore inferior state: %s"), e.what ());
+ }
}
};
extern void interrupt_target_1 (int all_threads);
-extern void delete_longjmp_breakpoint_cleanup (void *arg);
+using delete_longjmp_breakpoint_cleanup
+ = FORWARD_SCOPE_EXIT (delete_longjmp_breakpoint);
extern void detach_command (const char *, int);
the inferior object's refcount, to prevent something deleting the
inferior object before reverting back (e.g., due to a
"remove-inferiors" command (see
- make_cleanup_restore_current_thread). All other inferior
+ scoped_restore_current_inferior). All other inferior
references are considered weak references. Inferiors are always
listed exactly once in the inferior list, so placing an inferior in
the inferior list is an implicit, not counted strong reference. */
this gdbarch. */
struct gdbarch *gdbarch = NULL;
+ /* Data related to displaced stepping. */
+ displaced_step_inferior_state displaced_step_state;
+
/* Per inferior data-pointers required by other GDB modules. */
REGISTRY_FIELDS;
};