#include <assert.h>
+#include <stdlib.h>
#include <map>
#include <vector>
-#include <iostream>
namespace trace {
virtual const char *toString(void) const;
const Value & operator[](size_t index) const;
-
- void dump(std::ostream &os, bool color=true);
};
};
-inline std::ostream & operator <<(std::ostream &os, Value *value) {
- if (value) {
- value->dump(os);
- }
- return os;
-}
-
-
typedef unsigned CallFlags;
/**
};
+struct Arg
+{
+ Value *value;
+};
+
class Call
{
public:
+ unsigned thread_id;
unsigned no;
const FunctionSig *sig;
- std::vector<Value *> args;
+ std::vector<Arg> args;
Value *ret;
CallFlags flags;
- Call(FunctionSig *_sig, const CallFlags &_flags) :
+ Call(FunctionSig *_sig, const CallFlags &_flags, unsigned _thread_id) :
+ thread_id(_thread_id),
sig(_sig),
args(_sig->num_args),
ret(0),
inline Value & arg(unsigned index) {
assert(index < args.size());
- return *(args[index]);
+ return *(args[index].value);
}
-
- void dump(std::ostream &os, bool color=true);
};
-inline std::ostream & operator <<(std::ostream &os, Call &call) {
- call.dump(os);
- return os;
-}
-
-
} /* namespace trace */
#endif /* _TRACE_MODEL_HPP_ */