]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
If we don't find the address in the segInfo list that ask the address
authorTom Hughes <tom@compton.nu>
Tue, 8 Jan 2008 17:44:04 +0000 (17:44 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 8 Jan 2008 17:44:04 +0000 (17:44 +0000)
space manager for the name of the file it was mapped from as a fallback
solution.

This allows us to print the names of exe/dll files in the stack trace
when running programs under wine.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7327

coregrind/m_debuginfo/debuginfo.c

index ea14c082e4ee6cc481faba5509b523762efa5347..d635db1be1e3b940bad466687e5c290cb702f317 100644 (file)
@@ -659,6 +659,8 @@ Bool VG_(get_objname) ( Addr a, Char* buf, Int nbuf )
 {
    Int used;
    SegInfo* si;
+   const NSegment *seg;
+   HChar* filename;
 
    vg_assert(nbuf > 0);
    for (si = segInfo_list; si != NULL; si = si->next) {
@@ -680,6 +682,12 @@ Bool VG_(get_objname) ( Addr a, Char* buf, Int nbuf )
          return True;
       }
    }
+   if ((seg = VG_(am_find_nsegment(a))) != NULL &&
+       (filename = VG_(am_get_filename)(seg)) != NULL)
+   {
+      VG_(strncpy_safely)(buf, filename, nbuf);
+      return True;
+   }
    return False;
 }