}
if( 0 == p_exp->b_dwsize ) { p_exp->b_dwsize = 8; }
+ if((4 != p_exp->b_dwsize) && (8 != p_exp->b_dwsize)) {
+ return (LIBGOBLIN_DWARF_STATUS_ERROR | 0x03);
+ }
// ------------------------
if( NULL != p_exp->resume.pb_resume ) {
break;
case DW_OP_addr: // 0x03
- if( p_exp->dw_setdata & LIBGOBLIN_DWARF_REQUEST_ADDRSIZE ) {
- PUSH_DWARF( p_exp, p_exp->qw_reqdata[ LIBGOBLIN_DWARF_DATAID_ADDRSIZE ] );
- p_exp->dw_setdata &= (~LIBGOBLIN_DWARF_REQUEST_ADDRSIZE);
- }
- else {
- p_exp->dw_requested |= LIBGOBLIN_DWARF_REQUEST_ADDRSIZE;
- qw_remain = 0; // for Loop-Break
- }
+ if( p_exp->b_dwsize > qw_remain )
+ { goto goto_DWARF_Expression_Evaluate_post; }
+
+ if( 8 == p_exp->b_dwsize )
+ { qw_value = (QWord)*((QWord *)pb_now); }
+ else if( 4 == p_exp->b_dwsize )
+ { qw_value = (QWord)*((DWord *)pb_now); }
+ pb_now += p_exp->b_dwsize;
+ qw_remain -= p_exp->b_dwsize;
+ PUSH_DWARF( p_exp, qw_value );
break;
case DW_OP_const1u: // 0x08
// DW_OP_addr ------------------
b_data[0] = DW_OP_addr;
+ pqw_value = (QWord *)&(b_data[1]);
+ *pqw_value = 0x1234567890abcdef;
DWARF_Expression_ClearValue( p_exp );
- dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 1 );
- Test_LibGoblin_DWARF_Expression_CheckStruct( p_exp,
- LIBGOBLIN_DWARF_STATUS_REQUESTED,
- LIBGOBLIN_DWARF_REQUEST_ADDRSIZE, LIBGOBLIN_DWARF_REQUEST_NONE );
-
- p_exp->qw_reqdata[ LIBGOBLIN_DWARF_DATAID_ADDRSIZE ] = 8;
- p_exp->dw_setdata |= LIBGOBLIN_DWARF_REQUEST_ADDRSIZE;
- dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 1 );
+ dw_result = DWARF_Expression_Evaluate( p_exp, b_data, 9 );
Test_LibGoblin_DWARF_Expression_CheckStruct( p_exp,
LIBGOBLIN_DWARF_STATUS_EVALUATED,
LIBGOBLIN_DWARF_REQUEST_NONE, LIBGOBLIN_DWARF_REQUEST_NONE );
- CU_ASSERT( p_exp->result[0].value.qw_value == 8 );
- CU_ASSERT( p_exp->t_stack[ 0 ].value.qw_value == 8 );
+ CU_ASSERT( p_exp->result[0].value.qw_value == 0x1234567890abcdef );
+ CU_ASSERT( p_exp->t_stack[ 0 ].value.qw_value == 0x1234567890abcdef );
CU_ASSERT( p_exp->dw_depth == 1 );
// DW_OP_const1u --------------