gdb: remove reference to current inferior in target_stack::unpush
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 7 May 2021 15:52:51 +0000 (11:52 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 7 May 2021 15:52:51 +0000 (11:52 -0400)
commitbedc473418aa3b595a985e4adbbeb7864c5891e3
treea3ad29e58b57886124170cfef73e9149bdc274e7
parent27f0a4314aa5f81329e52dfbb4d06756415a4c53
gdb: remove reference to current inferior in target_stack::unpush

target_stack::unpush needs to get the target beneath the target being
unpushed to update the m_top field (which keeps the stratum of the
top-most target).  It currently does so using target_ops::beneath, which
uses the target stack of the current inferior.  The target stack of the
current inferior is the same as the `this` in the unpush method.

Avoid this detour and remove this reference to the current inferior by
calling target_ops::find_beneath and passing `this` to find the target
beneath `t` in the target stack that is `this`.

gdb/ChangeLog:

* target.c (target_stack::unpush): Call target_ops::find_beneath
to get the target beneath `t`.

Change-Id: If9d9661567c5c16f655d270bd2ec9f1b3aa6dadc
gdb/ChangeLog
gdb/target.c
This page took 0.028314 seconds and 4 git commands to generate.