summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBInstruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBInstruction.cpp')
-rw-r--r--lldb/source/API/SBInstruction.cpp62
1 files changed, 56 insertions, 6 deletions
diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp
index abc390b24b8..53b2d196788 100644
--- a/lldb/source/API/SBInstruction.cpp
+++ b/lldb/source/API/SBInstruction.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "lldb/API/SBInstruction.h"
+#include "SBReproducerPrivate.h"
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBFrame.h"
@@ -66,16 +67,24 @@ protected:
using namespace lldb;
using namespace lldb_private;
-SBInstruction::SBInstruction() : m_opaque_sp() {}
+SBInstruction::SBInstruction() : m_opaque_sp() {
+ LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBInstruction);
+}
SBInstruction::SBInstruction(const lldb::DisassemblerSP &disasm_sp,
const lldb::InstructionSP &inst_sp)
: m_opaque_sp(new InstructionImpl(disasm_sp, inst_sp)) {}
SBInstruction::SBInstruction(const SBInstruction &rhs)
- : m_opaque_sp(rhs.m_opaque_sp) {}
+ : m_opaque_sp(rhs.m_opaque_sp) {
+ LLDB_RECORD_CONSTRUCTOR(SBInstruction, (const lldb::SBInstruction &), rhs);
+}
const SBInstruction &SBInstruction::operator=(const SBInstruction &rhs) {
+ LLDB_RECORD_METHOD(const lldb::SBInstruction &,
+ SBInstruction, operator=,(const lldb::SBInstruction &),
+ rhs);
+
if (this != &rhs)
m_opaque_sp = rhs.m_opaque_sp;
return *this;
@@ -83,17 +92,26 @@ const SBInstruction &SBInstruction::operator=(const SBInstruction &rhs) {
SBInstruction::~SBInstruction() {}
-bool SBInstruction::IsValid() { return m_opaque_sp && m_opaque_sp->IsValid(); }
+bool SBInstruction::IsValid() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBInstruction, IsValid);
+
+ return m_opaque_sp && m_opaque_sp->IsValid();
+}
SBAddress SBInstruction::GetAddress() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::SBAddress, SBInstruction, GetAddress);
+
SBAddress sb_addr;
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp && inst_sp->GetAddress().IsValid())
sb_addr.SetAddress(&inst_sp->GetAddress());
- return sb_addr;
+ return LLDB_RECORD_RESULT(sb_addr);
}
const char *SBInstruction::GetMnemonic(SBTarget target) {
+ LLDB_RECORD_METHOD(const char *, SBInstruction, GetMnemonic, (lldb::SBTarget),
+ target);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp) {
ExecutionContext exe_ctx;
@@ -111,6 +129,9 @@ const char *SBInstruction::GetMnemonic(SBTarget target) {
}
const char *SBInstruction::GetOperands(SBTarget target) {
+ LLDB_RECORD_METHOD(const char *, SBInstruction, GetOperands, (lldb::SBTarget),
+ target);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp) {
ExecutionContext exe_ctx;
@@ -128,6 +149,9 @@ const char *SBInstruction::GetOperands(SBTarget target) {
}
const char *SBInstruction::GetComment(SBTarget target) {
+ LLDB_RECORD_METHOD(const char *, SBInstruction, GetComment, (lldb::SBTarget),
+ target);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp) {
ExecutionContext exe_ctx;
@@ -145,6 +169,8 @@ const char *SBInstruction::GetComment(SBTarget target) {
}
size_t SBInstruction::GetByteSize() {
+ LLDB_RECORD_METHOD_NO_ARGS(size_t, SBInstruction, GetByteSize);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp)
return inst_sp->GetOpcode().GetByteSize();
@@ -152,6 +178,9 @@ size_t SBInstruction::GetByteSize() {
}
SBData SBInstruction::GetData(SBTarget target) {
+ LLDB_RECORD_METHOD(lldb::SBData, SBInstruction, GetData, (lldb::SBTarget),
+ target);
+
lldb::SBData sb_data;
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp) {
@@ -160,10 +189,12 @@ SBData SBInstruction::GetData(SBTarget target) {
sb_data.SetOpaque(data_extractor_sp);
}
}
- return sb_data;
+ return LLDB_RECORD_RESULT(sb_data);
}
bool SBInstruction::DoesBranch() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBInstruction, DoesBranch);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp)
return inst_sp->DoesBranch();
@@ -171,13 +202,17 @@ bool SBInstruction::DoesBranch() {
}
bool SBInstruction::HasDelaySlot() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBInstruction, HasDelaySlot);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp)
return inst_sp->HasDelaySlot();
return false;
}
-bool SBInstruction::CanSetBreakpoint () {
+bool SBInstruction::CanSetBreakpoint() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBInstruction, CanSetBreakpoint);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp)
return inst_sp->CanSetBreakpoint();
@@ -197,6 +232,9 @@ void SBInstruction::SetOpaque(const lldb::DisassemblerSP &disasm_sp,
}
bool SBInstruction::GetDescription(lldb::SBStream &s) {
+ LLDB_RECORD_METHOD(bool, SBInstruction, GetDescription, (lldb::SBStream &),
+ s);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp) {
SymbolContext sc;
@@ -216,6 +254,8 @@ bool SBInstruction::GetDescription(lldb::SBStream &s) {
}
void SBInstruction::Print(FILE *out) {
+ LLDB_RECORD_METHOD(void, SBInstruction, Print, (FILE *), out);
+
if (out == NULL)
return;
@@ -236,6 +276,9 @@ void SBInstruction::Print(FILE *out) {
bool SBInstruction::EmulateWithFrame(lldb::SBFrame &frame,
uint32_t evaluate_options) {
+ LLDB_RECORD_METHOD(bool, SBInstruction, EmulateWithFrame,
+ (lldb::SBFrame &, uint32_t), frame, evaluate_options);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp) {
lldb::StackFrameSP frame_sp(frame.GetFrameSP());
@@ -258,6 +301,9 @@ bool SBInstruction::EmulateWithFrame(lldb::SBFrame &frame,
}
bool SBInstruction::DumpEmulation(const char *triple) {
+ LLDB_RECORD_METHOD(bool, SBInstruction, DumpEmulation, (const char *),
+ triple);
+
lldb::InstructionSP inst_sp(GetOpaque());
if (inst_sp && triple) {
return inst_sp->DumpEmulation(HostInfo::GetAugmentedArchSpec(triple));
@@ -267,6 +313,10 @@ bool SBInstruction::DumpEmulation(const char *triple) {
bool SBInstruction::TestEmulation(lldb::SBStream &output_stream,
const char *test_file) {
+ LLDB_RECORD_METHOD(bool, SBInstruction, TestEmulation,
+ (lldb::SBStream &, const char *), output_stream,
+ test_file);
+
if (!m_opaque_sp)
SetOpaque(lldb::DisassemblerSP(),
lldb::InstructionSP(new PseudoInstruction()));
OpenPOWER on IntegriCloud