Breakpoints triggering.

This commit is contained in:
Ben Vanik
2013-12-22 23:04:24 -08:00
parent 5881a58c49
commit 31b8c02cbf
15 changed files with 155 additions and 2 deletions

View File

@@ -119,6 +119,10 @@ void FunctionBuilder::Dump(StringBuffer* str) {
Instr* i = block->instr_head;
while (i) {
if (i->opcode->flags & OPCODE_FLAG_HIDE) {
i = i->next;
continue;
}
if (i->opcode->num == OPCODE_COMMENT) {
str->Append(" ; %s\n", (char*)i->src1.offset);
i = i->next;
@@ -370,6 +374,12 @@ void FunctionBuilder::Nop() {
i->src1.value = i->src2.value = i->src3.value = NULL;
}
void FunctionBuilder::SourceOffset(uint64_t offset) {
Instr* i = AppendInstr(OPCODE_SOURCE_OFFSET_info, 0);
i->src1.offset = offset;
i->src2.value = i->src3.value = NULL;
}
void FunctionBuilder::DebugBreak() {
Instr* i = AppendInstr(OPCODE_DEBUG_BREAK_info, 0);
i->src1.value = i->src2.value = i->src3.value = NULL;

View File

@@ -57,6 +57,8 @@ public:
void Nop();
void SourceOffset(uint64_t offset);
// trace info/etc
void DebugBreak();
void DebugBreakTrue(Value* cond);

View File

@@ -69,6 +69,8 @@ enum Opcode {
OPCODE_NOP,
OPCODE_SOURCE_OFFSET,
OPCODE_DEBUG_BREAK,
OPCODE_DEBUG_BREAK_TRUE,
@@ -174,6 +176,7 @@ enum OpcodeFlags {
OPCODE_FLAG_COMMUNATIVE = (1 << 3),
OPCODE_FLAG_VOLATILE = (1 << 4),
OPCODE_FLAG_IGNORE = (1 << 5),
OPCODE_FLAG_HIDE = (1 << 6),
};
enum OpcodeSignatureType {
@@ -188,6 +191,7 @@ enum OpcodeSignatureType {
enum OpcodeSignature {
OPCODE_SIG_X = (OPCODE_SIG_TYPE_X),
OPCODE_SIG_X_L = (OPCODE_SIG_TYPE_X) | (OPCODE_SIG_TYPE_L << 3),
OPCODE_SIG_X_O = (OPCODE_SIG_TYPE_X) | (OPCODE_SIG_TYPE_O << 3),
OPCODE_SIG_X_O_V = (OPCODE_SIG_TYPE_X) | (OPCODE_SIG_TYPE_O << 3) | (OPCODE_SIG_TYPE_V << 6),
OPCODE_SIG_X_S = (OPCODE_SIG_TYPE_X) | (OPCODE_SIG_TYPE_S << 3),
OPCODE_SIG_X_V = (OPCODE_SIG_TYPE_X) | (OPCODE_SIG_TYPE_V << 3),

View File

@@ -20,6 +20,12 @@ DEFINE_OPCODE(
OPCODE_SIG_X,
OPCODE_FLAG_IGNORE);
DEFINE_OPCODE(
OPCODE_SOURCE_OFFSET,
"source_offset",
OPCODE_SIG_X_O,
OPCODE_FLAG_IGNORE | OPCODE_FLAG_HIDE);
DEFINE_OPCODE(
OPCODE_DEBUG_BREAK,
"debug_break",