No need to discard translation in gdbserver when --vgdb=full
is given, as all instructions are in any case instrumented when
full is given.
This is (slightly) more efficient for full, and allows
to bypass the arm64 discard_translation problem caused by unchain
missing
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13802 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_gdbserver/m_gdbserver.c b/coregrind/m_gdbserver/m_gdbserver.c
index f4e4be0..1da1e95 100644
--- a/coregrind/m_gdbserver/m_gdbserver.c
+++ b/coregrind/m_gdbserver/m_gdbserver.c
@@ -219,15 +219,19 @@
VG_(HT_add_node)(gs_addresses, p);
/* It should be sufficient to discard a range of 1.
We use 2 to ensure the below is not sensitive to the presence
- of thumb bit in the range of addresses to discard. */
- VG_(discard_translations) (addr, 2, from);
+ of thumb bit in the range of addresses to discard.
+ No need to discard translations for Vg_VgdbFull as all
+ instructions are in any case vgdb-instrumented. */
+ if (VG_(clo_vgdb) != Vg_VgdbFull)
+ VG_(discard_translations) (addr, 2, from);
}
static void remove_gs_address (GS_Address* g, const HChar* from)
{
VG_(HT_remove) (gs_addresses, g->addr);
- // See add_gs_address for the explanation for the range 2 below.
- VG_(discard_translations) (g->addr, 2, from);
+ // See add_gs_address for the explanation for condition and the range 2 below.
+ if (VG_(clo_vgdb) != Vg_VgdbFull)
+ VG_(discard_translations) (g->addr, 2, from);
VG_(arena_free) (VG_AR_CORE, g);
}