From: Tom Hughes Date: Tue, 8 Jan 2008 17:44:04 +0000 (+0000) Subject: If we don't find the address in the segInfo list that ask the address X-Git-Tag: svn/VALGRIND_3_4_0~1107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b67822d578a9eedcf10ebdbeb7a8da1c6984f1c3;p=thirdparty%2Fvalgrind.git If we don't find the address in the segInfo list that ask the address 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 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index ea14c082e4..d635db1be1 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -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; }