From 2cf9be763f4ac3ad618223aba1be087cb60aa36d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 16 Nov 2009 09:07:07 +0000 Subject: [PATCH] Make sure isIFunc is initialised whenever we add a symbol. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10944 --- coregrind/m_debuginfo/readmacho.c | 1 + coregrind/m_debuginfo/readpdb.c | 6 ++++++ coregrind/m_debuginfo/readxcoff.c | 9 +++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/coregrind/m_debuginfo/readmacho.c b/coregrind/m_debuginfo/readmacho.c index 9ecf64c7d9..ceb0374b78 100644 --- a/coregrind/m_debuginfo/readmacho.c +++ b/coregrind/m_debuginfo/readmacho.c @@ -369,6 +369,7 @@ void read_symtab( /*OUT*/XArray* /* DiSym */ syms, di->text_avma+di->text_size - sym_addr; risym.name = ML_(addStr)(di, name, -1); risym.isText = True; + risym.isIFunc = False; // Lots of user function names get prepended with an underscore. Eg. the // function 'f' becomes the symbol '_f'. And the "below main" // function is called "start". So we skip the leading underscore, and diff --git a/coregrind/m_debuginfo/readpdb.c b/coregrind/m_debuginfo/readpdb.c index 2eae5da753..82d6a5e41e 100644 --- a/coregrind/m_debuginfo/readpdb.c +++ b/coregrind/m_debuginfo/readpdb.c @@ -1273,6 +1273,7 @@ static ULong DEBUG_SnarfCodeView( vsym.size = sym->data_v1.p_name.namelen; // FIXME: .namelen is sizeof(.data) including .name[] vsym.isText = (sym->generic.id == S_PUB_V1); + vsym.isIFunc = False; ML_(addSym)( di, &vsym ); n_syms_read++; } @@ -1299,6 +1300,7 @@ static ULong DEBUG_SnarfCodeView( // not size of function! vsym.isText = !!(IMAGE_SCN_CNT_CODE & sectp[sym->data_v2.segment-1].Characteristics); + vsym.isIFunc = False; ML_(addSym)( di, &vsym ); n_syms_read++; } @@ -1331,6 +1333,7 @@ static ULong DEBUG_SnarfCodeView( // .text of the function vsym.isText = !!(IMAGE_SCN_CNT_CODE & sectp[sym->data_v2.segment-1].Characteristics); + vsym.isIFunc = False; ML_(addSym)( di, &vsym ); n_syms_read++; } @@ -1362,6 +1365,7 @@ static ULong DEBUG_SnarfCodeView( vsym.name = nmstr; vsym.size = sym->proc_v1.proc_len; vsym.isText = True; + vsym.isIFunc = False; if (debug) VG_(message)(Vg_UserMsg, "Adding function %s addr=%#lx length=%d\n", @@ -1382,6 +1386,7 @@ static ULong DEBUG_SnarfCodeView( vsym.name = nmstr; vsym.size = sym->proc_v2.proc_len; vsym.isText = True; + vsym.isIFunc = False; if (debug) VG_(message)(Vg_UserMsg, "Adding function %s addr=%#lx length=%d\n", @@ -1404,6 +1409,7 @@ static ULong DEBUG_SnarfCodeView( vsym.name = nmstr; vsym.size = sym->proc_v3.proc_len; vsym.isText = 1; + vsym.isIFunc = False; ML_(addSym)( di, &vsym ); n_syms_read++; } diff --git a/coregrind/m_debuginfo/readxcoff.c b/coregrind/m_debuginfo/readxcoff.c index 466e423422..3ce209a768 100644 --- a/coregrind/m_debuginfo/readxcoff.c +++ b/coregrind/m_debuginfo/readxcoff.c @@ -1521,10 +1521,11 @@ HChar* read_symbol_table ( /* Actually add the symbol (finallyatlast) */ if (sane) { UInt nlen; - dis.addr = addr; - dis.size = size; - dis.tocptr = s->r2known ? s->r2value : 0; - dis.isText = True; + dis.addr = addr; + dis.size = size; + dis.tocptr = s->r2known ? s->r2value : 0; + dis.isText = True; + dis.isIFunc = False; vg_assert(!is_empty_Name(s->name)); nlen = s->name.len; vg_assert(nlen > 0); -- 2.47.2