Added demangling support. Only implemented for gcc 4 yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31146 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8cd32d5b06
commit
cba4143217
@ -16,6 +16,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) model ] ;
|
||||
local debugAnalyzerSources
|
||||
= [ FDirName $(HAIKU_TOP) src apps debuganalyzer ] ;
|
||||
|
||||
SubDirHdrs [ FDirName $(SUBDIR) demangler ] ;
|
||||
SubDirHdrs [ FDirName $(HAIKU_TOP) src bin debug ] ;
|
||||
SubDirHdrs [ FDirName $(debugAnalyzerSources) gui ] ;
|
||||
|
||||
@ -75,6 +76,7 @@ Application Debugger :
|
||||
# tag_names.cpp
|
||||
|
||||
:
|
||||
<nogrist>Debugger_demangler.o
|
||||
<nogrist>DebugAnalyzer_gui_table.o
|
||||
|
||||
<bin>debug_utils.a
|
||||
@ -87,4 +89,5 @@ Application Debugger :
|
||||
: Debugger.rdef
|
||||
;
|
||||
|
||||
HaikuSubInclude demangler ;
|
||||
HaikuSubInclude gui running_teams_window ;
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "BasicFunctionDebugInfo.h"
|
||||
#include "DebuggerInterface.h"
|
||||
#include "Demangler.h"
|
||||
#include "SymbolInfo.h"
|
||||
|
||||
|
||||
@ -72,8 +73,8 @@ DebuggerDebugInfo::FindFunction(target_addr_t address)
|
||||
return NULL;
|
||||
|
||||
return new(std::nothrow) BasicFunctionDebugInfo(this, symbolInfo->Address(),
|
||||
symbolInfo->Size(), symbolInfo->Name(), symbolInfo->Name());
|
||||
// TODO: Demangle!
|
||||
symbolInfo->Size(), symbolInfo->Name(),
|
||||
Demangler::Demangle(symbolInfo->Name()));
|
||||
}
|
||||
|
||||
|
||||
|
25
src/apps/debugger/demangler/Demangler.cpp
Normal file
25
src/apps/debugger/demangler/Demangler.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
#include "Demangler.h"
|
||||
|
||||
#include "demangle.h"
|
||||
|
||||
|
||||
/*static*/ BString
|
||||
Demangler::Demangle(const BString& mangledName)
|
||||
{
|
||||
char buffer[1024];
|
||||
if (mangledName.Compare("_Z", 2) == 0) {
|
||||
const char* demangled = demangle_name_gcc3(mangledName.String(), buffer,
|
||||
sizeof(buffer));
|
||||
if (demangled != NULL)
|
||||
return demangled;
|
||||
}
|
||||
|
||||
// TODO: gcc2 demangling!
|
||||
|
||||
return mangledName;
|
||||
}
|
17
src/apps/debugger/demangler/Demangler.h
Normal file
17
src/apps/debugger/demangler/Demangler.h
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef DEMANGLER_H
|
||||
#define DEMANGLER_H
|
||||
|
||||
#include <String.h>
|
||||
|
||||
|
||||
class Demangler {
|
||||
public:
|
||||
static BString Demangle(const BString& mangledName);
|
||||
};
|
||||
|
||||
|
||||
#endif // DEMANGLER_H
|
17
src/apps/debugger/demangler/Jamfile
Normal file
17
src/apps/debugger/demangler/Jamfile
Normal file
@ -0,0 +1,17 @@
|
||||
SubDir HAIKU_TOP src apps debugger demangler ;
|
||||
|
||||
CCFLAGS += -Werror ;
|
||||
C++FLAGS += -Werror ;
|
||||
|
||||
UsePrivateHeaders kernel ;
|
||||
|
||||
SEARCH_SOURCE
|
||||
+= [ FDirName $(HAIKU_TOP) src add-ons kernel debugger demangle ] ;
|
||||
|
||||
|
||||
MergeObject Debugger_demangler.o
|
||||
:
|
||||
Demangler.cpp
|
||||
|
||||
gcc3+.cpp
|
||||
;
|
Loading…
Reference in New Issue
Block a user