|
From: <sv...@va...> - 2012-12-05 22:15:22
|
sewardj 2012-12-05 22:15:14 +0000 (Wed, 05 Dec 2012)
New Revision: 13154
Log:
Add a new command line flag, --extra-debuginfo-path=path, that allows
specification of an extra directory in which to look for debuginfo
objects. Fixes #310792. (Alex Chiang, ac...@ca...)
Modified files:
trunk/coregrind/m_debuginfo/readelf.c
trunk/coregrind/m_main.c
trunk/coregrind/m_options.c
trunk/coregrind/pub_core_options.h
trunk/none/tests/cmdline1.stdout.exp
trunk/none/tests/cmdline2.stdout.exp
Modified: trunk/coregrind/m_debuginfo/readelf.c (+10 -1)
===================================================================
--- trunk/coregrind/m_debuginfo/readelf.c 2012-12-05 21:08:24 +00:00 (rev 13153)
+++ trunk/coregrind/m_debuginfo/readelf.c 2012-12-05 22:15:14 +00:00 (rev 13154)
@@ -1212,6 +1212,7 @@
/*OUT*/SizeT* n_dimage )
{
HChar* debugpath = NULL;
+ HChar* extrapath = VG_(clo_extra_debuginfo_path);
Addr addr = 0;
UWord size = 0;
@@ -1241,7 +1242,8 @@
debugpath = ML_(dinfo_zalloc)(
"di.fdf.3",
- VG_(strlen)(objdir) + VG_(strlen)(debugname) + 32);
+ VG_(strlen)(objdir) + VG_(strlen)(debugname) + 32 +
+ (extrapath ? VG_(strlen)(extrapath) : 0));
VG_(sprintf)(debugpath, "%s/%s", objdir, debugname);
@@ -1250,6 +1252,13 @@
if ((addr = open_debug_file(debugpath, NULL, crc, rel_ok, &size)) == 0) {
VG_(sprintf)(debugpath, "/usr/lib/debug%s/%s", objdir, debugname);
addr = open_debug_file(debugpath, NULL, crc, rel_ok, &size);
+ if ((addr = open_debug_file(debugpath, NULL, crc, rel_ok, &size)) == 0) {
+ if (extrapath) {
+ VG_(sprintf)(debugpath, "%s%s/%s", extrapath,
+ objdir, debugname);
+ addr = open_debug_file(debugpath, NULL, crc, rel_ok, &size);
+ }
+ }
}
}
Modified: trunk/coregrind/pub_core_options.h (+3 -0)
===================================================================
--- trunk/coregrind/pub_core_options.h 2012-12-05 21:08:24 +00:00 (rev 13153)
+++ trunk/coregrind/pub_core_options.h 2012-12-05 22:15:14 +00:00 (rev 13154)
@@ -126,6 +126,9 @@
extern Int VG_(clo_n_fullpath_after);
extern const HChar* VG_(clo_fullpath_after)[VG_CLO_MAX_FULLPATH_AFTER];
+/* Full path to additional path to search for debug symbols */
+extern HChar* VG_(clo_extra_debuginfo_path);
+
/* DEBUG: print generated code? default: 00000000 ( == NO ) */
extern UChar VG_(clo_trace_flags);
/* DEBUG: do bb profiling? default: 00000000 ( == NO ) */
Modified: trunk/coregrind/m_main.c (+6 -0)
===================================================================
--- trunk/coregrind/m_main.c 2012-12-05 21:08:24 +00:00 (rev 13153)
+++ trunk/coregrind/m_main.c 2012-12-05 22:15:14 +00:00 (rev 13154)
@@ -172,6 +172,9 @@
" part of the path after 'string'. Allows removal\n"
" of path prefixes. Use this flag multiple times\n"
" to specify a set of prefixes to remove.\n"
+" --extra-debuginfo-path=path absolute path to search for additional\n"
+" debug symbols, in addition to existing default\n"
+" well known search paths.\n"
" --smc-check=none|stack|all|all-non-file [stack]\n"
" checks for self-modifying code: none, only for\n"
" code found in stacks, for all code, or for all\n"
@@ -678,6 +681,9 @@
VG_(clo_n_fullpath_after)++;
}
+ else if VG_STR_CLO (arg, "--extra-debuginfo-path",
+ VG_(clo_extra_debuginfo_path)) {}
+
else if VG_STR_CLO(arg, "--require-text-symbol", tmp_str) {
if (VG_(clo_n_req_tsyms) >= VG_CLO_MAX_REQ_TSYMS) {
VG_(fmsg_bad_option)(arg,
Modified: trunk/none/tests/cmdline1.stdout.exp (+3 -0)
===================================================================
--- trunk/none/tests/cmdline1.stdout.exp 2012-12-05 21:08:24 +00:00 (rev 13153)
+++ trunk/none/tests/cmdline1.stdout.exp 2012-12-05 22:15:14 +00:00 (rev 13154)
@@ -61,6 +61,9 @@
part of the path after 'string'. Allows removal
of path prefixes. Use this flag multiple times
to specify a set of prefixes to remove.
+ --extra-debuginfo-path=path absolute path to search for additional
+ debug symbols, in addition to existing default
+ well known search paths.
--smc-check=none|stack|all|all-non-file [stack]
checks for self-modifying code: none, only for
code found in stacks, for all code, or for all
Modified: trunk/coregrind/m_options.c (+1 -0)
===================================================================
--- trunk/coregrind/m_options.c 2012-12-05 21:08:24 +00:00 (rev 13153)
+++ trunk/coregrind/m_options.c 2012-12-05 22:15:14 +00:00 (rev 13154)
@@ -79,6 +79,7 @@
const HChar* VG_(clo_suppressions)[VG_CLO_MAX_SFILES];
Int VG_(clo_n_fullpath_after) = 0;
const HChar* VG_(clo_fullpath_after)[VG_CLO_MAX_FULLPATH_AFTER];
+HChar* VG_(clo_extra_debuginfo_path) = NULL;
UChar VG_(clo_trace_flags) = 0; // 00000000b
UChar VG_(clo_profile_flags) = 0; // 00000000b
Int VG_(clo_trace_notbelow) = -1; // unspecified
Modified: trunk/none/tests/cmdline2.stdout.exp (+3 -0)
===================================================================
--- trunk/none/tests/cmdline2.stdout.exp 2012-12-05 21:08:24 +00:00 (rev 13153)
+++ trunk/none/tests/cmdline2.stdout.exp 2012-12-05 22:15:14 +00:00 (rev 13154)
@@ -61,6 +61,9 @@
part of the path after 'string'. Allows removal
of path prefixes. Use this flag multiple times
to specify a set of prefixes to remove.
+ --extra-debuginfo-path=path absolute path to search for additional
+ debug symbols, in addition to existing default
+ well known search paths.
--smc-check=none|stack|all|all-non-file [stack]
checks for self-modifying code: none, only for
code found in stacks, for all code, or for all
|