# Where the breakpoint will be placed.
set bp_line [gdb_get_line_number "Breakpoint here"]
-proc run_test { cond_eval } {
+proc run_test { cond_eval access_type } {
clean_restart ${::binfile}
if { ![runto_main] } {
}
# Setup the conditional breakpoint and record its number.
- gdb_breakpoint "${::srcfile}:${::bp_line} if (*(int *) 0) == 0"
+ gdb_breakpoint "${::srcfile}:${::bp_line} if (*(${access_type} *) 0) == 0"
set bp_num [get_integer_valueof "\$bpnum" "*UNKNOWN*"]
gdb_test "continue" \
gdb_test_multiple "show breakpoint condition-evaluation" "" {
-re -wrap "Breakpoint condition evaluation mode is auto \\(currently target\\)\\." {
-
- ## NOTE: Instead of testing with "auto" and "host" in this
- ## case we only test with "host". This is because a GDB bug
- ## prevents the "auto" (a.k.a. target) mode from working.
- ##
- ## Don't worry, this will be fixed in a later commit, and this
- ## comment will be removed at that time.
- ##
- ## lappend cond_eval_modes "host"
-
- set cond_eval_modes { "host" }
+ lappend cond_eval_modes "host"
pass $gdb_test_name
}
}
}
-foreach_with_prefix cond_eval $cond_eval_modes {
- run_test $cond_eval
+foreach_with_prefix access_type { "char" "short" "int" "long long" } {
+ foreach_with_prefix cond_eval $cond_eval_modes {
+ run_test $cond_eval $access_type
+ }
}
break;
case gdb_agent_op_ref8:
- agent_mem_read (ctx, cnv.u8.bytes, (CORE_ADDR) top, 1);
+ if (agent_mem_read (ctx, cnv.u8.bytes, (CORE_ADDR) top, 1) != 0)
+ return expr_eval_invalid_memory_access;
top = cnv.u8.val;
break;
case gdb_agent_op_ref16:
- agent_mem_read (ctx, cnv.u16.bytes, (CORE_ADDR) top, 2);
+ if (agent_mem_read (ctx, cnv.u16.bytes, (CORE_ADDR) top, 2) != 0)
+ return expr_eval_invalid_memory_access;
top = cnv.u16.val;
break;
case gdb_agent_op_ref32:
- agent_mem_read (ctx, cnv.u32.bytes, (CORE_ADDR) top, 4);
+ if (agent_mem_read (ctx, cnv.u32.bytes, (CORE_ADDR) top, 4) != 0)
+ return expr_eval_invalid_memory_access;
top = cnv.u32.val;
break;
case gdb_agent_op_ref64:
- agent_mem_read (ctx, cnv.u64.bytes, (CORE_ADDR) top, 8);
+ if (agent_mem_read (ctx, cnv.u64.bytes, (CORE_ADDR) top, 8) != 0)
+ return expr_eval_invalid_memory_access;
top = cnv.u64.val;
break;
expr_eval_unhandled_opcode,
expr_eval_unrecognized_opcode,
expr_eval_divide_by_zero,
- expr_eval_invalid_goto
+ expr_eval_invalid_goto,
+ expr_eval_invalid_memory_access
};
struct agent_expr