diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-11-13 13:39:24 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-11-13 13:45:46 +0100 |
commit | f6ac00e8c648759ac70f290b90c4f369e72dd623 (patch) | |
tree | aa26fc5993a715b85a34a7f4146230f65a8a35fd /main.cxx | |
parent | 5f1af961c261c83fa79ae656a2e14c08b1194596 (diff) | |
download | systemtap-steved-f6ac00e8c648759ac70f290b90c4f369e72dd623.tar.gz systemtap-steved-f6ac00e8c648759ac70f290b90c4f369e72dd623.tar.xz systemtap-steved-f6ac00e8c648759ac70f290b90c4f369e72dd623.zip |
Accept relative user module paths for -d.
When using relative (non-canonical) paths for user modules one would get
a confusing WARNING: missing unwind/symbol data for module 'bin/test'.
Also unless the path started with '/' the task_finder wouldn't start.
By checking that the given file can be made absolute (canonicalized)
both issues are resolved and the user module will be correctly identified
at both translation and runtime.
* main.cxx (main): case 'd' try canonicalize_file_name() the argument
first to identify user modules.
Diffstat (limited to 'main.cxx')
-rw-r--r-- | main.cxx | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -676,11 +676,19 @@ main (int argc, char * const argv []) break; case 'd': - s.unwindsym_modules.insert (string (optarg)); - // PR10228: trigger task-finder logic early if -d /USER-MODULE/ given. - if (optarg[0] == '/') - enable_task_finder (s); - break; + { + // At runtime user module names are resolved through their + // canonical (absolute) path. + const char *mpath = canonicalize_file_name (optarg); + if (mpath == NULL) // Must be a kernel module name + mpath = optarg; + s.unwindsym_modules.insert (string (mpath)); + // PR10228: trigger task-finder logic early if -d /USER-MODULE/ + // given. + if (mpath[0] == '/') + enable_task_finder (s); + break; + } case 'e': if (have_script) |