Command Post Home Page : Shared-Code
Library
|
|
Command Post Shared-Code Library
Command Post exports a shared-code library for developers to use in their applications.
Click on
a function to view the corresponding documentation. Before using these functions,
CommandPostExport.h must be included in your
project. CommandPostExport.h will work with TI-Flash Studio, but requires slight
modifications for compatibility with TIGCC projects.
This code shows how to determine Command Post Plus's AppID.
const UCHAR cmd_post_app_id[]="CMDPOST";
AppID cmd_post;
cmd_post=EV_getAppID(cmd_post_app_id);
void CMDPOST_CloseDisassemblyDatabases(void);
Use this function to close the disassembly databases if you previously opened
them using CMDPOST_OpenDisassemblyDatabases .
BOOL CMDPOST_CrashGuardState(AppID cmdpost);
This function returns TRUE if Command Post Plus's crash guard feature is active.
If
the Crash Guard is not active, this function returns FALSE.
void CMDPOST_DisableCrashGuard(AppID cmdpost);
This function disables Command Post Plus's Crash Guard feature. CMDPOST_CrashGuardState should be
called afterwards to determine if Crash Guard is off or on. Command Post may refuse
to remove Crash Guard if it detects a kernel installation.
void CMDPOST_Disassemble_One(AppID cmdpost, unsigned
short * pc, DASM_DAT * buffer);
This function is used internally in Command Post Plus to perform disassembly.
Simply pass the Program Counter (pc) and a pointer to a buffer large enough to
hold DASM_DAT.
Upon return, buffer.text will contain the disassembly
and buffer.pc will contain
the address of the next instruction to disassemble.
NOTE: No error checking
is done - buffer overruns are possible!. buffer.text is
intentionally oversized. A buffer size of 512 bytes is enough for most
disassembly tasks.
You should take into consideration ER_string lengths as well as the strings
found in the Rom Call database.
If you want to make use of the Rom Call database, make sure that you call CMDPOST_OpenDisassemblyDatabases prior
to using this entry point to perform disassembly.
NOTE: This function is ONLY available when Command Post Plus (v2.0) is installed.
If Command Post v1.0 is installed, this function is NOT available.
DASM_DAT is defined as:
#define MAX_DASM_TEXT_LEN (1024)
typedef struct{
unsigned short *pc; //the next address to be disassembled
char text[MAX_DASM_TEXT_LEN]; //human
readable disassembly code ie "move.l
a0,-(sp)"
}DASM_DAT;
void CMDPOST_EnableCrashGuard(AppID cmdpost);
This function enables Command Post Plus's Crash Guard feature. CMDPOST_CrashGuardState should
be called afterwards to determine if Crash Guard is off or on. Command Post may
refuse to enable Crash Guard if a kernel installation is detected.
void CMDPOST_LeakWatch_Begin(AppID cmdpost);
This function initializes Command Post's leak watch mechanism and should be called
whenever leak watch functionality is desired. For more information, view the documentation
for CMDPOST_LeakWatch_End . For more information
about the leak watch feature read the documentation for LeakWatch.
void CMDPOST_LeakWatch_End(AppID cmdpost,
char * TitleString);
This function will determine if any memory leaks have occurred since the last
call to CMDPOST_LeakWatch_Begin was
made. If possible memory leaks are detected, a dialog will be displayed with the
title specified in TitleString. For more information
about the leak watch feature read the documentation for LeakWatch.
Note: It is not necessary to pair calls to CMDPOST_LeakWatch_Begin and CMDPOST_LeakWatch_End .
void CMDPOST_MakeExceptionVectorBackup(AppID cmdpost);
Calling this function forces Command Post Plus to recreate its internal backup
of the exception vector table. If Crash Guard is turned on, calling this function
has no effect. Use CMDPOST_CrashGuardState to
determine if Crash Guard is installed. This is an advanced feature, and should
be used only if a program has reason to believe that Command Post's internal vector
backup is corrupt or incomplete.
void CMDPOST_OpenDisassemblyDatabases(void);
Call this function before using CMDPOST_Disassemble_One if
you want the disassembler to identify rom calls. If use this function, make
sure that CloseDisassemblyDatabases is called when you are finished!
|