CU_ASSERT( NULL != p_exp );
// DW_OP_abs: // 0x19
+ b_data[0] = DW_OP_consts;
+ b_data[1] = 0xff;
+ b_data[2] = 0x7e; // value = -129 (0xff 0x7e)
+ b_data[3] = DW_OP_abs;
+ DWARF_Expression_ClearValue( p_exp );
+ dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 4 );
+ Test_LibGoblin_DWARF_Expression_CheckStruct( p_exp,
+ LIBGOBLIN_DWARF_STATUS_EVALUATED,
+ LIBGOBLIN_DWARF_REQUEST_NONE, LIBGOBLIN_DWARF_REQUEST_NONE );
+ CU_ASSERT( p_exp->result.ii_value == 129 );
+ CU_ASSERT( p_exp->t_stack[ 0 ].value.ii_value = 129 );
+ CU_ASSERT( p_exp->dw_depth == 1 );
+
// DW_OP_and: // 0x1a
+ b_data[0] = DW_OP_const4u;
+ b_data[1] = 0xff;
+ b_data[2] = 0xff;
+ b_data[3] = 0x55;
+ b_data[4] = 0x55; // 0xffff5555
+ b_data[5] = DW_OP_const4u;
+ b_data[6] = 0xff;
+ b_data[7] = 0x00;
+ b_data[8] = 0x55;
+ b_data[9] = 0xaa; // 0xff0055aa
+ b_data[10] = DW_OP_and;
+ DWARF_Expression_ClearValue( p_exp );
+ dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 11 );
+ Test_LibGoblin_DWARF_Expression_CheckStruct( p_exp,
+ LIBGOBLIN_DWARF_STATUS_EVALUATED,
+ LIBGOBLIN_DWARF_REQUEST_NONE, LIBGOBLIN_DWARF_REQUEST_NONE );
+ CU_ASSERT( p_exp->result.qw_value == 0xff005500 );
+ CU_ASSERT( p_exp->t_stack[ 0 ].value.ii_value = 0xff005500 );
+ CU_ASSERT( p_exp->dw_depth == 1 );
+
// DW_OP_div: // 0x1b
// DW_OP_minus: // 0x1c
// DW_OP_mod: // 0x1d
// DW_OP_mul: // 0x1e
// DW_OP_neg: // 0x1f
- // \9bjDW_OP_not: // 0x20
+ // DW_OP_not: // 0x20
+
// DW_OP_or: // 0x21
+ b_data[0] = DW_OP_const4u;
+ b_data[1] = 0xff;
+ b_data[2] = 0xff;
+ b_data[3] = 0x55;
+ b_data[4] = 0x55; // 0xffff5555
+ b_data[5] = DW_OP_const4u;
+ b_data[6] = 0xff;
+ b_data[7] = 0x00;
+ b_data[8] = 0x55;
+ b_data[9] = 0xaa; // 0xff0055aa
+ b_data[10] = DW_OP_or;
+ DWARF_Expression_ClearValue( p_exp );
+ dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 11 );
+ Test_LibGoblin_DWARF_Expression_CheckStruct( p_exp,
+ LIBGOBLIN_DWARF_STATUS_EVALUATED,
+ LIBGOBLIN_DWARF_REQUEST_NONE, LIBGOBLIN_DWARF_REQUEST_NONE );
+ CU_ASSERT( p_exp->result.qw_value == 0xffff55ff );
+ CU_ASSERT( p_exp->t_stack[ 0 ].value.ii_value = 0xffff55ff );
+ CU_ASSERT( p_exp->dw_depth == 1 );
+
// DW_OP_plus: // 0x22
// DW_OP_plus_uconst: // 0x23
// DW_OP_shl: // 0x24
+ b_data[0] = DW_OP_lit4;
+ b_data[1] = DW_OP_const4u;
+ b_data[2] = 0xff;
+ b_data[3] = 0xff;
+ b_data[4] = 0x55;
+ b_data[5] = 0xaa; // 0xffff55aa
+ b_data[6] = DW_OP_shl;
+ DWARF_Expression_ClearValue( p_exp );
+ dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 7 );
+ Test_LibGoblin_DWARF_Expression_CheckStruct( p_exp,
+ LIBGOBLIN_DWARF_STATUS_EVALUATED,
+ LIBGOBLIN_DWARF_REQUEST_NONE, LIBGOBLIN_DWARF_REQUEST_NONE );
+ CU_ASSERT( p_exp->result.qw_value == 0xff55aa00 );
+ CU_ASSERT( p_exp->t_stack[ 0 ].value.ii_value = 0xff55aa00 );
+ CU_ASSERT( p_exp->dw_depth == 1 );
+
// DW_OP_shr: // 0x25
// DW_OP_shra: // 0x26
+
// DW_OP_xor: // 0x27
+ b_data[0] = DW_OP_const4u;
+ b_data[1] = 0xff;
+ b_data[2] = 0xff;
+ b_data[3] = 0x55;
+ b_data[4] = 0x55; // 0xffff5555
+ b_data[5] = DW_OP_const4u;
+ b_data[6] = 0xff;
+ b_data[7] = 0x00;
+ b_data[8] = 0x55;
+ b_data[9] = 0xaa; // 0xff0055aa
+ b_data[10] = DW_OP_xor;
+ DWARF_Expression_ClearValue( p_exp );
+ dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 11 );
+ Test_LibGoblin_DWARF_Expression_CheckStruct( p_exp,
+ LIBGOBLIN_DWARF_STATUS_EVALUATED,
+ LIBGOBLIN_DWARF_REQUEST_NONE, LIBGOBLIN_DWARF_REQUEST_NONE );
+ CU_ASSERT( p_exp->result.qw_value == 0x00ff00ff );
+ CU_ASSERT( p_exp->t_stack[ 0 ].value.ii_value = 0x00ff00ff );
+ CU_ASSERT( p_exp->dw_depth == 1 );
+
+
+/*
+ b_data[0] = DW_OP_consts;
+ b_data[1] = 0xef;
+ b_data[2] = 0xcd;
+ b_data[3] = 0xab;
+ b_data[4] = 0x90;
+ b_data[5] = 0x78;
+ b_data[6] = 0x56;
+ b_data[7] = 0x34;
+ b_data[8] = 0x12;
+ b_data[9] = DW_OP_deref_size;
+ b_data[10] = 2;
+ DWARF_Expression_ClearValue( p_exp );
+ dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 11 );
+ Test_LibGoblin_DWARF_Expression_CheckStruct( p_exp,
+ LIBGOBLIN_DWARF_STATUS_REQUESTED,
+ LIBGOBLIN_DWARF_REQUEST_DEREF, LIBGOBLIN_DWARF_REQUEST_NONE );
+ CU_ASSERT( p_exp->ptr_reference.value == 0x1234567890abcdef );
+ CU_ASSERT( p_exp->dw_reqsize == 2 );
+ CU_ASSERT( 1 == p_exp->dw_depth );
+*/
/*
b_data[0] = DW_OP_fbreg;