FunctionTracer: use __PRETTY_FUNCTION__
Change-Id: I49d53f4bb7b65d32c9e1e22be89add6199ccad24 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10038 Reviewed-by: Adrien Destugues <[email protected]> Reviewed-by: Niels Sascha Reedijk <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
7ad0bd3735
commit
b1ff3e6c46
@@ -13,15 +13,13 @@ namespace BPrivate {
|
||||
|
||||
class FunctionTracer {
|
||||
public:
|
||||
FunctionTracer(const char* className, const char* functionName,
|
||||
int32& depth)
|
||||
: fFunctionName(),
|
||||
FunctionTracer(const char* functionName, int32& depth)
|
||||
: fFunctionName(functionName),
|
||||
fPrepend(),
|
||||
fFunctionDepth(depth)
|
||||
{
|
||||
fFunctionDepth++;
|
||||
fPrepend.Append(' ', fFunctionDepth * 2);
|
||||
fFunctionName << className << "::" << functionName << "()";
|
||||
|
||||
printf("%s%s {\n", fPrepend.String(), fFunctionName.String());
|
||||
}
|
||||
|
||||
@@ -47,8 +47,7 @@
|
||||
#ifdef TRACE_MENU_FIELD
|
||||
# include <FunctionTracer.h>
|
||||
static int32 sFunctionDepth = -1;
|
||||
# define CALLED(x...) FunctionTracer _ft("BMenuField", __FUNCTION__, \
|
||||
sFunctionDepth)
|
||||
# define CALLED(x...) FunctionTracer _ft(__PRETTY_FUNCTION__, sFunctionDepth)
|
||||
# define TRACE(x...) { BString _to; \
|
||||
_to.Append(' ', (sFunctionDepth + 1) * 2); \
|
||||
printf("%s", _to.String()); printf(x); }
|
||||
|
||||
@@ -37,8 +37,7 @@
|
||||
# include <stdio.h>
|
||||
# include <FunctionTracer.h>
|
||||
static int32 sFunctionDepth = -1;
|
||||
# define CALLED(x...) FunctionTracer _ft("BTextControl", __FUNCTION__, \
|
||||
sFunctionDepth)
|
||||
# define CALLED(x...) FunctionTracer _ft(__PRETTY_FUNCTION__, sFunctionDepth)
|
||||
# define TRACE(x...) { BString _to; \
|
||||
_to.Append(' ', (sFunctionDepth + 1) * 2); \
|
||||
printf("%s", _to.String()); printf(x); }
|
||||
|
||||
@@ -78,8 +78,7 @@ using BPrivate::gSystemCatalog;
|
||||
#ifdef TRACE_TEXT_VIEW
|
||||
# include <FunctionTracer.h>
|
||||
static int32 sFunctionDepth = -1;
|
||||
# define CALLED(x...) FunctionTracer _ft("BTextView", __FUNCTION__, \
|
||||
sFunctionDepth)
|
||||
# define CALLED(x...) FunctionTracer _ft(__PRETTY_FUNCTION__, sFunctionDepth)
|
||||
# define TRACE(x...) { BString _to; \
|
||||
_to.Append(' ', (sFunctionDepth + 1) * 2); \
|
||||
printf("%s", _to.String()); printf(x); }
|
||||
|
||||
Reference in New Issue
Block a user