Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NervousPuppySprintOne NervousPuppySprint2602 Robot WarehouseBot1 ... more
Fork of mbed by
Diff: DebugTracer.h
- Revision:
- 4:5d1359a283bc
- Parent:
- 1:6b7f447ca868
--- a/DebugTracer.h Fri Nov 14 15:25:20 2008 +0000
+++ b/DebugTracer.h Thu Nov 27 16:23:24 2008 +0000
@@ -6,7 +6,7 @@
#define MBED_DEBUGTRACER_H
#include "Base.h"
-#include "stdio.h"
+#include <cstdio>
#define MAX_TRACER_DEPTH 32
@@ -17,7 +17,7 @@
#define METHOD(name) DebugTracer _tracer_instance(name, this)
#define FUNCTION(name) DebugTracer _tracer_instance(name)
-/* Class: DebugTracer
+/* Class DebugTracer
* A code instrumentation utility
*
* This object adds a function name or methodname/object instance
@@ -31,7 +31,7 @@
* - trace the runtime call graph (for the whole program run, or programatically on/off)
*
*
- * Example:
+ * Example
*
* Function example
* > void foo(int x) { FUNCTION("foo");
@@ -45,7 +45,7 @@
public:
- /* Constructor: DebugTracer
+ /* Constructor DebugTracer
* Record the method and object instance it is called on
* to the call stack
*/
@@ -55,7 +55,7 @@
_depth++;
}
- /* Destructor: ~DebugTracer
+ /* Destructor ~DebugTracer
* Pop from the call stack
*/
~DebugTracer() {
@@ -63,16 +63,16 @@
}
static void stack() {
- fprintf(stderr, "Trace (depth = %d):\n", _depth);
+ std::fprintf(stderr, "Trace (depth = %d):\n", _depth);
for(int i=0; i<_depth; i++) {
// indent
for(int j=0; j<i; j++) {
- fprintf(stderr, " ");
+ std::fprintf(stderr, " ");
}
if(_objects[i]) {
- fprintf(stderr, "%s::", _objects[i]->type());
+// std::fprintf(stderr, "%s::", _objects[i]->type());
}
- fprintf(stderr, "%s\n", _functions[i]);
+ std::fprintf(stderr, "%s\n", _functions[i]);
}
}
