3.2.10 Passing Commands to the dbx Debugger
The dbx function passes a command to the dbx debugger. The function has
an argument, expect_output, that controls when it returns. If you set
the expect_output argument to TRUE, the function returns after the
command is sent, and expects the extension to read the output from dbx.
If you set the expect_output argument to FALSE, the function waits for
the command to complete execution, reads the acknowledgement from kdbx,
and then returns.
void dbx(
char* command,
Boolean expect_output);
Argument
Input/Output
Description
command
Input Specifies the command to be passed to dbx
expect_output
Input Indicates whether the extension expects
output and determines when the
function returns
For example:
dbx(out, True);
if((buf = read_response(&status)) == NULL){
print_status("main", &status);
quit(1);
}
else {
process_buf(buf);
quit(0);
}
3.2.11 Dereferencing a Pointer
The deref_pointer function returns a representation of the object pointed
to by a pointer. The function displays an error message if the data argument
passed is not a valid address.
This function has the following syntax:
DataStruct deref_pointer(
DataStruct data);
Argument Input/Output Description
data
Input Names the data structure that is being
dereferenced
For example:
Writing Extensions to the kdbx Debugger 3–9