From f4ee2d048e0d4e754b94ec1e5c271c2d3ecf96ec Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 28 May 2012 15:48:00 -0400 Subject: [PATCH] Slight and cleanup and fix potential section leak. --- src/apps/debugger/dwarf/DwarfFile.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/apps/debugger/dwarf/DwarfFile.cpp b/src/apps/debugger/dwarf/DwarfFile.cpp index d4cb185c49..49b5a9c6da 100644 --- a/src/apps/debugger/dwarf/DwarfFile.cpp +++ b/src/apps/debugger/dwarf/DwarfFile.cpp @@ -351,14 +351,13 @@ DwarfFile::Load(const char* fileName) fDebugLineSection = fElfFile->GetSection(".debug_line"); fDebugFrameSection = fElfFile->GetSection(".debug_frame"); ElfSection* ehFrameSection = fElfFile->GetSection(".eh_frame"); - if (fDebugFrameSection != NULL) { - if (ehFrameSection != NULL && ehFrameSection->Size() - > fDebugFrameSection->Size()) { + if (fDebugFrameSection != NULL && ehFrameSection != NULL) { + if (ehFrameSection->Size() > fDebugFrameSection->Size()) { fElfFile->PutSection(fDebugFrameSection); fDebugFrameSection = ehFrameSection; fUsingEHFrameSection = true; - } - + } else + fElfFile->PutSection(ehFrameSection); } else if (ehFrameSection != NULL) { fDebugFrameSection = ehFrameSection; fUsingEHFrameSection = true; @@ -370,6 +369,7 @@ DwarfFile::Load(const char* fileName) // .eh_frame sections. The ones generated by GCC 2 are writable, // the ones generated by GCC 4 aren't. } + fDebugLocationSection = fElfFile->GetSection(".debug_loc"); fDebugPublicTypesSection = fElfFile->GetSection(".debug_pubtypes");