|
Lines 1198-1204
update_watchpoint (struct breakpoint *b, int reparse)
|
Link Here
|
|---|
|
| 1198 |
addr = value_address (v); |
1198 |
addr = value_address (v); |
| 1199 |
len = TYPE_LENGTH (value_type (v)); |
1199 |
len = TYPE_LENGTH (value_type (v)); |
| 1200 |
type = hw_write; |
1200 |
type = hw_write; |
| 1201 |
if (b->type == bp_read_watchpoint) |
1201 |
if (v == val_chain && value_lazy (v)) |
|
|
1202 |
type = hw_mmap; |
| 1203 |
else if (b->type == bp_read_watchpoint) |
| 1204 |
|
| 1202 |
type = hw_read; |
1205 |
type = hw_read; |
| 1203 |
else if (b->type == bp_access_watchpoint) |
1206 |
else if (b->type == bp_access_watchpoint) |
| 1204 |
type = hw_access; |
1207 |
type = hw_access; |
|
Lines 1472-1480
Note: automatically using hardware breakpoints for read-only addresses.\n"));
|
Link Here
|
|---|
|
| 1472 |
watchpoints. It's not clear that it's necessary... */ |
1475 |
watchpoints. It's not clear that it's necessary... */ |
| 1473 |
&& bpt->owner->disposition != disp_del_at_next_stop) |
1476 |
&& bpt->owner->disposition != disp_del_at_next_stop) |
| 1474 |
{ |
1477 |
{ |
| 1475 |
val = target_insert_watchpoint (bpt->address, |
1478 |
if (bpt->watchpoint_type == hw_mmap) |
| 1476 |
bpt->length, |
1479 |
{ |
| 1477 |
bpt->watchpoint_type); |
1480 |
struct inferior *inf = current_inferior (); |
|
|
1481 |
|
| 1482 |
inf->trap_syscalls = 1; |
| 1483 |
val = 0; |
| 1484 |
} |
| 1485 |
else |
| 1486 |
val = target_insert_watchpoint (bpt->address, |
| 1487 |
bpt->length, |
| 1488 |
bpt->watchpoint_type); |
| 1478 |
bpt->inserted = (val != -1); |
1489 |
bpt->inserted = (val != -1); |
| 1479 |
} |
1490 |
} |
| 1480 |
|
1491 |
|
|
Lines 2100-2108
remove_breakpoint_1 (struct bp_location *b, insertion_state_t is)
|
Link Here
|
|---|
|
| 2100 |
struct value *n; |
2111 |
struct value *n; |
| 2101 |
|
2112 |
|
| 2102 |
b->inserted = (is == mark_inserted); |
2113 |
b->inserted = (is == mark_inserted); |
| 2103 |
val = target_remove_watchpoint (b->address, b->length, |
2114 |
if (b->watchpoint_type == hw_mmap) |
| 2104 |
b->watchpoint_type); |
2115 |
val = 0; |
| 2105 |
|
2116 |
else |
|
|
2117 |
val = target_remove_watchpoint (b->address, b->length, |
| 2118 |
b->watchpoint_type); |
| 2106 |
/* Failure to remove any of the hardware watchpoints comes here. */ |
2119 |
/* Failure to remove any of the hardware watchpoints comes here. */ |
| 2107 |
if ((is == mark_uninserted) && (b->inserted)) |
2120 |
if ((is == mark_uninserted) && (b->inserted)) |
| 2108 |
warning (_("Could not remove hardware watchpoint %d."), |
2121 |
warning (_("Could not remove hardware watchpoint %d."), |
|
Lines 3162-3167
watchpoints_triggered (struct target_waitstatus *ws)
|
Link Here
|
|---|
|
| 3162 |
return 1; |
3175 |
return 1; |
| 3163 |
} |
3176 |
} |
| 3164 |
|
3177 |
|
|
|
3178 |
void |
| 3179 |
mmap_watchpoints_triggered (void) |
| 3180 |
{ |
| 3181 |
struct breakpoint *b; |
| 3182 |
|
| 3183 |
ALL_BREAKPOINTS (b) |
| 3184 |
if (b->type == bp_hardware_watchpoint) |
| 3185 |
{ |
| 3186 |
struct bp_location *loc; |
| 3187 |
|
| 3188 |
for (loc = b->loc; loc; loc = loc->next) |
| 3189 |
if (loc->watchpoint_type == hw_mmap) |
| 3190 |
{ |
| 3191 |
b->watchpoint_triggered = watch_triggered_yes; |
| 3192 |
break; |
| 3193 |
} |
| 3194 |
} |
| 3195 |
} |
| 3196 |
|
| 3165 |
/* Possible return values for watchpoint_check (this can't be an enum |
3197 |
/* Possible return values for watchpoint_check (this can't be an enum |
| 3166 |
because of check_errors). */ |
3198 |
because of check_errors). */ |
| 3167 |
/* The watchpoint has been deleted. */ |
3199 |
/* The watchpoint has been deleted. */ |
|
Lines 7084-7090
watch_command_1 (char *arg, int accessflag, int from_tty)
|
Link Here
|
|---|
|
| 7084 |
struct breakpoint *b, *scope_breakpoint = NULL; |
7116 |
struct breakpoint *b, *scope_breakpoint = NULL; |
| 7085 |
struct expression *exp; |
7117 |
struct expression *exp; |
| 7086 |
struct block *exp_valid_block; |
7118 |
struct block *exp_valid_block; |
| 7087 |
struct value *val, *mark; |
7119 |
struct value *val, *mark, *result; |
| 7088 |
struct frame_info *frame; |
7120 |
struct frame_info *frame; |
| 7089 |
char *exp_start = NULL; |
7121 |
char *exp_start = NULL; |
| 7090 |
char *exp_end = NULL; |
7122 |
char *exp_end = NULL; |
|
Lines 7171-7177
watch_command_1 (char *arg, int accessflag, int from_tty)
|
Link Here
|
|---|
|
| 7171 |
|
7203 |
|
| 7172 |
exp_valid_block = innermost_block; |
7204 |
exp_valid_block = innermost_block; |
| 7173 |
mark = value_mark (); |
7205 |
mark = value_mark (); |
| 7174 |
fetch_watchpoint_value (exp, &val, NULL, NULL); |
7206 |
fetch_watchpoint_value (exp, &val, &result, NULL); |
| 7175 |
if (val != NULL) |
7207 |
if (val != NULL) |
| 7176 |
release_value (val); |
7208 |
release_value (val); |
| 7177 |
|
7209 |
|
|
Lines 7206-7212
watch_command_1 (char *arg, int accessflag, int from_tty)
|
Link Here
|
|---|
|
| 7206 |
mem_cnt = can_use_hardware_watchpoint (val); |
7238 |
mem_cnt = can_use_hardware_watchpoint (val); |
| 7207 |
if (mem_cnt == 0 && bp_type != bp_hardware_watchpoint) |
7239 |
if (mem_cnt == 0 && bp_type != bp_hardware_watchpoint) |
| 7208 |
error (_("Expression cannot be implemented with read/access watchpoint.")); |
7240 |
error (_("Expression cannot be implemented with read/access watchpoint.")); |
| 7209 |
if (mem_cnt != 0) |
7241 |
if (mem_cnt != 0 || !val) |
| 7210 |
{ |
7242 |
{ |
| 7211 |
i = hw_watchpoint_used_count (bp_type, &other_type_used); |
7243 |
i = hw_watchpoint_used_count (bp_type, &other_type_used); |
| 7212 |
target_resources_ok = |
7244 |
target_resources_ok = |
|
Lines 7221-7227
watch_command_1 (char *arg, int accessflag, int from_tty)
|
Link Here
|
|---|
|
| 7221 |
|
7253 |
|
| 7222 |
/* Change the type of breakpoint to an ordinary watchpoint if a hardware |
7254 |
/* Change the type of breakpoint to an ordinary watchpoint if a hardware |
| 7223 |
watchpoint could not be set. */ |
7255 |
watchpoint could not be set. */ |
| 7224 |
if (!mem_cnt || target_resources_ok <= 0) |
7256 |
if ((!mem_cnt && val) || target_resources_ok <= 0) |
| 7225 |
bp_type = bp_watchpoint; |
7257 |
bp_type = bp_watchpoint; |
| 7226 |
|
7258 |
|
| 7227 |
frame = block_innermost_frame (exp_valid_block); |
7259 |
frame = block_innermost_frame (exp_valid_block); |