This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: add simple .library syntax


util.cxx (find_executable): Add env_path to signature for searching LD_LIBRARY_PATH for a .so


--- a/util.cxx +++ b/util.cxx @@ -215,3 +214,3 @@ tokenize(const string& str, vector<string>& tokens, -string find_executable(const string& name) +string find_executable(const string& name, const string& env_path) { @@ -230,3 +229,3 @@ string find_executable(const string& name) { - char *path = getenv("PATH"); + char *path = getenv(env_path.c_str()); if (path)

--- a/util.h
+++ b/util.h
@@ -16,3 +16,4 @@ void tokenize(const std::string& str, std::vector<std::string>& tokens,
const std::string& delimiters);
-std::string find_executable(const std::string& name);
+std::string find_executable(const std::string& name,
+ const std::string& env_path = "PATH");
const std::string cmdstr_quoted(const std::string& cmd);


--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -480,3 +485,12 @@ base_query::base_query(dwflpp & dw, literal_map_t const & params):
{
+ string library_name;
has_process = get_string_param(params, TOK_PROCESS, module_val);
+ if (get_string_param (params, TOK_LIBRARY, library_name))
+ {
+ has_library = true;
+ path = find_executable (module_val);
+ module_val = find_executable (library_name, "LD_LIBRARY_PATH");


--- a/tapset-utrace.cxx
+++ b/tapset-utrace.cxx
@@ -649,5 +654,7 @@ struct utrace_builder: public derived_probe_builder
       }
+    if (has_lib)
+      lib = find_executable (lib, "LD_LIBRARY_PATH");



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]