summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwflpp.cxx19
-rw-r--r--dwflpp.h2
2 files changed, 4 insertions, 17 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index 1a589771..74294384 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -84,15 +84,6 @@ dwflpp::~dwflpp()
}
-string const
-dwflpp::default_name(char const * in, char const *)
-{
- if (in)
- return in;
- return string("");
-}
-
-
void
dwflpp::get_module_dwarf(bool required, bool report)
{
@@ -129,10 +120,8 @@ dwflpp::focus_on_module(Dwfl_Module * m, module_info * mi)
mod_info = mi;
if (m)
{
- module_name = default_name(dwfl_module_info(module, NULL,
- &module_start, &module_end,
- NULL, NULL, NULL, NULL),
- "module");
+ module_name = dwfl_module_info(module, NULL, &module_start, &module_end,
+ NULL, NULL, NULL, NULL) ?: "module";
}
else
{
@@ -162,7 +151,7 @@ dwflpp::focus_on_cu(Dwarf_Die * c)
assert(module);
cu = c;
- cu_name = default_name(dwarf_diename(c), "CU");
+ cu_name = dwarf_diename(c) ?: "CU";
// Reset existing pointers and names
function_name.clear();
@@ -181,7 +170,7 @@ dwflpp::focus_on_function(Dwarf_Die * f)
assert(cu);
function = f;
- function_name = default_name(dwarf_diename(function), "function");
+ function_name = dwarf_diename(function) ?: "function";
}
diff --git a/dwflpp.h b/dwflpp.h
index 314e7583..9cd2cb59 100644
--- a/dwflpp.h
+++ b/dwflpp.h
@@ -289,8 +289,6 @@ private:
Dwarf * module_dwarf;
Dwarf_Die * function;
- std::string const default_name(char const * in, char const *);
-
void setup_kernel(bool debuginfo_needed = true);
void setup_user(const std::string& module_name, bool debuginfo_needed = true);