From 0ce08aaa26ecf9c7f00f6acc1e1441ad0963465f Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 18 Apr 2012 21:48:20 -0400 Subject: [PATCH] PR13992: let stap tolerate -d /foo/bad/path --ldd argument * translate.cxx (add_unwindsym_ldd): Skip unresolvable path that results in skeleton dwflpp. We'll get a warning later. * testsuite/transok/eleven.stp: New test case. --- testsuite/transok/eleven.stp | 3 +++ translate.cxx | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 testsuite/transok/eleven.stp diff --git a/testsuite/transok/eleven.stp b/testsuite/transok/eleven.stp new file mode 100755 index 000000000..7fb8e9869 --- /dev/null +++ b/testsuite/transok/eleven.stp @@ -0,0 +1,3 @@ +#! /bin/sh + +stap -p3 -d /zoo/poo/in/the/loo --ldd -e 'probe begin {exit()}' >/dev/null diff --git a/translate.cxx b/translate.cxx index c2a79dbac..68b8105ac 100644 --- a/translate.cxx +++ b/translate.cxx @@ -6200,8 +6200,12 @@ add_unwindsym_ldd (systemtap_session &s) if (! is_user_module (modname)) continue; struct dwflpp *mod_dwflpp = new dwflpp(s, modname, false); - mod_dwflpp->iterate_over_modules(&query_module, mod_dwflpp); - mod_dwflpp->iterate_over_libraries (&add_unwindsym_iol_callback, &added); + if (mod_dwflpp->module) // existing binary + { + assert (mod_dwflpp->module_name != ""); + mod_dwflpp->iterate_over_modules (&query_module, mod_dwflpp); + mod_dwflpp->iterate_over_libraries (&add_unwindsym_iol_callback, &added); + } delete mod_dwflpp; } -- 2.43.5