mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-16 09:02:22 -07:00
added call site value opcode to RDI format
This commit is contained in:
@@ -92,7 +92,7 @@ RDI_U8 rdi_section_is_required_table[37] =
|
||||
0,
|
||||
};
|
||||
|
||||
RDI_U16 rdi_eval_op_ctrlbits_table[49] =
|
||||
RDI_U16 rdi_eval_op_ctrlbits_table[50] =
|
||||
{
|
||||
RDI_EVAL_CTRLBITS(0, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(0, 0, 0),
|
||||
@@ -142,6 +142,7 @@ RDI_EVAL_CTRLBITS(0, 1, 0),
|
||||
RDI_EVAL_CTRLBITS(1, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(1, 2, 1),
|
||||
RDI_EVAL_CTRLBITS(1, 1, 1),
|
||||
RDI_EVAL_CTRLBITS(4, 0, 0),
|
||||
RDI_EVAL_CTRLBITS(0, 0, 0),
|
||||
};
|
||||
|
||||
|
||||
@@ -488,7 +488,8 @@ RDI_EvalOp_Pop = 44,
|
||||
RDI_EvalOp_Insert = 45,
|
||||
RDI_EvalOp_ValueRead = 46,
|
||||
RDI_EvalOp_ByteSwap = 47,
|
||||
RDI_EvalOp_COUNT = 48,
|
||||
RDI_EvalOp_CallSiteValue = 48,
|
||||
RDI_EvalOp_COUNT = 49,
|
||||
} RDI_EvalOpEnum;
|
||||
|
||||
typedef RDI_U8 RDI_EvalTypeGroup;
|
||||
@@ -1066,6 +1067,7 @@ X(Pop)\
|
||||
X(Insert)\
|
||||
X(ValueRead)\
|
||||
X(ByteSwap)\
|
||||
X(CallSiteValue)\
|
||||
|
||||
#define RDI_EvalTypeGroup_XList \
|
||||
X(Other)\
|
||||
@@ -1537,6 +1539,6 @@ RDI_PROC RDI_U8 *rdi_explanation_string_from_eval_conversion_kind(RDI_EvalConver
|
||||
|
||||
extern RDI_U16 rdi_section_element_size_table[37];
|
||||
extern RDI_U8 rdi_section_is_required_table[37];
|
||||
extern RDI_U16 rdi_eval_op_ctrlbits_table[49];
|
||||
extern RDI_U16 rdi_eval_op_ctrlbits_table[50];
|
||||
|
||||
#endif // RDI_FORMAT_H
|
||||
|
||||
@@ -166,9 +166,10 @@ d2r_collect_proc_params(Arena *arena, D2R_TypeTable *type_table, DW_Input *input
|
||||
|
||||
|
||||
internal RDIM_EvalBytecode
|
||||
d2r_bytecode_from_expression(Arena *arena, U64 image_base, U64 address_size, RDI_Arch arch, DW_ListUnit *addr_lu, String8 expr)
|
||||
d2r_bytecode_from_expression(Arena *arena, U64 image_base, U64 address_size, RDI_Arch arch, DW_ListUnit *addr_lu, String8 expr, B32 *is_addr_out)
|
||||
{
|
||||
RDIM_EvalBytecode bc = {0};
|
||||
*is_addr_out = 1;
|
||||
|
||||
for (U64 cursor = 0; cursor < expr.size; ) {
|
||||
U8 op = 0;
|
||||
@@ -415,7 +416,13 @@ d2r_bytecode_from_expression(Arena *arena, U64 image_base, U64 address_size, RDI
|
||||
String8 entry_value_expr = {0};
|
||||
cursor += str8_deserial_read_block(expr, cursor, block_size, &entry_value_expr);
|
||||
|
||||
RDIM_EvalBytecode entry_value_bc = d2r_bytecode_from_expression(arena, image_base, address_size, arch, addr_lu, entry_value_expr);
|
||||
B32 dummy = 0;
|
||||
RDIM_EvalBytecode call_site_bc = d2r_bytecode_from_expression(arena, image_base, address_size, arch, addr_lu, entry_value_expr, &dummy);
|
||||
|
||||
U32 encoded_size32 = safe_cast_u32(call_site_bc.encoded_size);
|
||||
rdim_bytecode_push_op(arena, &bc, RDI_EvalOp_CallSiteValue, encoded_size32);
|
||||
|
||||
rdim_bytecode_concat_in_place(&bc, &call_site_bc);
|
||||
} break;
|
||||
|
||||
case DW_ExprOp_Addrx: {
|
||||
@@ -575,9 +582,12 @@ d2r_transpile_expression(Arena *arena, U64 image_base, U64 address_size, RDI_Arc
|
||||
{
|
||||
RDIM_Location *loc = 0;
|
||||
if (expr.size) {
|
||||
B32 is_addr = 0;
|
||||
RDIM_EvalBytecode bytecode = d2r_bytecode_from_expression(arena, image_base, address_size, arch, addr_lu, expr, &is_addr);
|
||||
|
||||
loc = push_array(arena, RDIM_Location, 1);
|
||||
loc->kind = RDI_LocationKind_AddrBytecodeStream;
|
||||
loc->bytecode = d2r_bytecode_from_expression(arena, image_base, address_size, arch, addr_lu, expr);
|
||||
loc->kind = is_addr ? RDI_LocationKind_AddrBytecodeStream : RDI_LocationKind_ValBytecodeStream;
|
||||
loc->bytecode = bytecode;
|
||||
}
|
||||
return loc;
|
||||
}
|
||||
|
||||
@@ -1245,55 +1245,56 @@ RDI_LocationRegMemberTable:
|
||||
@table(name value num_decodes num_pops num_pushes)
|
||||
RDI_EvalOpTable:
|
||||
{
|
||||
{Stop 0 0 0 0}
|
||||
{Noop 1 0 0 0}
|
||||
{Cond 2 1 1 0}
|
||||
{Skip 3 2 0 0}
|
||||
{MemRead 4 1 1 1}
|
||||
{RegRead 5 4 0 1}
|
||||
{RegReadDyn 6 0 1 1}
|
||||
{FrameOff 7 8 0 1}
|
||||
{ModuleOff 8 4 0 1}
|
||||
{TLSOff 9 4 0 1}
|
||||
{ObjectOff 10 0 0 0}
|
||||
{CFA 11 0 0 0}
|
||||
{ConstU8 12 1 0 1}
|
||||
{ConstU16 13 2 0 1}
|
||||
{ConstU32 14 4 0 1}
|
||||
{ConstU64 15 8 0 1}
|
||||
{ConstU128 16 16 0 1}
|
||||
{ConstString 17 1 0 1}
|
||||
{Abs 18 1 1 1}
|
||||
{Neg 19 1 1 1}
|
||||
{Add 20 1 2 1}
|
||||
{Sub 21 1 2 1}
|
||||
{Mul 22 1 2 1}
|
||||
{Div 23 1 2 1}
|
||||
{Mod 24 1 2 1}
|
||||
{LShift 25 1 2 1}
|
||||
{RShift 26 1 2 1}
|
||||
{BitAnd 27 1 2 1}
|
||||
{BitOr 28 1 2 1}
|
||||
{BitXor 29 1 2 1}
|
||||
{BitNot 30 1 1 1}
|
||||
{LogAnd 31 1 2 1}
|
||||
{LogOr 32 1 2 1}
|
||||
{LogNot 33 1 1 1}
|
||||
{EqEq 34 1 2 1}
|
||||
{NtEq 35 1 2 1}
|
||||
{LsEq 36 1 2 1}
|
||||
{GrEq 37 1 2 1}
|
||||
{Less 38 1 2 1}
|
||||
{Grtr 39 1 2 1}
|
||||
{Trunc 40 1 1 1}
|
||||
{TruncSigned 41 1 1 1}
|
||||
{Convert 42 2 1 1}
|
||||
{Pick 43 1 0 1}
|
||||
{Pop 44 0 1 0}
|
||||
{Insert 45 1 0 0}
|
||||
{ValueRead 46 1 2 1}
|
||||
{ByteSwap 47 1 1 1}
|
||||
{COUNT 48 0 0 0}
|
||||
{Stop 0 0 0 0}
|
||||
{Noop 1 0 0 0}
|
||||
{Cond 2 1 1 0}
|
||||
{Skip 3 2 0 0}
|
||||
{MemRead 4 1 1 1}
|
||||
{RegRead 5 4 0 1}
|
||||
{RegReadDyn 6 0 1 1}
|
||||
{FrameOff 7 8 0 1}
|
||||
{ModuleOff 8 4 0 1}
|
||||
{TLSOff 9 4 0 1}
|
||||
{ObjectOff 10 0 0 0}
|
||||
{CFA 11 0 0 0}
|
||||
{ConstU8 12 1 0 1}
|
||||
{ConstU16 13 2 0 1}
|
||||
{ConstU32 14 4 0 1}
|
||||
{ConstU64 15 8 0 1}
|
||||
{ConstU128 16 16 0 1}
|
||||
{ConstString 17 1 0 1}
|
||||
{Abs 18 1 1 1}
|
||||
{Neg 19 1 1 1}
|
||||
{Add 20 1 2 1}
|
||||
{Sub 21 1 2 1}
|
||||
{Mul 22 1 2 1}
|
||||
{Div 23 1 2 1}
|
||||
{Mod 24 1 2 1}
|
||||
{LShift 25 1 2 1}
|
||||
{RShift 26 1 2 1}
|
||||
{BitAnd 27 1 2 1}
|
||||
{BitOr 28 1 2 1}
|
||||
{BitXor 29 1 2 1}
|
||||
{BitNot 30 1 1 1}
|
||||
{LogAnd 31 1 2 1}
|
||||
{LogOr 32 1 2 1}
|
||||
{LogNot 33 1 1 1}
|
||||
{EqEq 34 1 2 1}
|
||||
{NtEq 35 1 2 1}
|
||||
{LsEq 36 1 2 1}
|
||||
{GrEq 37 1 2 1}
|
||||
{Less 38 1 2 1}
|
||||
{Grtr 39 1 2 1}
|
||||
{Trunc 40 1 1 1}
|
||||
{TruncSigned 41 1 1 1}
|
||||
{Convert 42 2 1 1}
|
||||
{Pick 43 1 0 1}
|
||||
{Pop 44 0 1 0}
|
||||
{Insert 45 1 0 0}
|
||||
{ValueRead 46 1 2 1}
|
||||
{ByteSwap 47 1 1 1}
|
||||
{CallSiteValue 48 4 0 0}
|
||||
{COUNT 49 0 0 0}
|
||||
}
|
||||
|
||||
// NOTE(rjf): "ck" -> "conversion kind, when converted to type group", used in square matrix form
|
||||
|
||||
Reference in New Issue
Block a user