X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=trace_parser.hpp;h=f340da0e72613573aa5ea6d61e0e029779672e29;hb=f562f318ddee6da2041696887e2195fc3c96d740;hp=fe360230f6f498906f1b90a021446908380ca590;hpb=ec494edf0f473db4088c23ec7a97f20eab393c2d;p=apitrace diff --git a/trace_parser.hpp b/trace_parser.hpp index fe36023..f340da0 100644 --- a/trace_parser.hpp +++ b/trace_parser.hpp @@ -29,26 +29,27 @@ #include #include +#include +#include "trace_file.hpp" #include "trace_format.hpp" #include "trace_model.hpp" namespace Trace { - class Parser { protected: - void *file; + File *file; typedef std::list CallList; CallList calls; - typedef std::vector FunctionMap; + typedef std::vector FunctionMap; FunctionMap functions; - typedef std::vector StructMap; + typedef std::vector StructMap; StructMap structs; typedef std::vector EnumMap; @@ -57,6 +58,15 @@ protected: typedef std::vector BitmaskMap; BitmaskMap bitmasks; + typedef std::set TraceOffsets; + TraceOffsets m_callSigOffsets; + TraceOffsets m_structSigOffsets; + TraceOffsets m_enumSigOffsets; + TraceOffsets m_bitmaskSigOffsets; + + typedef std::map CallNumOffsets; + CallNumOffsets m_callNumOffsets; + unsigned next_call_no; public: @@ -72,6 +82,36 @@ public: Call *parse_call(void); + bool supportsOffsets() const + { + return file->supportsOffsets(); + } + + File::Offset currentOffset() + { + return file->currentOffset(); + } + + void setCurrentOffset(const File::Offset &offset) + { + file->setCurrentOffset(offset); + } + + bool callWithSignature(const File::Offset &offset) const; + bool structWithSignature(const File::Offset &offset) const; + bool enumWithSignature(const File::Offset &offset) const; + bool bitmaskWithSignature(const File::Offset &offset) const; + + unsigned currentCallNumber() const + { + return next_call_no; + } + + void setCurrentCallNumber(unsigned num) + { + next_call_no = num; + } + protected: void parse_enter(void);