aboutsummaryrefslogtreecommitdiff
path: root/gdb/inferior.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2019-01-02 17:31:08 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2019-01-02 17:31:08 -0500
commitd20172fc53017cef12d64b21aa2fdac72072558c (patch)
tree405b1ffd879db4b7a5681b885a9f14e1683a405f /gdb/inferior.h
parente3319240732bc9543af8ced9d80ec89d0b629b2e (diff)
downloadgdb-d20172fc53017cef12d64b21aa2fdac72072558c.zip
gdb-d20172fc53017cef12d64b21aa2fdac72072558c.tar.gz
gdb-d20172fc53017cef12d64b21aa2fdac72072558c.tar.bz2
Place displaced step data directly in inferior structure
This patch moves the per-inferior data related to displaced stepping to be directly in the inferior structure, rather than in a container on the side. On notable difference is that previously, we deleted the state on inferior exit, which guaranteed a clean state if re-using the inferior for a new run or attach. We now need to reset the state manually. At the same time, I changed step_saved_copy to be a gdb::byte_vector, so it is automatically freed on destruction (which should plug the leak reported here [1]). [1] https://sourceware.org/ml/gdb-patches/2018-11/msg00202.html gdb/ChangeLog: * inferior.h (class inferior) <displaced_step_state>: New field. * infrun.h (struct displaced_step_state): Move here from infrun.c. Initialize fields, add constructor. <inf>: Remove field. <reset>: New method. * infrun.c (struct displaced_step_inferior_state): Move to infrun.h. (displaced_step_inferior_states): Remove. (get_displaced_stepping_state): Adust. (displaced_step_in_progress_any_inferior): Adjust. (displaced_step_in_progress_thread): Adjust. (displaced_step_in_progress): Adjust. (add_displaced_stepping_state): Remove. (get_displaced_step_closure_by_addr): Adjust. (remove_displaced_stepping_state): Remove. (infrun_inferior_exit): Call displaced_step_state.reset. (use_displaced_stepping): Don't check for NULL. (displaced_step_prepare_throw): Call get_displaced_stepping_state. (displaced_step_fixup): Don't check for NULL. (prepare_for_detach): Don't check for NULL.
Diffstat (limited to 'gdb/inferior.h')
-rw-r--r--gdb/inferior.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 276c442..a82df1a 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -503,6 +503,9 @@ public:
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;
};