Simple Virtual Machine
A simple but flexible virtual machine
SVM debugger form

This module contains API functions to handle SVM debugger forms. More...

Functions

SVM_FUNCTION SVM_Debug_Form svm_debug_form_new (const void *svm, const char *title)
 This function creates a debugger form. More...
 
SVM_FUNCTION void svm_debug_form_append_checkbox (const void *svm, SVM_Debug_Form form, const char *label, const SVM_Value_Boolean default_value)
 This function appends to a debugger form a checkbox field. More...
 
SVM_FUNCTION void svm_debug_form_append_checkbox__raw (const void *svm, SVM_Debug_Form form, const char *label, const int default_value)
 This function appends to a debugger form a checkbox field. More...
 
SVM_FUNCTION void svm_debug_form_append_selection (const void *svm, SVM_Debug_Form form, const char *label, const SVM_Size size, const SVM_Value *values)
 This function appends to a debugger form a list of selection field. More...
 
SVM_FUNCTION void svm_debug_form_append_integer (const void *svm, SVM_Debug_Form form, const char *label, const SVM_Value_Integer default_value, const long long int min_value, const long long int max_value)
 This function appends to a debugger form an input field accepting integers. More...
 
SVM_FUNCTION void svm_debug_form_append_integer__raw (const void *svm, SVM_Debug_Form form, const char *label, const long long int default_value, const long long int min_value, const long long int max_value)
 This function appends to a debugger form an input field accepting integers. More...
 
SVM_FUNCTION void svm_debug_form_append_string (const void *svm, SVM_Debug_Form form, const char *label, const SVM_Value_String default_value, const SVM_Size min_size, const SVM_Size max_size)
 This function appends to a debugger form an input field accepting strings. More...
 
SVM_FUNCTION void svm_debug_form_append_string__string (const void *svm, SVM_Debug_Form form, const char *label, const SVM_String default_value, const SVM_Size min_size, const SVM_Size max_size)
 This function appends to a debugger form an input field accepting strings. More...
 
SVM_FUNCTION void svm_debug_form_append_string__raw (const void *svm, SVM_Debug_Form form, const char *label, const char *default_value, const SVM_Size min_size, const SVM_Size max_size)
 This function appends to a debugger form an input field accepting strings. More...
 
SVM_FUNCTION void svm_debug_form_append_text (const void *svm, SVM_Debug_Form form, const char *label, const SVM_Size width, const SVM_Size height)
 This function appends to a debugger form an input field accepting long multi-line strings. More...
 
SVM_FUNCTION SVM_Valuesvm_debug_form_request (const void *svm, const SVM_Debug_Form form)
 This function sends the form to the debugger user interface, and waits for the form submission. More...
 

Detailed Description

This module contains API functions to handle SVM debugger forms.

Function Documentation

◆ svm_debug_form_append_checkbox()

SVM_FUNCTION void svm_debug_form_append_checkbox ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const SVM_Value_Boolean  default_value 
)

This function appends to a debugger form a checkbox field.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]default_valueThe initial state of the field value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_append_checkbox__raw()

SVM_FUNCTION void svm_debug_form_append_checkbox__raw ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const int  default_value 
)

This function appends to a debugger form a checkbox field.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]default_valueThe initial state of the field value.

The default value can also be a SVM_Boolean.

Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_append_integer()

SVM_FUNCTION void svm_debug_form_append_integer ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const SVM_Value_Integer  default_value,
const long long int  min_value,
const long long int  max_value 
)

This function appends to a debugger form an input field accepting integers.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]default_valueThe initial value of the field value.
[in]min_valueThe minimal value to be accepted in the form.
[in]max_valueThe maximal value to be accepted in the form.
Note
When the maximal value is inferior to the minimal value, the boundary check is disabled.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_append_integer__raw()

SVM_FUNCTION void svm_debug_form_append_integer__raw ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const long long int  default_value,
const long long int  min_value,
const long long int  max_value 
)

This function appends to a debugger form an input field accepting integers.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]default_valueThe initial value of the field value.
[in]min_valueThe minimal value to be accepted in the form.
[in]max_valueThe maximal value to be accepted in the form.
Note
When the maximal value is inferior to the minimal value, the boundary check is disabled.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_append_selection()

SVM_FUNCTION void svm_debug_form_append_selection ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const SVM_Size  size,
const SVM_Value values 
)

This function appends to a debugger form a list of selection field.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]sizeThe number of enumerated values.
[in]valuesThe enumerated values.

The default value is the first one in the array.

Warning
If the values size is smaller than size, it will result in an undefined behavior.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
See also
svm_value_array_new

◆ svm_debug_form_append_string()

SVM_FUNCTION void svm_debug_form_append_string ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const SVM_Value_String  default_value,
const SVM_Size  min_size,
const SVM_Size  max_size 
)

This function appends to a debugger form an input field accepting strings.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]default_valueThe initial value of the field value.
[in]min_sizeThe minimal value to be accepted in the form.
[in]max_sizeThe maximal value to be accepted in the form.
Note
When the maximal value is inferior to the minimal value, the size check is disabled.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_append_string__raw()

SVM_FUNCTION void svm_debug_form_append_string__raw ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const char *  default_value,
const SVM_Size  min_size,
const SVM_Size  max_size 
)

This function appends to a debugger form an input field accepting strings.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]default_valueThe initial value of the field value.
[in]min_sizeThe minimal value to be accepted in the form.
[in]max_sizeThe maximal value to be accepted in the form.
Note
When the maximal value is inferior to the minimal value, the size check is disabled.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_append_string__string()

SVM_FUNCTION void svm_debug_form_append_string__string ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const SVM_String  default_value,
const SVM_Size  min_size,
const SVM_Size  max_size 
)

This function appends to a debugger form an input field accepting strings.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]default_valueThe initial value of the field value.
[in]min_sizeThe minimal value to be accepted in the form.
[in]max_sizeThe maximal value to be accepted in the form.
Note
When the maximal value is inferior to the minimal value, the size check is disabled.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_append_text()

SVM_FUNCTION void svm_debug_form_append_text ( const void *  svm,
SVM_Debug_Form  form,
const char *  label,
const SVM_Size  width,
const SVM_Size  height 
)

This function appends to a debugger form an input field accepting long multi-line strings.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]formThe debugger form to update.
[in]labelThe field label of this value.
[in]widthThe field width, in number of characters.
[in]heightThe field height, in number of characters.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_new()

SVM_FUNCTION SVM_Debug_Form svm_debug_form_new ( const void *  svm,
const char *  title 
)

This function creates a debugger form.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]titleThe form title.
Returns
An empty debugger form.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_debug_form_request()

SVM_FUNCTION SVM_Value * svm_debug_form_request ( const void *  svm,
const SVM_Debug_Form  form 
)

This function sends the form to the debugger user interface, and waits for the form submission.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]formThe debugger form to send.
Warning
While waiting the user to submit the form, the current process is under a specific breakpoint disallowing execution until the form is submitted.
Note
When the debugger is not active or when an error happens, a null pointer is returned.
Returns
An array of values containing the values in the order of the fields in the form. The array has an extra null pointer at its end.
Note
The returned array is a valid SVM variable: its scope can be changed if needed, and the pointer shall not be freed explicitely.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)