From b619e1873c590f340c23ae615947a26418aec6c1 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 3 Jul 2009 09:39:42 +0000 Subject: [PATCH] Changed the line and column parameter of DwarfUtils::GetDeclarationLocation() to int32&. The DWARF indices are one-based with 0 as invalid/no value, but we subtract one to get real indices and -1 as special value. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31384 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp | 4 ++-- src/apps/debugger/dwarf/DwarfUtils.cpp | 6 +++--- src/apps/debugger/dwarf/DwarfUtils.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp b/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp index 4bb44425f7..f56516a18c 100644 --- a/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp +++ b/src/apps/debugger/debug_info/DwarfImageDebugInfo.cpp @@ -229,8 +229,8 @@ printf(" %ld compilation units\n", fFile->CountCompilationUnits()); // get the source location const char* directoryPath = NULL; const char* fileName = NULL; - uint32 line = ~0U; - uint32 column = ~0U; + int32 line = -1; + int32 column = -1; DwarfUtils::GetDeclarationLocation(fFile, subprogramEntry, directoryPath, fileName, line, column); diff --git a/src/apps/debugger/dwarf/DwarfUtils.cpp b/src/apps/debugger/dwarf/DwarfUtils.cpp index bd7c39d46f..b46b543f61 100644 --- a/src/apps/debugger/dwarf/DwarfUtils.cpp +++ b/src/apps/debugger/dwarf/DwarfUtils.cpp @@ -85,7 +85,7 @@ DwarfUtils::GetFullyQualifiedDIEName(const DebugInfoEntry* entry, /*static*/ bool DwarfUtils::GetDeclarationLocation(DwarfFile* dwarfFile, const DebugInfoEntry* entry, const char*& _directory, const char*& _file, - uint32& _line, uint32& _column) + int32& _line, int32& _column) { uint32 file; uint32 line; @@ -128,7 +128,7 @@ DwarfUtils::GetDeclarationLocation(DwarfFile* dwarfFile, _directory = directoryName; _file = fileName; - _line = line - 1; - _column = column - 1; + _line = (int32)line - 1; + _column = (int32)column - 1; return true; } diff --git a/src/apps/debugger/dwarf/DwarfUtils.h b/src/apps/debugger/dwarf/DwarfUtils.h index 9d5e794d27..e0da2323fe 100644 --- a/src/apps/debugger/dwarf/DwarfUtils.h +++ b/src/apps/debugger/dwarf/DwarfUtils.h @@ -27,7 +27,7 @@ public: const DebugInfoEntry* entry, const char*& _directory, const char*& _file, - uint32& _line, uint32& _column); + int32& _line, int32& _column); };