Skip to content

GuardsAPI ​

cpp
#include <VAmiga.h>
cpp
class GuardsAPI

Defined in VAmiga.h:477

Guards API

Gives access to one list of guards (breakpoints, watchpoints, catchpoints, or beamtraps). The functions that modify the list come in two flavors, following the usual scheme of the API:

  • The plain functions (e.g., setAt()) return when the emulator thread has carried out the request. A failure throws the corresponding exception (e.g., if a guard to remove does not exist). They throw CoreError (CoreError::NOT_LAUNCHED) if the emulator thread cannot carry out the request, because it has not been launched yet, is halted or suspended, or if they are called from the emulator thread itself.
  • The functions with the Async suffix (e.g., setAtAsync()) queue the request and return at once. A failure is not reported to the caller. The change shows up in the query functions only after the emulator thread has carried it out (see sync()).

Public Methods ​

ReturnNameDescription
isizeelements constReturns the number of guards in the guard list.
std::optional< GuardInfo >guardNr constReturns information about a guard.
std::optional< GuardInfo >guardAt constReturns information about a guard.
voidsetAtSets a guard.
voidsetAtAsyncAsynchronous version of setAt(): queues the request and returns at once.
voidmoveToRelocates a guard.
voidmoveToAsyncAsynchronous version of moveTo(): queues the request and returns at once.
voidremoveDeletes a guard.
voidremoveAsyncAsynchronous version of remove(): queues the request and returns at once.
voidremoveAtDeletes a guard.
voidremoveAtAsyncAsynchronous version of removeAt(): queues the request and returns at once.
voidremoveAllDeletes all guards.
voidremoveAllAsyncAsynchronous version of removeAll(): queues the request and returns at once.
voidenableEnables a guard.
voidenableAsyncAsynchronous version of enable(): queues the request and returns at once.
voidenableAtEnables a guard.
voidenableAtAsyncAsynchronous version of enableAt(): queues the request and returns at once.
voidenableAllEnables all guards.
voidenableAllAsyncAsynchronous version of enableAll(): queues the request and returns at once.
voiddisableDisables a guard.
voiddisableAsyncAsynchronous version of disable(): queues the request and returns at once.
voiddisableAtDisables a guard.
voiddisableAtAsyncAsynchronous version of disableAt(): queues the request and returns at once.
voiddisableAllDisables all guards.
voiddisableAllAsyncAsynchronous version of disableAll(): queues the request and returns at once.
voidtoggleEnables a disabled guard and disables an enabled one.
voidtoggleAsyncAsynchronous version of toggle(): queues the request and returns at once.

elements ​

const

cpp
isize elements() const

Defined in VAmiga.h:490

Returns the number of guards in the guard list.


guardNr ​

const

cpp
std::optional< GuardInfo > guardNr(isize nr) const

Defined in VAmiga.h:496

Returns information about a guard.

Returns ​

A copy of the guard's state, or nothing if it does not exist.

Parameters ​

ParameterTypeDescription
nrisizeNumber of the guard in the guard list

guardAt ​

const

cpp
std::optional< GuardInfo > guardAt(u32 target) const

Defined in VAmiga.h:502

Returns information about a guard.

Returns ​

A copy of the guard's state, or nothing if the target is not guarded.

Parameters ​

ParameterTypeDescription
targetu32The target of the guard to query

setAt ​

cpp
void setAt(u32 target, isize ignores = 0)

Defined in VAmiga.h:508

Sets a guard.

Parameters ​

ParameterTypeDescription
targetu32The observed target. For breakpoints and watchpoints, the target is a memory address. For catchpoints, the target is a vector number (interrupts or traps).
ignoresisizeIf a value greater zero is given, the guard has to be hit the specified number of times until program execution is paused.

setAtAsync ​

cpp
void setAtAsync(u32 target, isize ignores = 0)

Defined in VAmiga.h:511

Asynchronous version of setAt(): queues the request and returns at once.


moveTo ​

cpp
void moveTo(isize nr, u32 target)

Defined in VAmiga.h:517

Relocates a guard.

Parameters ​

ParameterTypeDescription
nrisizeNumber of the guard in the guard list
targetu32New target

moveToAsync ​

cpp
void moveToAsync(isize nr, u32 target)

Defined in VAmiga.h:520

Asynchronous version of moveTo(): queues the request and returns at once.


remove ​

cpp
void remove(isize nr)

Defined in VAmiga.h:525

Deletes a guard.

Parameters ​

ParameterTypeDescription
nrisizeNumber of the guard in the guard list

removeAsync ​

cpp
void removeAsync(isize nr)

Defined in VAmiga.h:528

Asynchronous version of remove(): queues the request and returns at once.


removeAt ​

cpp
void removeAt(u32 target)

Defined in VAmiga.h:533

Deletes a guard.

Parameters ​

ParameterTypeDescription
targetu32The target of the guard to be deleted.

removeAtAsync ​

cpp
void removeAtAsync(u32 target)

Defined in VAmiga.h:536

Asynchronous version of removeAt(): queues the request and returns at once.


removeAll ​

cpp
void removeAll()

Defined in VAmiga.h:540

Deletes all guards.


removeAllAsync ​

cpp
void removeAllAsync()

Defined in VAmiga.h:543

Asynchronous version of removeAll(): queues the request and returns at once.


enable ​

cpp
void enable(isize nr)

Defined in VAmiga.h:548

Enables a guard.

Parameters ​

ParameterTypeDescription
nrisizeNumber of the guard in the guard list

enableAsync ​

cpp
void enableAsync(isize nr)

Defined in VAmiga.h:551

Asynchronous version of enable(): queues the request and returns at once.


enableAt ​

cpp
void enableAt(u32 target)

Defined in VAmiga.h:556

Enables a guard.

Parameters ​

ParameterTypeDescription
targetu32The target of the guard to be enabled

enableAtAsync ​

cpp
void enableAtAsync(u32 target)

Defined in VAmiga.h:559

Asynchronous version of enableAt(): queues the request and returns at once.


enableAll ​

cpp
void enableAll()

Defined in VAmiga.h:563

Enables all guards.


enableAllAsync ​

cpp
void enableAllAsync()

Defined in VAmiga.h:566

Asynchronous version of enableAll(): queues the request and returns at once.


disable ​

cpp
void disable(isize nr)

Defined in VAmiga.h:571

Disables a guard.

Parameters ​

ParameterTypeDescription
nrisizeNumber of the guard in the guard list

disableAsync ​

cpp
void disableAsync(isize nr)

Defined in VAmiga.h:574

Asynchronous version of disable(): queues the request and returns at once.


disableAt ​

cpp
void disableAt(u32 target)

Defined in VAmiga.h:579

Disables a guard.

Parameters ​

ParameterTypeDescription
targetu32The target of the guard to be disabled

disableAtAsync ​

cpp
void disableAtAsync(u32 target)

Defined in VAmiga.h:582

Asynchronous version of disableAt(): queues the request and returns at once.


disableAll ​

cpp
void disableAll()

Defined in VAmiga.h:586

Disables all guards.


disableAllAsync ​

cpp
void disableAllAsync()

Defined in VAmiga.h:589

Asynchronous version of disableAll(): queues the request and returns at once.


toggle ​

cpp
void toggle(isize nr)

Defined in VAmiga.h:594

Enables a disabled guard and disables an enabled one.

Parameters ​

ParameterTypeDescription
nrisizeNumber of the guard in the guard list

toggleAsync ​

cpp
void toggleAsync(isize nr)

Defined in VAmiga.h:597

Asynchronous version of toggle(): queues the request and returns at once.