Appearance
GuardsAPI
cpp
#include <VAmiga.h>cpp
class GuardsAPIDefined 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
| Return | Name | Description |
|---|---|---|
isize | elements const | Returns the number of guards in the guard list. |
std::optional< GuardInfo > | guardNr const | Returns information about a guard. |
std::optional< GuardInfo > | guardAt const | Returns information about a guard. |
void | setAt | Sets a guard. |
void | setAtAsync | Asynchronous version of setAt(): queues the request and returns at once. |
void | moveTo | Relocates a guard. |
void | moveToAsync | Asynchronous version of moveTo(): queues the request and returns at once. |
void | remove | Deletes a guard. |
void | removeAsync | Asynchronous version of remove(): queues the request and returns at once. |
void | removeAt | Deletes a guard. |
void | removeAtAsync | Asynchronous version of removeAt(): queues the request and returns at once. |
void | removeAll | Deletes all guards. |
void | removeAllAsync | Asynchronous version of removeAll(): queues the request and returns at once. |
void | enable | Enables a guard. |
void | enableAsync | Asynchronous version of enable(): queues the request and returns at once. |
void | enableAt | Enables a guard. |
void | enableAtAsync | Asynchronous version of enableAt(): queues the request and returns at once. |
void | enableAll | Enables all guards. |
void | enableAllAsync | Asynchronous version of enableAll(): queues the request and returns at once. |
void | disable | Disables a guard. |
void | disableAsync | Asynchronous version of disable(): queues the request and returns at once. |
void | disableAt | Disables a guard. |
void | disableAtAsync | Asynchronous version of disableAt(): queues the request and returns at once. |
void | disableAll | Disables all guards. |
void | disableAllAsync | Asynchronous version of disableAll(): queues the request and returns at once. |
void | toggle | Enables a disabled guard and disables an enabled one. |
void | toggleAsync | Asynchronous version of toggle(): queues the request and returns at once. |
elements
const
cpp
isize elements() constDefined in VAmiga.h:490
Returns the number of guards in the guard list.
guardNr
const
cpp
std::optional< GuardInfo > guardNr(isize nr) constDefined 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
| Parameter | Type | Description |
|---|---|---|
nr | isize | Number of the guard in the guard list |
guardAt
const
cpp
std::optional< GuardInfo > guardAt(u32 target) constDefined 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
| Parameter | Type | Description |
|---|---|---|
target | u32 | The target of the guard to query |
setAt
cpp
void setAt(u32 target, isize ignores = 0)Defined in VAmiga.h:508
Sets a guard.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | u32 | The observed target. For breakpoints and watchpoints, the target is a memory address. For catchpoints, the target is a vector number (interrupts or traps). |
ignores | isize | If 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
| Parameter | Type | Description |
|---|---|---|
nr | isize | Number of the guard in the guard list |
target | u32 | New 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
| Parameter | Type | Description |
|---|---|---|
nr | isize | Number 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
| Parameter | Type | Description |
|---|---|---|
target | u32 | The 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
| Parameter | Type | Description |
|---|---|---|
nr | isize | Number 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
| Parameter | Type | Description |
|---|---|---|
target | u32 | The 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
| Parameter | Type | Description |
|---|---|---|
nr | isize | Number 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
| Parameter | Type | Description |
|---|---|---|
target | u32 | The 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
| Parameter | Type | Description |
|---|---|---|
nr | isize | Number 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.