mirror of
https://github.com/QuasarApp/backward-cpp.git
synced 2025-04-30 04:14:30 +00:00
After review pr#66
This commit is contained in:
parent
dd552a10c8
commit
e1bf45fd0c
24
backward.hpp
24
backward.hpp
@ -752,23 +752,17 @@ public:
|
||||
while (*funcname && *funcname != '(') {
|
||||
funcname += 1;
|
||||
}
|
||||
trace.object_filename.assign(filename, funcname); // it is ok if funcname is the ending \0, then we select string till end
|
||||
trace.object_filename.assign(filename, funcname); // ok even if funcname is the ending \0 (then we assign entire string)
|
||||
|
||||
if ( ! (*funcname) ) { // we already hit end of string. This happens for the last address 0xffff for ip==0
|
||||
trace.object_function = "(none)";
|
||||
trace.source.function = "(none)";
|
||||
return trace;
|
||||
if (*funcname) { // if it's not end of string (e.g. from last frame ip==0)
|
||||
char* funcname_end = funcname + 1;
|
||||
while (*funcname_end && *funcname_end != ')' && *funcname_end != '+') {
|
||||
funcname_end += 1;
|
||||
}
|
||||
*funcname_end = '\0';
|
||||
trace.object_function = this->demangle(funcname);
|
||||
trace.source.function = trace.object_function; // we cannot do better.
|
||||
}
|
||||
|
||||
// else normal string, we are at the opening '(' now
|
||||
funcname++;
|
||||
char* funcname_end = funcname;
|
||||
while (*funcname_end && *funcname_end != ')' && *funcname_end != '+') {
|
||||
funcname_end += 1;
|
||||
}
|
||||
*funcname_end = '\0';
|
||||
trace.object_function = this->demangle(funcname);
|
||||
trace.source.function = trace.object_function; // we cannot do better.
|
||||
return trace;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user