Place displaced step data directly in inferior structure
authorSimon Marchi <simon.marchi@ericsson.com>
Wed, 2 Jan 2019 22:31:08 +0000 (17:31 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 2 Jan 2019 22:31:08 +0000 (17:31 -0500)
commitd20172fc53017cef12d64b21aa2fdac72072558c
tree405b1ffd879db4b7a5681b885a9f14e1683a405f
parente3319240732bc9543af8ced9d80ec89d0b629b2e
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.
gdb/ChangeLog
gdb/inferior.h
gdb/infrun.c
gdb/infrun.h
This page took 0.032537 seconds and 4 git commands to generate.