From 7413cddee672f653c2fedf421c6bfa9f8a3d5467 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 30 Jun 2009 14:35:00 +0000 Subject: [PATCH] Add the compilation unit's compilation dir to the directories for the compilation unit. It can be referenced by the file entries in the line info header, too (index 0). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31331 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/dwarf/DwarfFile.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/dwarf/DwarfFile.cpp b/src/apps/debugger/dwarf/DwarfFile.cpp index 183d697e8f..f6249d895c 100644 --- a/src/apps/debugger/dwarf/DwarfFile.cpp +++ b/src/apps/debugger/dwarf/DwarfFile.cpp @@ -398,6 +398,12 @@ printf("entry %p at %lu\n", entry, offset); } } + // add compilation dir to directory list + const char* compilationDir = unit->UnitEntry()->CompilationDir(); + if (!unit->AddDirectory(compilationDir != NULL ? compilationDir : ".")) + return B_NO_MEMORY; + + // parse line info header if (fDebugLineSection != NULL) _ParseLineInfo(unit); @@ -692,7 +698,7 @@ printf("DwarfFile::_ParseLineInfo(%p), offset: %lu\n", unit, offset); printf(" \"%s\", dir index: %llu, mtime: %llu, length: %llu\n", file, dirIndex, modificationTime, fileLength); - if (!unit->AddFile(file, dirIndex - 1)) + if (!unit->AddFile(file, dirIndex)) return B_NO_MEMORY; }