|
From: <sv...@va...> - 2008-05-22 14:25:59
|
Author: bart
Date: 2008-05-22 15:26:00 +0100 (Thu, 22 May 2008)
New Revision: 8117
Log:
Make sure the filename is printed when reading the ELF header fails.
Modified:
branches/CROSS_COMPILATION/coregrind/m_debuginfo/debuginfo.c
Modified: branches/CROSS_COMPILATION/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- branches/CROSS_COMPILATION/coregrind/m_debuginfo/debuginfo.c 2008-05-21 16:34:35 UTC (rev 8116)
+++ branches/CROSS_COMPILATION/coregrind/m_debuginfo/debuginfo.c 2008-05-22 14:26:00 UTC (rev 8117)
@@ -538,9 +538,9 @@
VG_(memset)(buf1k, 0, sizeof(buf1k));
fd = VG_(open)( filename, VKI_O_RDONLY, 0 );
if (fd.isError) {
- DebugInfo fake_di;
if (fd.err != VKI_EACCES)
{
+ DebugInfo fake_di;
VG_(memset)(&fake_di, 0, sizeof(fake_di));
fake_di.filename = filename;
ML_(symerr)(&fake_di, True, "can't open file to inspect ELF header");
@@ -551,7 +551,10 @@
VG_(close)( fd.res );
if (nread <= 0) {
- ML_(symerr)(NULL, True, "can't read file to inspect ELF header");
+ DebugInfo fake_di;
+ VG_(memset)(&fake_di, 0, sizeof(fake_di));
+ fake_di.filename = filename;
+ ML_(symerr)(&fake_di, True, "can't read file to inspect ELF header");
return;
}
vg_assert(nread > 0 && nread <= sizeof(buf1k) );
|