OpenOCD
breakpoints.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * Copyright (C) 2005 by Dominic Rath *
5  * Dominic.Rath@gmx.de *
6  * *
7  * Copyright (C) ST-Ericsson SA 2011 *
8  * michel.jaouen@stericsson.com : smp minimum support *
9  ***************************************************************************/
10 
11 #ifdef HAVE_CONFIG_H
12 #include "config.h"
13 #endif
14 
15 #include "target.h"
16 #include <helper/log.h>
17 #include "breakpoints.h"
18 #include "smp.h"
19 #include "helper/util.h"
20 
24 };
25 
26 static const char * const breakpoint_type_strings[] = {
27  "hardware",
28  "software"
29 };
30 
31 static const char * const watchpoint_rw_strings[] = {
32  "read",
33  "write",
34  "access"
35 };
36 
37 /* monotonic counter/id-number for breakpoints and watch points */
38 static int bpwp_unique_id;
39 
40 COMMAND_HELPER(detect_breakpoints_in_section, struct target *target,
41  struct imagesection section)
42 {
44  uint32_t length = section.size;
45  bool found_breakpoint = false;
46 
47  for (struct breakpoint *bp = target->breakpoints; bp; bp = bp->next)
48  if (is_memory_regions_overlap(start, length, bp->address, bp->length)) {
49  found_breakpoint = true;
50  command_print(cmd, "conflicting breakpoint at address: "
51  TARGET_ADDR_FMT, bp->address);
52  }
53 
54  return found_breakpoint ? ERROR_FAIL : ERROR_OK;
55 }
56 
59  unsigned int length,
60  enum breakpoint_type type)
61 {
63  struct breakpoint **breakpoint_p = &target->breakpoints;
64  const char *reason;
65  int retval;
66 
67  while (breakpoint) {
68  if (breakpoint->address == address) {
69  /* FIXME don't assume "same address" means "same
70  * breakpoint" ... check all the parameters before
71  * succeeding.
72  */
73  LOG_TARGET_ERROR(target, "Duplicate Breakpoint address: " TARGET_ADDR_FMT " (BP %" PRIu32 ")",
76  }
77  if (type == BKPT_SOFT &&
79  LOG_TARGET_ERROR(target, "Breakpoint overlaps another one at " TARGET_ADDR_FMT
80  " of length %u (BP %" PRIu32 ")", breakpoint->address,
83  }
84  breakpoint_p = &breakpoint->next;
86  }
87 
88  (*breakpoint_p) = malloc(sizeof(struct breakpoint));
89  (*breakpoint_p)->address = address;
90  (*breakpoint_p)->asid = 0;
91  (*breakpoint_p)->length = length;
92  (*breakpoint_p)->type = type;
93  (*breakpoint_p)->is_set = false;
94  (*breakpoint_p)->orig_instr = malloc(length);
95  (*breakpoint_p)->next = NULL;
96  (*breakpoint_p)->unique_id = bpwp_unique_id++;
97 
98  retval = target_add_breakpoint(target, *breakpoint_p);
99  switch (retval) {
100  case ERROR_OK:
101  break;
103  reason = "resource not available";
104  goto fail;
106  reason = "target not halted";
107  goto fail;
108  default:
109  reason = "unknown reason";
110 fail:
111  LOG_TARGET_ERROR(target, "can't add breakpoint: %s", reason);
112  free((*breakpoint_p)->orig_instr);
113  free(*breakpoint_p);
114  *breakpoint_p = NULL;
115  return retval;
116  }
117 
118  LOG_TARGET_DEBUG(target, "added %s breakpoint at " TARGET_ADDR_FMT
119  " of length 0x%8.8x, (BPID: %" PRIu32 ")",
120  breakpoint_type_strings[(*breakpoint_p)->type],
121  (*breakpoint_p)->address, (*breakpoint_p)->length,
122  (*breakpoint_p)->unique_id);
123 
124  return ERROR_OK;
125 }
126 
128  uint32_t asid,
129  unsigned int length,
130  enum breakpoint_type type)
131 {
133  struct breakpoint **breakpoint_p = &target->breakpoints;
134  int retval;
135 
136  while (breakpoint) {
137  if (breakpoint->asid == asid) {
138  /* FIXME don't assume "same address" means "same
139  * breakpoint" ... check all the parameters before
140  * succeeding.
141  */
142  LOG_TARGET_ERROR(target, "Duplicate Breakpoint asid: 0x%08" PRIx32 " (BP %" PRIu32 ")",
145  }
146  breakpoint_p = &breakpoint->next;
148  }
149 
150  (*breakpoint_p) = malloc(sizeof(struct breakpoint));
151  (*breakpoint_p)->address = 0;
152  (*breakpoint_p)->asid = asid;
153  (*breakpoint_p)->length = length;
154  (*breakpoint_p)->type = type;
155  (*breakpoint_p)->is_set = false;
156  (*breakpoint_p)->orig_instr = malloc(length);
157  (*breakpoint_p)->next = NULL;
158  (*breakpoint_p)->unique_id = bpwp_unique_id++;
159  retval = target_add_context_breakpoint(target, *breakpoint_p);
160  if (retval != ERROR_OK) {
161  LOG_TARGET_ERROR(target, "could not add breakpoint");
162  free((*breakpoint_p)->orig_instr);
163  free(*breakpoint_p);
164  *breakpoint_p = NULL;
165  return retval;
166  }
167 
168  LOG_TARGET_DEBUG(target, "added %s Context breakpoint at 0x%8.8" PRIx32 " of length 0x%8.8x, (BPID: %" PRIu32 ")",
169  breakpoint_type_strings[(*breakpoint_p)->type],
170  (*breakpoint_p)->asid, (*breakpoint_p)->length,
171  (*breakpoint_p)->unique_id);
172 
173  return ERROR_OK;
174 }
175 
178  uint32_t asid,
179  unsigned int length,
180  enum breakpoint_type type)
181 {
183  struct breakpoint **breakpoint_p = &target->breakpoints;
184  int retval;
185 
186  while (breakpoint) {
187  if ((breakpoint->asid == asid) && (breakpoint->address == address)) {
188  /* FIXME don't assume "same address" means "same
189  * breakpoint" ... check all the parameters before
190  * succeeding.
191  */
192  LOG_TARGET_ERROR(target, "Duplicate Hybrid Breakpoint asid: 0x%08" PRIx32 " (BP %" PRIu32 ")",
195  } else if ((breakpoint->address == address) && (breakpoint->asid == 0)) {
196  LOG_TARGET_ERROR(target, "Duplicate Breakpoint IVA: " TARGET_ADDR_FMT " (BP %" PRIu32 ")",
199 
200  }
201  breakpoint_p = &breakpoint->next;
203  }
204  (*breakpoint_p) = malloc(sizeof(struct breakpoint));
205  (*breakpoint_p)->address = address;
206  (*breakpoint_p)->asid = asid;
207  (*breakpoint_p)->length = length;
208  (*breakpoint_p)->type = type;
209  (*breakpoint_p)->is_set = false;
210  (*breakpoint_p)->orig_instr = malloc(length);
211  (*breakpoint_p)->next = NULL;
212  (*breakpoint_p)->unique_id = bpwp_unique_id++;
213 
214 
215  retval = target_add_hybrid_breakpoint(target, *breakpoint_p);
216  if (retval != ERROR_OK) {
217  LOG_TARGET_ERROR(target, "could not add breakpoint");
218  free((*breakpoint_p)->orig_instr);
219  free(*breakpoint_p);
220  *breakpoint_p = NULL;
221  return retval;
222  }
224  "added %s Hybrid breakpoint at address " TARGET_ADDR_FMT " of length 0x%8.8x, (BPID: %" PRIu32 ")",
225  breakpoint_type_strings[(*breakpoint_p)->type],
226  (*breakpoint_p)->address,
227  (*breakpoint_p)->length,
228  (*breakpoint_p)->unique_id);
229 
230  return ERROR_OK;
231 }
232 
235  unsigned int length,
236  enum breakpoint_type type)
237 {
238  if (target->smp && type == BKPT_HARD) {
239  struct target_list *list_node;
240  foreach_smp_target(list_node, target->smp_targets) {
241  struct target *curr = list_node->target;
242  int retval = breakpoint_add_internal(curr, address, length, type);
243  if (retval != ERROR_OK)
244  return retval;
245  }
246 
247  return ERROR_OK;
248  } else {
250  }
251 }
252 
254  uint32_t asid,
255  unsigned int length,
256  enum breakpoint_type type)
257 {
258  if (target->smp) {
259  struct target_list *head;
260 
262  struct target *curr = head->target;
263  int retval = context_breakpoint_add_internal(curr, asid, length, type);
264  if (retval != ERROR_OK)
265  return retval;
266  }
267 
268  return ERROR_OK;
269  } else {
271  }
272 }
273 
276  uint32_t asid,
277  unsigned int length,
278  enum breakpoint_type type)
279 {
280  if (target->smp) {
281  struct target_list *head;
282 
284  struct target *curr = head->target;
285  int retval = hybrid_breakpoint_add_internal(curr, address, asid, length, type);
286  if (retval != ERROR_OK)
287  return retval;
288  }
289 
290  return ERROR_OK;
291  } else
293 }
294 
295 /* free up a breakpoint */
296 static int breakpoint_free(struct target *target, struct breakpoint *breakpoint_to_remove)
297 {
299  struct breakpoint **breakpoint_p = &target->breakpoints;
300  int retval;
301 
302  while (breakpoint) {
303  if (breakpoint == breakpoint_to_remove)
304  break;
305  breakpoint_p = &breakpoint->next;
307  }
308 
309  if (!breakpoint)
310  return ERROR_OK;
311 
313  if (retval != ERROR_OK) {
314  LOG_TARGET_ERROR(target, "could not remove breakpoint #%d on this target",
315  breakpoint->number);
316  return retval;
317  }
318 
319  LOG_TARGET_DEBUG(target, "free BPID: %" PRIu32 " --> %d", breakpoint->unique_id, retval);
320  (*breakpoint_p) = breakpoint->next;
321  free(breakpoint->orig_instr);
322  free(breakpoint);
323 
324  return ERROR_OK;
325 }
326 
328 {
330 
331  while (breakpoint) {
332  if ((breakpoint->address == address) ||
333  (breakpoint->address == 0 && breakpoint->asid == address))
334  break;
336  }
337 
338  if (breakpoint) {
340  } else {
342  }
343 }
344 
346 {
347  LOG_TARGET_DEBUG(target, "Delete all breakpoints");
348 
350  int retval = ERROR_OK;
351 
352  while (breakpoint) {
353  struct breakpoint *tmp = breakpoint;
355  int status = breakpoint_free(target, tmp);
356  if (status != ERROR_OK)
357  retval = status;
358  }
359 
360  return retval;
361 }
362 
364 {
365  int retval = ERROR_OK;
366  unsigned int num_found_breakpoints = 0;
367  if (target->smp) {
368  struct target_list *head;
369 
371  struct target *curr = head->target;
373 
375  num_found_breakpoints++;
376 
377  if (status != ERROR_OK) {
378  LOG_TARGET_ERROR(curr, "failed to remove breakpoint at address " TARGET_ADDR_FMT, address);
379  retval = status;
380  }
381  }
382  }
383 
384  } else {
386 
387  if (retval != ERROR_BREAKPOINT_NOT_FOUND) {
388  num_found_breakpoints++;
389 
390  if (retval != ERROR_OK)
391  LOG_TARGET_ERROR(target, "failed to remove breakpoint at address " TARGET_ADDR_FMT, address);
392  }
393  }
394 
395  if (num_found_breakpoints == 0) {
396  LOG_TARGET_ERROR(target, "no breakpoint at address " TARGET_ADDR_FMT " found", address);
398  }
399 
400  return retval;
401 }
402 
403 static int watchpoint_free(struct target *target, struct watchpoint *watchpoint_to_remove)
404 {
406  struct watchpoint **watchpoint_p = &target->watchpoints;
407  int retval;
408 
409  while (watchpoint) {
410  if (watchpoint == watchpoint_to_remove)
411  break;
412  watchpoint_p = &watchpoint->next;
414  }
415 
416  if (!watchpoint)
417  return ERROR_OK;
419  if (retval != ERROR_OK) {
420  LOG_TARGET_ERROR(target, "could not remove watchpoint #%d on this target",
421  watchpoint->number);
422  return retval;
423  }
424 
425  LOG_TARGET_DEBUG(target, "free WPID: %d --> %d", watchpoint->unique_id, retval);
426  (*watchpoint_p) = watchpoint->next;
427  free(watchpoint);
428 
429  return ERROR_OK;
430 }
431 
433 {
434  LOG_TARGET_DEBUG(target, "Delete all watchpoints");
435 
437  int retval = ERROR_OK;
438 
439  while (watchpoint) {
440  struct watchpoint *tmp = watchpoint;
442  int status = watchpoint_free(target, tmp);
443  if (status != ERROR_OK)
444  retval = status;
445  }
446 
447  return retval;
448 }
449 
451 {
452  assert(bp_wp == BREAKPOINT || bp_wp == WATCHPOINT);
453  int retval = ERROR_OK;
454  if (target->smp) {
455  struct target_list *head;
456 
458  struct target *curr = head->target;
459 
460  int status = ERROR_OK;
461  if (bp_wp == BREAKPOINT)
463  else
465 
466  if (status != ERROR_OK)
467  retval = status;
468  }
469  } else {
470  if (bp_wp == BREAKPOINT)
472  else
474  }
475 
476  return retval;
477 }
478 
480 {
482 }
483 
485 {
487 }
488 
490 {
492 
493  while (breakpoint) {
494  if (breakpoint->address == address)
495  return breakpoint;
497  }
498 
499  return NULL;
500 }
501 
503  unsigned int length, enum watchpoint_rw rw, uint64_t value, uint64_t mask)
504 {
506  struct watchpoint **watchpoint_p = &target->watchpoints;
507  int retval;
508  const char *reason;
509 
510  while (watchpoint) {
511  if (watchpoint->address == address) {
512  if (watchpoint->length != length
513  || watchpoint->value != value
514  || watchpoint->mask != mask
515  || watchpoint->rw != rw) {
517  " already has watchpoint %d",
519  return ERROR_FAIL;
520  }
521 
522  /* ignore duplicate watchpoint */
523  return ERROR_OK;
524  }
525  watchpoint_p = &watchpoint->next;
527  }
528 
529  (*watchpoint_p) = calloc(1, sizeof(struct watchpoint));
530  (*watchpoint_p)->address = address;
531  (*watchpoint_p)->length = length;
532  (*watchpoint_p)->value = value;
533  (*watchpoint_p)->mask = mask;
534  (*watchpoint_p)->rw = rw;
535  (*watchpoint_p)->unique_id = bpwp_unique_id++;
536 
537  retval = target_add_watchpoint(target, *watchpoint_p);
538  switch (retval) {
539  case ERROR_OK:
540  break;
542  reason = "resource not available";
543  goto bye;
545  reason = "target not halted";
546  goto bye;
547  default:
548  reason = "unrecognized error";
549 bye:
550  LOG_TARGET_ERROR(target, "can't add %s watchpoint at " TARGET_ADDR_FMT ", %s",
551  watchpoint_rw_strings[(*watchpoint_p)->rw],
552  address, reason);
553  free(*watchpoint_p);
554  *watchpoint_p = NULL;
555  return retval;
556  }
557 
558  LOG_TARGET_DEBUG(target, "added %s watchpoint at " TARGET_ADDR_FMT
559  " of length 0x%8.8x (WPID: %d)",
560  watchpoint_rw_strings[(*watchpoint_p)->rw],
561  (*watchpoint_p)->address,
562  (*watchpoint_p)->length,
563  (*watchpoint_p)->unique_id);
564 
565  return ERROR_OK;
566 }
567 
569  unsigned int length, enum watchpoint_rw rw, uint64_t value, uint64_t mask)
570 {
571  if (target->smp) {
572  struct target_list *head;
573 
575  struct target *curr = head->target;
576  int retval = watchpoint_add_internal(curr, address, length, rw, value, mask);
577  if (retval != ERROR_OK)
578  return retval;
579  }
580 
581  return ERROR_OK;
582  } else {
583  return watchpoint_add_internal(target, address, length, rw, value,
584  mask);
585  }
586 }
587 
589 {
591 
592  while (watchpoint) {
593  if (watchpoint->address == address)
594  break;
596  }
597 
598  if (watchpoint) {
600  } else {
602  }
603 }
604 
606 {
607  int retval = ERROR_OK;
608  unsigned int num_found_watchpoints = 0;
609  if (target->smp) {
610  struct target_list *head;
611 
613  struct target *curr = head->target;
615 
617  num_found_watchpoints++;
618 
619  if (status != ERROR_OK) {
620  LOG_TARGET_ERROR(curr, "failed to remove watchpoint at address " TARGET_ADDR_FMT, address);
621  retval = status;
622  }
623  }
624  }
625  } else {
627 
628  if (retval != ERROR_WATCHPOINT_NOT_FOUND) {
629  num_found_watchpoints++;
630 
631  if (retval != ERROR_OK)
632  LOG_TARGET_ERROR(target, "failed to remove watchpoint at address " TARGET_ADDR_FMT, address);
633  }
634  }
635 
636  if (num_found_watchpoints == 0) {
637  LOG_TARGET_ERROR(target, "no watchpoint at address " TARGET_ADDR_FMT " found", address);
639  }
640 
641  return retval;
642 }
643 
646 {
647  int retval;
648  struct watchpoint *hit_watchpoint;
649 
650  retval = target_hit_watchpoint(target, &hit_watchpoint);
651  if (retval == ERROR_NOT_IMPLEMENTED
653  // Handle the trivial case: only one watchpoint is set
654  unsigned int cnt = 0;
655  struct watchpoint *wp = target->watchpoints;
656  while (wp) {
657  cnt++;
658  wp = wp->next;
659  }
660  if (cnt == 1) {
661  retval = ERROR_OK;
662  hit_watchpoint = target->watchpoints;
663  }
664  }
665  if (retval != ERROR_OK)
666  return ERROR_FAIL;
667 
668  *rw = hit_watchpoint->rw;
669  *address = hit_watchpoint->address;
670 
671  LOG_TARGET_DEBUG(target, "Found hit watchpoint at " TARGET_ADDR_FMT " (WPID: %d)",
672  hit_watchpoint->address,
673  hit_watchpoint->unique_id);
674 
675  return ERROR_OK;
676 }
static const char *const watchpoint_rw_strings[]
Definition: breakpoints.c:31
int watchpoint_add(struct target *target, target_addr_t address, unsigned int length, enum watchpoint_rw rw, uint64_t value, uint64_t mask)
Definition: breakpoints.c:568
static int breakpoint_watchpoint_remove_all(struct target *target, enum breakpoint_watchpoint bp_wp)
Definition: breakpoints.c:450
COMMAND_HELPER(detect_breakpoints_in_section, struct target *target, struct imagesection section)
Definition: breakpoints.c:40
static int watchpoint_free(struct target *target, struct watchpoint *watchpoint_to_remove)
Definition: breakpoints.c:403
static int breakpoint_add_internal(struct target *target, target_addr_t address, unsigned int length, enum breakpoint_type type)
Definition: breakpoints.c:57
int breakpoint_remove(struct target *target, target_addr_t address)
Definition: breakpoints.c:363
static int watchpoint_add_internal(struct target *target, target_addr_t address, unsigned int length, enum watchpoint_rw rw, uint64_t value, uint64_t mask)
Definition: breakpoints.c:502
int watchpoint_hit(struct target *target, enum watchpoint_rw *rw, target_addr_t *address)
Definition: breakpoints.c:644
static int breakpoint_remove_internal(struct target *target, target_addr_t address)
Definition: breakpoints.c:327
static int context_breakpoint_add_internal(struct target *target, uint32_t asid, unsigned int length, enum breakpoint_type type)
Definition: breakpoints.c:127
int watchpoint_remove(struct target *target, target_addr_t address)
Definition: breakpoints.c:605
int breakpoint_add(struct target *target, target_addr_t address, unsigned int length, enum breakpoint_type type)
Definition: breakpoints.c:233
static int bpwp_unique_id
Definition: breakpoints.c:38
breakpoint_watchpoint
Definition: breakpoints.c:21
@ WATCHPOINT
Definition: breakpoints.c:23
@ BREAKPOINT
Definition: breakpoints.c:22
static const char *const breakpoint_type_strings[]
Definition: breakpoints.c:26
int context_breakpoint_add(struct target *target, uint32_t asid, unsigned int length, enum breakpoint_type type)
Definition: breakpoints.c:253
static int watchpoint_remove_internal(struct target *target, target_addr_t address)
Definition: breakpoints.c:588
static int breakpoint_free(struct target *target, struct breakpoint *breakpoint_to_remove)
Definition: breakpoints.c:296
int watchpoint_remove_all(struct target *target)
Definition: breakpoints.c:484
int breakpoint_remove_all(struct target *target)
Definition: breakpoints.c:479
static int hybrid_breakpoint_add_internal(struct target *target, target_addr_t address, uint32_t asid, unsigned int length, enum breakpoint_type type)
Definition: breakpoints.c:176
static int breakpoint_remove_all_internal(struct target *target)
Definition: breakpoints.c:345
int hybrid_breakpoint_add(struct target *target, target_addr_t address, uint32_t asid, unsigned int length, enum breakpoint_type type)
Definition: breakpoints.c:274
static int watchpoint_remove_all_internal(struct target *target)
Definition: breakpoints.c:432
struct breakpoint * breakpoint_find(struct target *target, target_addr_t address)
Definition: breakpoints.c:489
breakpoint_type
Definition: breakpoints.h:19
@ BKPT_HARD
Definition: breakpoints.h:20
@ BKPT_SOFT
Definition: breakpoints.h:21
#define ERROR_BREAKPOINT_OVERLAPPED
Definition: breakpoints.h:95
#define ERROR_BREAKPOINT_DUPLICATED
Definition: breakpoints.h:94
#define ERROR_WATCHPOINT_NOT_FOUND
Definition: breakpoints.h:93
#define ERROR_BREAKPOINT_NOT_FOUND
Definition: breakpoints.h:92
watchpoint_rw
Definition: breakpoints.h:24
void command_print(struct command_invocation *cmd, const char *format,...)
Definition: command.c:389
uint32_t address
Starting address. Sector aligned.
Definition: dw-spi-helper.h:0
uint8_t type
Definition: esp_usb_jtag.c:0
uint8_t length
Definition: esp_usb_jtag.c:1
static int64_t start
Definition: log.c:38
#define ERROR_NOT_IMPLEMENTED
Definition: log.h:192
#define ERROR_FAIL
Definition: log.h:188
#define LOG_TARGET_ERROR(target, fmt_str,...)
Definition: log.h:176
#define LOG_TARGET_DEBUG(target, fmt_str,...)
Definition: log.h:164
#define ERROR_OK
Definition: log.h:182
uint8_t mask
Definition: parport.c:70
#define foreach_smp_target(pos, head)
Definition: smp.h:15
struct breakpoint * next
Definition: breakpoints.h:36
unsigned int length
Definition: breakpoints.h:31
uint8_t * orig_instr
Definition: breakpoints.h:35
uint32_t unique_id
Definition: breakpoints.h:37
unsigned int number
Definition: breakpoints.h:34
uint32_t asid
Definition: breakpoints.h:30
target_addr_t address
Definition: breakpoints.h:29
target_addr_t base_address
Definition: image.h:42
uint32_t size
Definition: image.h:43
struct target * target
Definition: target.h:228
Definition: target.h:119
enum target_debug_reason debug_reason
Definition: target.h:164
struct list_head * smp_targets
Definition: target.h:202
struct breakpoint * breakpoints
Definition: target.h:169
bool smp
Definition: target.h:200
struct watchpoint * watchpoints
Definition: target.h:170
uint64_t mask
Definition: breakpoints.h:46
enum watchpoint_rw rw
Definition: breakpoints.h:48
struct watchpoint * next
Definition: breakpoints.h:51
unsigned int length
Definition: breakpoints.h:45
uint64_t value
Definition: breakpoints.h:47
int unique_id
Definition: breakpoints.h:52
unsigned int number
Definition: breakpoints.h:50
target_addr_t address
Definition: breakpoints.h:44
int target_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
Add the watchpoint for target.
Definition: target.c:1353
int target_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
Remove the breakpoint for target.
Definition: target.c:1347
int target_add_hybrid_breakpoint(struct target *target, struct breakpoint *breakpoint)
Add the ContextID & IVA breakpoint for target.
Definition: target.c:1337
int target_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
Add the breakpoint for target.
Definition: target.c:1317
int target_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
Find out the just hit watchpoint for target.
Definition: target.c:1367
int target_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
Remove the watchpoint for target.
Definition: target.c:1362
int target_add_context_breakpoint(struct target *target, struct breakpoint *breakpoint)
Add the ContextID breakpoint for target.
Definition: target.c:1327
@ DBG_REASON_WATCHPOINT
Definition: target.h:74
#define ERROR_TARGET_NOT_HALTED
Definition: target.h:818
#define ERROR_TARGET_RESOURCE_NOT_AVAILABLE
Definition: target.h:822
#define TARGET_ADDR_FMT
Definition: types.h:286
uint64_t target_addr_t
Definition: types.h:279
#define NULL
Definition: usb.h:16
bool is_memory_regions_overlap(target_addr_t start1, unsigned int size1, target_addr_t start2, unsigned int size2)
Definition: util.c:44
uint8_t status[4]
Definition: vdebug.c:17
uint8_t cmd
Definition: vdebug.c:1