dbg.h revision ae9776455b8f98d742a7b0da10d370f41f350ad8
* DBGC variable category. * Used to describe an argument to a command or function and a functions /** Any kind of pointer. */ /** Any kind of pointer with no range option. */ /** GC pointer with no range option. */ /** Numeric argument with no range option. */ /** Segmented GC pointer. */ /** Physical GC pointer. */ /** Segmented HC pointer. */ /** Physical HC pointer. */ /** Special type used when querying symbols. */ /** @todo Rename to DBGCVAR_IS_xyz. */ /** Checks if the specified variable type is of a pointer persuasion. */ /** Checks if the specified variable type is of a pointer persuasion. */ /** Checks if the specified variable type is of a pointer persuasion and of the guest context sort. */ /** Checks if the specified variable type is of a pointer persuasion and of the host context sort. */ * DBGC variable range type. /** No range appliable or no range specified. */ /** Number of elements. */ /** The minimal number of times this argument may occur. * Use 0 here to inidicate that the argument is optional. */ /** Maximum number of occurences. * Use ~0 here to indicate infinite. */ /** Argument category. */ /** Flags, DBGCVD_FLAGS_* */ /** Pointer to an argument descriptor. */ /** Pointer to a const argument descriptor. */ /** Variable descriptor flags. /** Indicates that the variable depends on the previous being present. */ /** Pointer to the argument descriptor. */ /** Pointer to the next argument. */ /** Flat GC Address. (DBGCVAR_TYPE_GC_FLAT) */ /** Far (16:32) GC Address. (DBGCVAR_TYPE_GC_FAR) */ /** Physical GC Address. (DBGCVAR_TYPE_GC_PHYS) */ /** Flat HC Address. (DBGCVAR_TYPE_HC_FLAT) */ /** Far (16:32) HC Address. (DBGCVAR_TYPE_HC_FAR) */ /** Physical GC Address. (DBGCVAR_TYPE_HC_PHYS) */ /** String. (DBGCVAR_TYPE_STRING) * The basic idea is the the this is a pointer to the expression we're * parsing, so no messing with freeing. */ /** Number. (DBGCVAR_TYPE_NUMBER) */ /** Range. The use of the content depends on the enmRangeType. */ /** Pointer to a command argument. */ /** Pointer to a const command argument. */ * Macro for initializing a DBGC variable with defaults. * The result is an unknown variable type without any range. * Macro for initializing a DBGC variable with a HC physical address. * Macro for initializing a DBGC variable with a HC flat address. * Macro for initializing a DBGC variable with a GC physical address. * Macro for initializing a DBGC variable with a GC flat address. * Macro for initializing a DBGC variable with a GC far address. * Macro for initializing a DBGC variable with a number * Macro for setting the range of a DBGC variable. * @param pVar The variable. * @param _enmRangeType The range type. * @param Value The range length value. /** Pointer to command descriptor. */ /** Pointer to const command descriptor. */ /** Pointer to helper functions for commands. */ * Command helper for writing text to the debug console. * @param pCmdHlp Pointer to the command callback structure. * @param pvBuf What to write. * @param cbBuf Number of bytes to write. * @param pcbWritten Where to store the number of bytes actually written. * If NULL the entire buffer must be successfully written. /** Pointer to a FNDBGCHLPWRITE() function. */ * Command helper for writing formatted text to the debug console. * @param pCmdHlp Pointer to the command callback structure. * @param pcb Where to store the number of bytes written. * @param pszFormat The format string. * This is using the log formatter, so it's format extensions can be used. * @param ... Arguments specified in the format string. /** Pointer to a FNDBGCHLPPRINTF() function. */ * Command helper for writing formatted text to the debug console. * @param pCmdHlp Pointer to the command callback structure. * @param pcb Where to store the number of bytes written. * @param pszFormat The format string. * This is using the log formatter, so it's format extensions can be used. * @param args Arguments specified in the format string. /** Pointer to a FNDBGCHLPPRINTFV() function. */ * Command helper for formatting and error message for a VBox status code. * @returns VBox status code appropriate to return from a command. * @param pCmdHlp Pointer to the command callback structure. * @param rc The VBox status code. * @param pszFormat Format string for additional messages. Can be NULL. * @param ... Format arguments, optional. /** Pointer to a FNDBGCHLPVBOXERROR() function. */ * Command helper for formatting and error message for a VBox status code. * @returns VBox status code appropriate to return from a command. * @param pCmdHlp Pointer to the command callback structure. * @param rc The VBox status code. * @param pcb Where to store the number of bytes written. * @param pszFormat Format string for additional messages. Can be NULL. * @param args Format arguments, optional. /** Pointer to a FNDBGCHLPVBOXERRORV() function. */ * Command helper for reading memory specified by a DBGC variable. * @returns VBox status code appropriate to return from a command. * @param pCmdHlp Pointer to the command callback structure. * @param pVM VM handle if GC or physical HC address. * @param pvBuffer Where to store the read data. * @param cbRead Number of bytes to read. * @param pVarPointer DBGC variable specifying where to start reading. * @param pcbRead Where to store the number of bytes actually read. * This optional, but it's useful when read GC virtual memory where a * page in the requested range might not be present. * If not specified not-present failure or end of a HC physical page /** Pointer to a FNDBGCHLPMEMREAD() function. */ * Command helper for writing memory specified by a DBGC variable. * @returns VBox status code appropriate to return from a command. * @param pCmdHlp Pointer to the command callback structure. * @param pVM VM handle if GC or physical HC address. * @param pvBuffer What to write. * @param cbWrite Number of bytes to write. * @param pVarPointer DBGC variable specifying where to start reading. * @param pcbWritten Where to store the number of bytes written. * This is optional. If NULL be aware that some of the buffer * might have been written to the specified address. /** Pointer to a FNDBGCHLPMEMWRITE() function. */ * Executes command an expression. * (Hopefully the parser and functions are fully reentrant.) * @returns VBox status code appropriate to return from a command. * @param pCmdHlp Pointer to the command callback structure. * @param pszExpr The expression. Format string with the format DBGC extensions. * @param ... Format arguments. /** Pointer to a FNDBGCHLPEVAL() function. */ * Helper functions for commands. /** Pointer to a FNDBCHLPWRITE() function. */ /** Pointer to a FNDBGCHLPPRINTF() function. */ /** Pointer to a FNDBGCHLPPRINTFV() function. */ /** Pointer to a FNDBGCHLPVBOXERROR() function. */ /** Pointer to a FNDBGCHLPVBOXERRORV() function. */ /** Pointer to a FNDBGCHLPMEMREAD() function. */ /** Pointer to a FNDBGCHLPMEMWRITE() function. */ /** Pointer to a FNDBGCHLPEXEC() function. */ * Evaluates an expression. * (Hopefully the parser and functions are fully reentrant.) * @returns VBox status code appropriate to return from a command. * @param pCmdHlp Pointer to the command callback structure. * @param pResult Where to store the result. * @param pszExpr The expression. Format string with the format DBGC extensions. * @param va Format arguments. * Print an error and fail the current command. * @returns VBox status code to pass upwards. * @param pCmdHlp Pointer to the command callback structure. * @param pCmd The failing command. * @param pszFormat The error message format string. * @param va Format arguments. * Converts a DBGC variable to a DBGF address structure. * @returns VBox status code. * @param pCmdHlp Pointer to the command callback structure. * @param pVar The variable to convert. * @param pAddress The target address. * Converts a DBGC variable to a boolean. * @returns VBox status code. * @param pCmdHlp Pointer to the command callback structure. * @param pVar The variable to convert. * @param pf Where to store the boolean. * Command helper for writing formatted text to the debug console. * @param pCmdHlp Pointer to the command callback structure. * @param pszFormat The format string. * This is using the log formatter, so it's format extensions can be used. * @param ... Arguments specified in the format string. * @copydoc FNDBGCHLPVBOXERROR * @copydoc FNDBGCHLPMEMREAD * Evaluates an expression. * (Hopefully the parser and functions are fully reentrant.) * @returns VBox status code appropriate to return from a command. * @param pCmdHlp Pointer to the command callback structure. * @param pResult Where to store the result. * @param pszExpr The expression. Format string with the format DBGC extensions. * @param ... Format arguments. * Print an error and fail the current command. * @returns VBox status code to pass upwards. * @param pCmdHlp Pointer to the command callback structure. * @param pCmd The failing command. * @param pszFormat The error message format string. * @param ... Format arguments. * The console will call the handler for a command once it's finished * parsing the user input. The command handler function is responsible * for executing the command itself. * @param pCmd Pointer to the command descriptor (as registered). * @param pCmdHlp Pointer to command helper functions. * @param pVM Pointer to the current VM (if any). * @param paArgs Pointer to (readonly) array of arguments. * @param cArgs Number of arguments in the array. * @param pResult Where to store the result. NULL if no result descriptor was specified. /** Pointer to a FNDBGCCMD() function. */ * DBGC command descriptor. * If a pResultDesc is specified the command can be called and used * as a function too. If it's a pure function, set fFlags to * DBGCCMD_FLAGS_FUNCTION. /** Minimum number of arguments. */ /** Max number of arguments. */ /** Argument descriptors (array). */ /** Number of argument descriptors. */ /** Result descriptor. */ /** flags. (reserved for now) */ /** Command description. */ /** The description is of a pure function which cannot be invoked * as a command from the commandline. */ /** Pointer to a DBGC backend. */ * Checks if there is input. * @returns true if there is input ready. * @returns false if there not input ready. * @param pBack Pointer to the backend structure supplied by * the backend. The backend can use this to find * @param cMillies Number of milliseconds to wait on input data. /** Pointer to a FNDBGCBACKINPUT() callback. */ * @returns VBox status code. * @param pBack Pointer to the backend structure supplied by * the backend. The backend can use this to find * @param pvBuf Where to put the bytes we read. * @param cbBuf Maximum nymber of bytes to read. * @param pcbRead Where to store the number of bytes actually read. * If NULL the entire buffer must be filled for a /** Pointer to a FNDBGCBACKREAD() callback. */ * @returns VBox status code. * @param pBack Pointer to the backend structure supplied by * the backend. The backend can use this to find * @param pvBuf What to write. * @param cbBuf Number of bytes to write. * @param pcbWritten Where to store the number of bytes actually written. * If NULL the entire buffer must be successfully written. /** Pointer to a FNDBGCBACKWRITE() callback. */ * Ready / busy notification. * @param pBack Pointer to the backend structure supplied by * the backend. The backend can use this to find * @param fReady Whether it's ready (true) or busy (false). /** Pointer to a FNDBGCBACKSETREADY() callback. */ * The communication backend provides the console with a number of callbacks /** Ready / busy notification. */ * Make a console instance. * This will not return until either an 'exit' command is issued or a error code * indicating connection loss is encountered. * @returns VINF_SUCCESS if console termination caused by the 'exit' command. * @returns The VBox status code causing the console termination. * @param pBack Pointer to the backend structure. This must contain * a full set of function pointers to service the console. * @param fFlags Reserved, must be zero. * @remark A forced termination of the console is easiest done by forcing the * callbacks to return fatal failures. * Register one or more external commands. * @param paCommands Pointer to an array of command descriptors. * The commands must be unique. It's not possible * to register the same commands more than once. * @param cCommands Number of commands. * Deregister one or more external commands previously registered by * DBGCRegisterCommands(). * @param paCommands Pointer to an array of command descriptors * as given to DBGCRegisterCommands(). * @param cCommands Number of commands. * Spawns a new thread with a TCP based debugging console service. * @param ppvData Where to store the pointer to instance data. * Terminates any running TCP base debugger consolse service. * @param pvData Instance data set by DBGCTcpCreate(). /** @defgroup grp_dbgc_plug_in The DBGC Plug-in Interface /** The plug-in module name prefix. */ /** The name of the plug-in entry point (FNDBGCPLUGIN) */ * DBGC plug-in operations. /** The usual invalid first value. */ /** Initialize the plug-in, register all the stuff. * The plug-in will be unloaded on failure. * uArg: The VirtualBox version (major+minor). */ /** Terminate the plug-ing, deregister all the stuff. * The plug-in will be unloaded after this call regardless of the return /** The usual 32-bit hack. */ * DBGC plug-in main entry point. * @returns VBox status code. * @param enmOperation The operation. * @param pVM The VM handle. This may be NULL. * @param uArg Extra argument. /** Pointer to a FNDBGCPLUGIN. */ /** @copydoc FNDBGCPLUGIN */