2 * Copyright 2009-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
16 looks_like_gcc3_symbol(const char* symbol
)
18 return strncmp(symbol
, "_Z", 2) == 0;
23 demangle_symbol(const char* mangledName
, char* buffer
, size_t bufferSize
,
24 bool* _isObjectMethod
)
26 // try the gcc3 demangler, if it looks like a gcc3 symbol
27 const char* demangled
= NULL
;
28 if (looks_like_gcc3_symbol(mangledName
)) {
29 demangled
= demangle_symbol_gcc3(mangledName
, buffer
, bufferSize
,
31 if (demangled
!= NULL
)
36 return demangle_symbol_gcc2(mangledName
, buffer
, bufferSize
,
42 get_next_argument(uint32
* _cookie
, const char* mangledName
, char* name
,
43 size_t nameSize
, int32
* _type
, size_t* _argumentLength
)
45 // try the gcc3 demangler, if it looks like a gcc3 symbol
46 if (looks_like_gcc3_symbol(mangledName
)) {
47 status_t error
= get_next_argument_gcc3(_cookie
, mangledName
, name
,
48 nameSize
, _type
, _argumentLength
);
54 return get_next_argument_gcc2(_cookie
, mangledName
, name
, nameSize
, _type
,
62 std_ops(int32 op
, ...)
74 static struct debugger_demangle_module_info sModuleInfo
= {
76 "debugger/demangle/v1",
85 module_info
* modules
[] = {
86 (module_info
*)&sModuleInfo
,
90 #endif // _KERNEL_MODE