This class is used to analyze data held in a trace file with various methods.
More...
#include <code_trace_analysis.hpp>
|
| | CodeTraceAnalyzer (std::string trace_path) |
| |
| void | reach_address (ADDR addr) |
| |
| void | reach_offset (std::string name, uint32_t off) |
| |
| void | loop_on_every_hit (ANALYZER_HIT_CALLBACK callback, bool reset_cursor=true) |
| |
| void | loop_on_every_mod_hit (ANALYZER_HIT_CALLBACK callback, std::string name, bool reset_cursor=true) |
| |
| void | search_hit_address (ANALYZER_HIT_CALLBACK callback, ADDR addr, bool reset_cursor=true) |
| |
| void | search_hit_address_range (ANALYZER_HIT_CALLBACK callback, ADDR start_addr, ADDR end_addr, bool reset_cursor=true) |
| |
| void | search_hit_offset (ANALYZER_HIT_CALLBACK callback, std::string name, uint32_t off, bool reset_cursor=true) |
| |
| void | search_hit_offset_range (ANALYZER_HIT_CALLBACK callback, std::string name, ADDR start_off, ADDR end_off, bool reset_cursor=true) |
| |
| template<typename T > |
| void | search_reg_val (ANALYZER_HIT_CALLBACK callback, REG reg, T val) |
| |
This class is used to analyze data held in a trace file with various methods.
◆ CodeTraceAnalyzer()
| arion::CodeTraceAnalyzer::CodeTraceAnalyzer |
( |
std::string |
trace_path | ) |
|
Builder for CodeTraceAnalyzer instances.
- Parameters
-
| [in] | trace_path | Path to the trace file. |
◆ loop_on_every_hit()
| void arion::CodeTraceAnalyzer::loop_on_every_hit |
( |
ANALYZER_HIT_CALLBACK |
callback, |
|
|
bool |
reset_cursor = true |
|
) |
| |
Calls the given callback on every hit contained in the trace file.
- Parameters
-
| [in] | callback | The callback to be called for each hit. |
| [in] | reset_cursor | Whether the cursor of the underlying reader should be reset to the top of the trace file. |
◆ loop_on_every_mod_hit()
| void arion::CodeTraceAnalyzer::loop_on_every_mod_hit |
( |
ANALYZER_HIT_CALLBACK |
callback, |
|
|
std::string |
name, |
|
|
bool |
reset_cursor = true |
|
) |
| |
Calls the given callback on every hit contained in a given module from the trace file.
- Parameters
-
| [in] | callback | The callback to be called for each module hit. |
| [in] | name | Name of the module to process. |
| [in] | reset_cursor | Whether the cursor of the underlying reader should be reset to the top of the trace file. |
◆ reach_address()
| void arion::CodeTraceAnalyzer::reach_address |
( |
ADDR |
addr | ) |
|
Tells the underlying reader to advance until it reaches a given PC address in a hit.
- Parameters
-
| [in] | addr | The address to reach. |
- Returns
- The hit containing the given PC address.
◆ reach_offset()
| void arion::CodeTraceAnalyzer::reach_offset |
( |
std::string |
name, |
|
|
uint32_t |
off |
|
) |
| |
Tells the underlying reader to advance until it reaches a given PC offset from a module start in a hit.
- Parameters
-
| [in] | mod_id | ID of the module to compute offset from. |
| [in] | off | The offset to reach. |
- Returns
- The hit containing the given PC offset.
◆ search_hit_address()
Calls the callback when a hit contains the given PC address.
- Parameters
-
| [in] | callback | The callback to be called when the PC address is reached. |
| [in] | addr | The address to be reached. |
| [in] | reset_cursor | Whether the cursor of the underlying reader should be reset to the top of the trace file. |
◆ search_hit_address_range()
| void arion::CodeTraceAnalyzer::search_hit_address_range |
( |
ANALYZER_HIT_CALLBACK |
callback, |
|
|
ADDR |
start_addr, |
|
|
ADDR |
end_addr, |
|
|
bool |
reset_cursor = true |
|
) |
| |
Calls the callback when a hit PC address is contained in the specified bounds.
- Parameters
-
| [in] | callback | The callback to be called when the PC address is in the specified bounds. |
| [in] | start_addr | Start address of the code range to be reached. |
| [in] | end_addr | End address of the code area to be reached. |
| [in] | reset_cursor | Whether the cursor of the underlying reader should be reset to the top of the trace file. |
◆ search_hit_offset()
| void arion::CodeTraceAnalyzer::search_hit_offset |
( |
ANALYZER_HIT_CALLBACK |
callback, |
|
|
std::string |
name, |
|
|
uint32_t |
off, |
|
|
bool |
reset_cursor = true |
|
) |
| |
Calls the callback when a hit PC address is a given module offset.
- Parameters
-
| [in] | callback | The callback to be called when the module offset is reached. |
| [in] | name | Name of the module to compute the offset from. |
| [in] | off | Offset of the module to be reached. |
| [in] | reset_cursor | Whether the cursor of the underlying reader should be reset to the top of the trace file. |
◆ search_hit_offset_range()
| void arion::CodeTraceAnalyzer::search_hit_offset_range |
( |
ANALYZER_HIT_CALLBACK |
callback, |
|
|
std::string |
name, |
|
|
ADDR |
start_off, |
|
|
ADDR |
end_off, |
|
|
bool |
reset_cursor = true |
|
) |
| |
Calls the callback when a hit PC address is at a given module range.
- Parameters
-
| [in] | callback | The callback to be called when the module range is reached. |
| [in] | name | Name of the module to compute the range from. |
| [in] | start_off | Start offset of the module range to be reached. |
| [in] | end_off | End offset of the module range to be reached. |
| [in] | reset_cursor | Whether the cursor of the underlying reader should be reset to the top of the trace file. |
◆ search_reg_val()
Calls the callback when a hit contains a given register value. Only makes sense for files generated with TRACE_MODE::CTXT.
- Template Parameters
-
| T | A RVAL type large enough to store the register value. |
- Parameters
-
| [in] | callback | The callback to be called when the register value is reached. |
| [in] | reg | The context register which is being monitored. |
| [in] | val | The register value to be reached. |
◆ reader
The documentation for this class was generated from the following file: