]> sourceware.org Git - systemtap.git/commitdiff
Improve dwflpp::emit_address internal error message.
authorMark Wielaard <mjw@redhat.com>
Thu, 24 Jun 2010 19:00:56 +0000 (21:00 +0200)
committerMark Wielaard <mjw@redhat.com>
Thu, 24 Jun 2010 19:00:56 +0000 (21:00 +0200)
* dwflpp.cxx (dwflpp::emit_address): Be more explicit about context and
  what failed in case of internal error.

dwflpp.cxx

index 582152c9d3fc1da5d9bed521417a72887bf675da..d73e177da2141cb88ae406e6772e935c16626f27 100644 (file)
@@ -1543,8 +1543,21 @@ dwflpp::emit_address (struct obstack *pool, Dwarf_Addr address)
   // Turn this address into a section-relative offset if it should be one.
   // We emit a comment approximating the variable+offset expression that
   // relocatable module probing code will need to have.
-  Dwfl_Module *mod = dwfl_addrmodule (dwfl_ptr.get()->dwfl, address);
-  dwfl_assert ("dwfl_addrmodule", mod);
+  Dwfl *dwfl = dwfl_ptr.get()->dwfl;
+  if (! dwfl)
+    throw semantic_error ("emit_address internal error, no dwfl");
+
+  Dwfl_Module *mod = dwfl_addrmodule (dwfl, address);
+  if (! mod)
+    {
+      ostringstream msg;
+      msg << "emit_address internal error, dwfl_addrmodule failed, "
+            "address 0x" << hex << address << dec;
+      const char *err = dwfl_errmsg(0);
+      if (err)
+       msg << " (" << err << ")";
+      throw semantic_error (msg.str());
+    }
   const char *modname = dwfl_module_info (mod, NULL, NULL, NULL,
                                               NULL, NULL, NULL, NULL);
   int n = dwfl_module_relocations (mod);
This page took 0.031821 seconds and 5 git commands to generate.