CodeobjMap Class Reference#
|
ROCprofiler-SDK developer API 1.0.0
ROCm Profiling API and tools
|
rocprofiler::sdk::codeobj::disassembly::CodeobjMap Class Reference
Maps ID and offsets into instructions. More...
#include <rocprofiler-sdk/cxx/codeobj/code_printing.hpp>
Inheritance diagram for rocprofiler::sdk::codeobj::disassembly::CodeobjMap:
Collaboration diagram for rocprofiler::sdk::codeobj::disassembly::CodeobjMap:Public Member Functions | |
| virtual void | addDecoder (const char *filepath, marker_id_t id, uint64_t load_addr, uint64_t memsize) |
| virtual void | addDecoder (const void *data, unsigned long memory_size, marker_id_t id, uint64_t load_addr, uint64_t memsize) |
| virtual bool | removeDecoderbyId (marker_id_t id) |
| std::unique_ptr< Instruction > | get (marker_id_t id, uint64_t offset) |
| const char * | getSymbolName (marker_id_t id, uint64_t offset) |
Protected Attributes | |
| std::unordered_map< marker_id_t, std::shared_ptr< LoadedCodeobjDecoder > > | decoders {} |
Detailed Description
Maps ID and offsets into instructions.
Definition at line 371 of file code_printing.hpp.
Member Function Documentation
◆ addDecoder() [1/2]
|
inlinevirtual |
Definition at line 377 of file code_printing.hpp.
381 {
382 decoders[id] = std::make_shared<LoadedCodeobjDecoder>(filepath, load_addr, memsize);
383 }
◆ addDecoder() [2/2]
|
inlinevirtual |
Definition at line 385 of file code_printing.hpp.
390 {
391 decoders[id] =
392 std::make_shared<LoadedCodeobjDecoder>(data, memory_size, load_addr, memsize);
393 }
◆ get()
|
inline |
Definition at line 397 of file code_printing.hpp.
398 {
399 try
400 {
401 auto& decoder = decoders.at(id);
402 auto inst = decoder->get(decoder->begin() + offset);
403 if(inst != nullptr) inst->codeobj_id = id;
404 return inst;
405 } catch(std::out_of_range&)
406 {}
407 return nullptr;
408 }
◆ getSymbolName()
|
inline |
Definition at line 410 of file code_printing.hpp.
411 {
412 try
413 {
414 auto& decoder = decoders.at(id);
415 uint64_t vaddr = decoder->begin() + offset;
416 if(decoder->inrange(vaddr)) return decoder->getSymbolName(vaddr);
417 } catch(std::out_of_range&)
418 {}
419 return nullptr;
420 }
◆ removeDecoderbyId()
|
inlinevirtual |
Definition at line 395 of file code_printing.hpp.
395{ return decoders.erase(id) != 0; }
Field Documentation
◆ decoders
|
protected |
Definition at line 423 of file code_printing.hpp.
423{};
The documentation for this class was generated from the following file:
- rocprofiler-sdk/cxx/codeobj/code_printing.hpp
Generated by