From: Philippe Waroquiers Date: Wed, 12 Feb 2014 20:41:58 +0000 (+0000) Subject: No need to discard translation in gdbserver when --vgdb=full X-Git-Tag: svn/VALGRIND_3_10_0~634 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=012e0080efa3d23f6f2fa2b310047e677ac79c26;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/coregrind/m_gdbserver/m_gdbserver.c b/coregrind/m_gdbserver/m_gdbserver.c index f4e4be0955..1da1e950b2 100644 --- a/coregrind/m_gdbserver/m_gdbserver.c +++ b/coregrind/m_gdbserver/m_gdbserver.c @@ -219,15 +219,19 @@ static void add_gs_address (Addr addr, GS_Kind kind, const HChar* from) 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); }