File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ EXTRA_DIST = \
1010 ann1.post.exp ann1.stderr.exp ann1.vgtest \
1111 ann2.post.exp ann2.stderr.exp ann2.vgtest \
1212 clreq.vgtest clreq.stderr.exp \
13+ find_debuginfo.vgtest find_debuginfo.stderr.exp find_debuginfo.post.exp \
1314 runtime_obj_skip_py.vgtest runtime_obj_skip_py.stderr.exp runtime_obj_skip_py.post.exp \
1415 runtime_obj_skip_py.py runtime_obj_skip_py_shim.c \
1516 bug497723.stderr.exp bug497723.post.exp bug497723.vgtest \
@@ -30,7 +31,7 @@ EXTRA_DIST = \
3031 inline-crossfile.vgtest inline-crossfile.stderr.exp inline-crossfile.stdout.exp inline-crossfile.post.exp \
3132 inline-crossfile-helper1.h inline-crossfile-helper2.h filter_inline
3233
33- check_PROGRAMS = clreq simwork threads inline-samefile inline-crossfile
34+ check_PROGRAMS = clreq find_debuginfo simwork threads inline-samefile inline-crossfile
3435
3536AM_CFLAGS += $(AM_FLAG_M3264_PRI )
3637AM_CXXFLAGS += $(AM_FLAG_M3264_PRI )
Original file line number Diff line number Diff line change 1+ /* Exercise VG_(find_DebugInfo) including the filename fallback for
2+ executable code that lives outside the section named ".text".
3+
4+ Functions placed in orphan sections "warm_code" and "cold_code" end up
5+ in their own ELF sections (PROGBITS, AX) inside the same R-E LOAD as
6+ .text but *outside* di->text_avma/text_size. Calls into them force
7+ VG_(find_DebugInfo) past the primary text-range check and into the
8+ am_find_nsegment + filename match path added in commit 938e424b1. */
9+
10+ static int hot_fn (int x ) { return x + 1 ; }
11+
12+ __attribute__((noinline , section ("warm_code" )))
13+ static int warm_fn (int x ) { return x * 3 + 7 ; }
14+
15+ __attribute__((noinline , section ("cold_code" )))
16+ static int cold_fn (int x ) { return x ^ 0x5a ; }
17+
18+ int main (void )
19+ {
20+ int y = 0 ;
21+ for (int i = 0 ; i < 1000 ; i ++ )
22+ y = hot_fn (y );
23+ y = warm_fn (y );
24+ y = cold_fn (y );
25+ return y & 0xff ;
26+ }
Original file line number Diff line number Diff line change 1+ find_debuginfo
2+ ld-linux-x86-64.so.2
3+ libc.so.6
Original file line number Diff line number Diff line change 1+
2+
3+ Events : Ir
4+ Collected :
5+
6+ I refs:
Original file line number Diff line number Diff line change 1+ prog: find_debuginfo
2+ vgopts: --compress-strings=no --callgrind-out-file=callgrind.out.find_debuginfo
3+ post: sh -c 'sed -n "s|^ob=.*/||p" callgrind.out.find_debuginfo | grep -v "^vgpreload" | sort -u'
4+ cleanup: rm -f callgrind.out.find_debuginfo
You can’t perform that action at this time.
0 commit comments