aboutsummaryrefslogtreecommitdiff
path: root/gprofng/src
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2025-04-18 14:00:59 -0700
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2025-04-21 22:09:10 -0700
commit377d832881f598eaac1baa58b66a44ab6371ff0a (patch)
treefc2bbafc5635bc71b85ee7eb376607792fcc43bd /gprofng/src
parentd42db22aa54876e12f93d85f33a9dcc00d31c5b4 (diff)
downloadbinutils-377d832881f598eaac1baa58b66a44ab6371ff0a.zip
binutils-377d832881f598eaac1baa58b66a44ab6371ff0a.tar.gz
binutils-377d832881f598eaac1baa58b66a44ab6371ff0a.tar.bz2
gprofng: fix 32886 wrong mapping from instruction to line number
On Intel, gprofng should adjusts return addresses, including user leaf functions. gprofng/ChangeLog 2025-04-18 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * src/CallStack.cc (add_stack): Adjust return addresses on Intel.
Diffstat (limited to 'gprofng/src')
-rw-r--r--gprofng/src/CallStack.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/gprofng/src/CallStack.cc b/gprofng/src/CallStack.cc
index 6df4112..9a3a15d 100644
--- a/gprofng/src/CallStack.cc
+++ b/gprofng/src/CallStack.cc
@@ -527,14 +527,10 @@ CallStackP::add_stack (DataDescriptor *dDscr, long idx, FramePacket *frp,
Vaddr va = frp->getFromStack (index);
DbeInstr *cur_instr = experiment->map_Vaddr_to_PC (va, tstamp);
-#if ARCH(Intel)// TBR? FIXUP_XXX_SPARC_LINUX: switch should be on experiment ARCH, not dbe ARCH
// We need to adjust return addresses on intel
- // in order to attribute inclusive metrics to
- // proper call instructions.
- if (experiment->exp_maj_version <= 9)
- if (!leaf && cur_instr->addr != 0)
- cur_instr = cur_instr->func->find_dbeinstr (0, cur_instr->addr - 1);
-#endif
+ // in order to attribute inclusive metrics to proper instructions.
+ if (experiment->platform == Intel && cur_instr->addr != 0)
+ cur_instr = cur_instr->func->find_dbeinstr (0, cur_instr->addr - 1);
// Skip PC's from PLT, update leaf and state accordingly
if ((cur_instr->func->flags & FUNC_FLAG_PLT)