class Debug::RSecuritySvrSession : public RSessionBase |
Client side API to debug security server (DSS). Interaction with the DSS should be conducted through this class only.
Public Member Functions | |
---|---|
RSecuritySvrSession () | |
TInt | AttachExecutable (const TDesC &, TBool ) |
TInt | BreakInfo (const TBreakId , TThreadId &, TUint32 &, TArchitectureMode &) |
TInt | CancelGetEvent (const TDesC &) |
TInt | ClearBreak (const TBreakId ) |
TInt | Close () |
TInt | Connect (const TVersion ) |
TInt | DetachExecutable (const TDesC &) |
TInt | EraseCrashFlashPartition () |
TInt | EraseCrashLog (const TUint32 , const TUint32 ) |
TInt | GetDebugFunctionality ( TDes8 &) |
TInt | GetDebugFunctionalityBufSize ( TUint32 *) |
void | GetEvent (const TDesC &, TRequestStatus &, TDes8 &) |
TInt | GetList (const TListId , TDes8 &, TUint32 &) |
TInt | GetList (const TThreadId , const TListId , TDes8 &, TUint32 &) |
TInt | GetList (const TProcessId , const TListId , TDes8 &, TUint32 &) |
TInt | KillProcess (const TProcessId , const TInt ) |
TInt | ModifyBreak (const TBreakId , const TThreadId , const TUint32 , const TArchitectureMode ) |
TInt | ModifyProcessBreak (const TBreakId , const TProcessId , const TUint32 , const TArchitectureMode ) |
TInt | ProcessBreakInfo (const TBreakId , TProcessId &, TUint32 &, TArchitectureMode &) |
TInt | ReadCrashLog (const TUint32 , TDes8 &, const TUint32 ) |
TInt | ReadMemory (const TThreadId , const TUint32 , const TUint32 , TDes8 &, const TAccess , const TEndianess ) |
TInt | ReadRegisters (const TThreadId , const TDesC8 &, TDes8 &, TDes8 &) |
TInt | ResumeThread (const TThreadId ) |
TInt | SetBreak ( TBreakId &, const TThreadId , const TUint32 , const TArchitectureMode ) |
TInt | SetEventAction (const TDesC &, TEventType , TKernelEventAction ) |
TInt | SetProcessBreak ( TBreakId &, const TProcessId , const TUint32 , const TArchitectureMode ) |
TInt | Step (const TThreadId , TUint32 ) |
TInt | SuspendThread (const TThreadId ) |
TVersion | Version () |
TInt | WriteCrashConfig (const TUint32 , const TDesC8 &, TUint32 &) |
TInt | WriteMemory (const TThreadId , const TUint32 , const TUint32 , const TDesC8 &, const TAccess , const TEndianess ) |
TInt | WriteRegisters (const TThreadId , const TDesC8 &, const TDesC8 &, TDes8 &) |
Private Member Functions | |
---|---|
TInt | StartServer (void) |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
TInt | AttachExecutable | ( | const TDesC & | aProcessName, |
TBool | aPassive | |||
) | [inline] |
Called by a debug agent to request debug privileges for the executable with file name aExecutableName.
TInt | BreakInfo | ( | const TBreakId | aBreakId, |
TThreadId & | aThreadId, | |||
TUint32 & | aAddress, | |||
TArchitectureMode & | aMode | |||
) | [inline] |
Purpose: Returns the properties associated with a given TBreakId. The supplied break id must previously have been allocated to the debug agent by a SetBreak() call.
const TBreakId aBreakId | the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent. |
TThreadId & aThreadId | on return contains the thread id of the thread that the breakpoint is set in |
TUint32 & aAddress | on return contains the virtual memory address of the breakpoint |
TArchitectureMode & aMode | on return contains the type of this breakpoint (e.g. ARM/Thumb/Thumb2EE) |
TInt | CancelGetEvent | ( | const TDesC & | aExecutableName | ) | [inline] |
Purpose: Cancel a previously issued asynchronous RSecuritySvrSession::GetEvent call. The previously issued call will immediately complete with the TRequestStatus = KErrCancel
const TDesC & aExecutableName | The name of the executable being debugged. |
TInt | ClearBreak | ( | const TBreakId | aBreakId | ) | [inline] |
Purpose: Clears a previously set thread-specific or process-specific breakpoint.
const TBreakId aBreakId | The TBreakId returned by a prior SetBreak call. Must have been set by the same Debug Agent. |
TInt | Connect | ( | const TVersion | aVersion | ) | [inline] |
Called by a client to create a session with the DSS. This method starts the DSS if it is not running, or connects to it if it already exists.
const TVersion aVersion | version of the DSS to connect to |
TInt | DetachExecutable | ( | const TDesC & | aProcessName | ) | [inline] |
Called by a debug agent to detach from the executable with file name aExecutableName.
const TDesC & aProcessName | the fully qualified file name of the executable to detach from |
TInt | EraseCrashFlashPartition | ( | ) | [inline] |
Purpose: Method to erase entire flash partition
TInt | EraseCrashLog | ( | const TUint32 | aPos, |
const TUint32 | aBlockNumber | |||
) | [inline] |
Purpose: Method to erase a block in the crash flash
TInt | GetDebugFunctionality | ( | TDes8 & | aBuffer | ) | [inline] |
Get debug functionality text block and place it into aBuffer.
The debug functionality block (DFBlock) is used to provide information about the functionality (i.e. features) which are supported by the rm_debug.ldd device driver.
Calling this function with a suitably sized buffer aBuffer will result in the debug functionality information being stored in aBuffer. The necessary size of aBuffer can be determined by calling DebugFunctionalityBufSize().
The format of the DFBlock is:
Sub-block 0 Sub-block 1 ... Sub-block N-1
The data which will be returned by a call to GetDebugFunctionality() is constant so is guaranteed to fit exactly into the aBuffer allocated, assuming that the size of aBuffer corresponds to the value returned from GetDebugFunctionalityBufSize() .
Each sub-block is composed of a TTagHeader object followed by a C-style array of TTag objects. The sub-block contains information about a particular aspect of the debug sub-system, for example information about the manner in which memory can be accessed. The TTagHeader is comprised of an identifier which determines the type of data it contains, together with the number of TTag elements in the array following the TTagHeader . Each TTag in a sub-block has a unique ID, stored in the TTag::iTagId member variable.
The only sub-block that is guaranteed to exist has TTagHeader::iTagHdrId = ETagHeaderIdCore, all other sub-blocks are optional. The ETagHeaderIdCore sub-block is the first sub-block within the DFBlock. Other sub-blocks may appear in any order after the ETagHeaderIdCore sub-block.
The following is a diagrammatic representation of a sub-block the DFBlock:
The HHHH represents the tag header ID of a sub-block (TTagHeader::iTagHdrId) The NNNN represents the number of TTag elements in the sub-block (TTagHeader::iNumTags) The IIIIIIII represents the ID of the TTag (TTag::iTagId) The TTTT represents the type of the TTag (TTag::iType) The SSSS represents the size of the TTag's associated data (TTag::iSize) The VVVVVVVV represents the TTag's value (TTag::iValue) 0xNNNNHHHH TTagHeader element for first sub-block (has N1 TTag elements) 0xIIIIIIII \ 0xSSSSTTTT -- TTag 0 0xVVVVVVVV / 0xIIIIIIII \ 0xSSSSTTTT -- TTag 1 0xVVVVVVVV / ... 0xIIIIIIII \ 0xSSSSTTTT -- TTag N1 - 1 0xVVVVVVVV / 0xNNNNHHHH TTagHeader element for second sub-block (has N2 TTag elements) 0xIIIIIIII \ 0xSSSSTTTT -- TTag 0 0xVVVVVVVV / ... 0xIIIIIIII \ 0xSSSSTTTT -- TTag N2 - 1 0xVVVVVVVV / ... 0xNNNNHHHH TTagHeader element for last sub-block (has NX TTag elements) 0xIIIIIIII \ 0xSSSSTTTT -- TTag 0 0xVVVVVVVV / ... 0xIIIIIIII \ 0xSSSSTTTT -- TTag NX - 1 0xVVVVVVVV /
ETagHeaderIdCore
ETagHeaderIdMemory
Binary Meaning Value 0x000A0000 iTagHdrId, iNumTags ETagHeaderIdCore, ECoreLast 0x00000000 iTagId ECoreEvents 0x00000000 iType, iSize ETagTypeBoolean, 0 0x00000001 iValue ETrue 0x00000001 iTagId ECoreStartStop 0x00000000 iType, iSize ETagTypeBoolean, 0 0x00000001 iValue ETrue ... 0x00000008 iTagId ECoreHardware 0x00000000 iType, iSize ETagTypeBoolean, 0 0x00000000 iValue EFalse 0x00000009 iTagId ECoreApiConstants 0x00000000 iType, iSize ETagTypeBoolean, 0 0x00000001 iValue ETrue 0x000A0001 iTagHdrId, iNumTags ETagHeaderIdMemory, EMemoryLast 0x00000000 iTagId EMemoryRead 0x00000000 iType, iSize ETagTypeBoolean, 0 0x00000001 iValue ETrue 0x00000001 iTagId EMemoryWrite 0x00000000 iType, iSize ETagTypeBoolean, 0 0x00000001 iValue ETrue ... 0x00000008 iTagId EMemoryLE8 0x00000000 iType, iSize ETagTypeBoolean, 0 0x00000001 iValue ETrue 0x00000009 iTagId EMemoryMaxBlockSize 0x00000001 iType, iSize ETagTypeTUint32, 0 0x00004000 iValue 0x4000
Debug Agent DFBlock Processing:
Debug Agents MUST understand and process the ETagHeaderIdCore block. The other blocks may be ignored if not recognised. Tags within each block may be ignored if not recognised.
TDes8 & aBuffer | buffer to store functionality block in |
TInt | GetDebugFunctionalityBufSize | ( | TUint32 * | aBufSize | ) | [inline] |
Get buffer size required to contain Functionality text block.
in-source documentation in rm_debug_api.h
TUint32 * aBufSize | function will fill this with the required buffer size |
void | GetEvent | ( | const TDesC & | aExecutableName, |
TRequestStatus & | aStatus, | |||
TDes8 & | aEventInfo | |||
) | [inline] |
Purpose: Wait for an event to occur to the target executable being debugged. When an event occurs, the TRequestStatus is changed from KRequestPending.
Note 2: All the parameters must remain in scope until either CancelGetEvent is called, or until TRequestStatus is changed from KRequestPending. In practice, this generally means these parameters should not be based on the stack, as they may go out of scope before the call completes.
Note 3: TIpcArgs args is allocated on the stack within this function, however, all the data containing in args is transferred in the SendReceive() so it can safely go out of scope after the call has been made.
const TDesC & aExecutableName | The name of any executable to which the Debug Agent is attached. |
TRequestStatus & aStatus | Debug Agent request status variable. |
TDes8 & aEventInfo | Descriptor containing a buffer sufficient for Event information. |
TInt | GetList | ( | const TListId | aListId, |
TDes8 & | aListData, | |||
TUint32 & | aDataSize | |||
) | [inline] |
Returns a global listing corresponding to the type specified as aListId. The structure of the returned data depends on the value of aListId, see TListId for details. If aListData is not large enough to contain the listings data then the necessary buffer size is stored in aDataSize and the function returns KErrTooBig. In this case the contents of aListData will not contain useful data.
Note that if the aListData buffer was too small to hold the data then the value returned as aDataSize corresponds to the size of the data at that particular instance. The size of the data will vary over time, for example the thread list will increase and decrease in size as threads are created and destroyed, so re-requesting data with a buffer with max length aDataSize will not necessarily succeed if a list has increased in size between the two calls.
TListId
const TListId aListId | enum from TListId signifying which type of listing to return |
TDes8 & aListData | buffer provided by the debug agent in which data can be returned by the debug system |
TUint32 & aDataSize | if aListData was not large enough to contain the requested data then the necessary buffer size is stored in aDataSize. If aListData was large enough then the value of aDataSize is the length of aListData |
TInt | GetList | ( | const TThreadId | aThreadId, |
const TListId | aListId, | |||
TDes8 & | aListData, | |||
TUint32 & | aDataSize | |||
) | [inline] |
Returns a thread-specific listing corresponding to the type specified as aListId. The structure of the returned data depends on the value of aListId, see TListId for details. If aListData is not large enough to contain the listings data then the necessary buffer size is stored in aDataSize and the function returns KErrTooBig. In this case the contents of aListData will not contain useful data.
Note that if the aListData buffer is too small to hold the data then the value returned as aDataSize corresponds to the size of the data at that particular instant. The size of the data will vary over time, for example the thread list will increase and decrease in size as threads are created and destroyed, so re-requesting data with a buffer with max length aDataSize will not necessarily succeed if a list has increased in size between the two calls.
TListId
const TThreadId aThreadId | thread to return the listing for |
const TListId aListId | member of TListId signifying which type of listing to return |
TDes8 & aListData | buffer provided by the debug agent in which data can be returned by the debug system. |
TUint32 & aDataSize | if aListData was not large enough to contain the requested data then the necessary buffer size is stored in aDataSize. If aListData was large enough then the value of aDataSize is the length of aListData |
TInt | GetList | ( | const TProcessId | aProcessId, |
const TListId | aListId, | |||
TDes8 & | aListData, | |||
TUint32 & | aDataSize | |||
) | [inline] |
Returns a process-specific listing corresponding to the type specified as aListId. The structure of the returned data depends on the value of aListId, see TListId for details. If aListData is not large enough to contain the listings data then the necessary buffer size is stored in aDataSize and the function returns KErrTooBig. In this case the contents of aListData will not contain useful data.
Note that if the aListData buffer is too small to hold the data then the value returned as aDataSize corresponds to the size of the data at that particular instant. The size of the data will vary over time, for example the thread list will increase and decrease in size as threads are created and destroyed, so re-requesting data with a buffer with max length aDataSize will not necessarily succeed if a list has increased in size between the two calls.
TListId
const TProcessId aProcessId | process to return the listing for |
const TListId aListId | member of TListId signifying which type of listing to return |
TDes8 & aListData | buffer provided by the debug agent in which data can be returned by the debug system. |
TUint32 & aDataSize | if aListData was not large enough to contain the requested data then the necessary buffer size is stored in aDataSize. If aListData was large enough then the value of aDataSize is the length of aListData |
TInt | KillProcess | ( | const TProcessId | aProcessId, |
const TInt | aReason | |||
) | [inline] |
Purpose: Kill the specified process with the supplied reason. Reason codes are equivalent to those in RProcess.Kill() .
const TProcessId aProcessId | the id of the process which is to be killed |
const TInt aReason | The reason to be associated with the ending of this process |
TInt | ModifyBreak | ( | const TBreakId | aBreakId, |
const TThreadId | aThreadId, | |||
const TUint32 | aAddress, | |||
const TArchitectureMode | aArchitectureMode | |||
) | [inline] |
Purpose: Modifies the properties of a previously set breakpoint.
const TBreakId aBreakId | the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent. |
const TThreadId aThreadId | the thread id of the thread to move the breakpoint to |
const TUint32 aAddress | the virtual memory address at which to place the breakpoint. |
const TArchitectureMode aArchitectureMode | the kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE) |
TInt | ModifyProcessBreak | ( | const TBreakId | aBreakId, |
const TProcessId | aProcessId, | |||
const TUint32 | aAddress, | |||
const TArchitectureMode | aArchitectureMode | |||
) | [inline] |
Purpose: Modifies the properties of a previously set process breakpoint.
const TBreakId aBreakId | the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent. |
const TProcessId aProcessId | the process id of the process to move the breakpoint to |
const TUint32 aAddress | the virtual memory address at which to place the breakpoint. |
const TArchitectureMode aArchitectureMode | the kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE) |
TInt | ProcessBreakInfo | ( | const TBreakId | aBreakId, |
TProcessId & | aProcessId, | |||
TUint32 & | aAddress, | |||
TArchitectureMode & | aMode | |||
) | [inline] |
Purpose: Returns the properties associated with a given TBreakId. The supplied break id must previously have been allocated to the debug agent by a SetProcessBreak() call.
const TBreakId aBreakId | the TBreakId returned by a prior SetBreak() call. Must have been set by the same Debug Agent. |
TProcessId & aProcessId | |
TUint32 & aAddress | on return contains the virtual memory address of the breakpoint |
TArchitectureMode & aMode | on return contains the type of this breakpoint (e.g. ARM/Thumb/Thumb2EE) |
TInt | ReadCrashLog | ( | const TUint32 | aPos, |
TDes8 & | aData, | |||
const TUint32 | aDataSize | |||
) | [inline] |
Purpose Method to read data from the crash flash
TInt | ReadMemory | ( | const TThreadId | aThreadId, |
const TUint32 | aAddress, | |||
const TUint32 | aLength, | |||
TDes8 & | aData, | |||
const TAccess | aAccessSize, | |||
const TEndianess | aEndianess | |||
) | [inline] |
Read a block of memory from the target debug thread defined by aThreadId.
const TThreadId aThreadId | thread ID of the thread to read memory from |
const TUint32 aAddress | address to start reading memory from |
const TUint32 aLength | number of bytes of memory to read |
TDes8 & aData | descriptor to read memory into |
const TAccess aAccessSize | access size for memory reads, default is TAccess::EAccess32 |
const TEndianess aEndianess | interpretation of endianess of target data, default is TEndianess::EEndLE8 |
TInt | ReadRegisters | ( | const TThreadId | aThreadId, |
const TDesC8 & | aRegisterIds, | |||
TDes8 & | aRegisterValues, | |||
TDes8 & | aRegisterFlags | |||
) | [inline] |
Read register values from the thread with thread ID aThreadId. The IDs of the registers to read are stored as an array of TRegisterInfo objects in aRegisterIds. If the nth register requested could be read then the value of the register will be appended to aRegisterValues and EValid stored at offset n in aRegisterFlags. If the register is supported but could not be read then EInValid will be stored at offset n in aRegisterFlags and arbitrary data appended in aRegisterValues. If reading the specified register is not supported by the kernel then ENotSupported will be stored at offset n in aRegisterFlags and arbitrary data appended to aRegisterValues. If an unknown register is specified then EUnknown will be put in aRegisterFlags and arbitrary data placed in aRegisterValues.
const TThreadId aThreadId | thread ID of the thread to read register values from |
const TDesC8 & aRegisterIds | descriptor containing array of TFunctionalityRegister defined register IDs |
TDes8 & aRegisterValues | descriptor to contain register values |
TDes8 & aRegisterFlags | descriptor containing array of TUint8 flags, with values taken from TRegisterFlag |
TInt | ResumeThread | ( | const TThreadId | aThreadId | ) | [inline] |
Resumes execution of the specified thread.
const TThreadId aThreadId | thread ID of the thread to resume |
TInt | SetBreak | ( | TBreakId & | aId, |
const TThreadId | aThreadId, | |||
const TUint32 | aAddress, | |||
const TArchitectureMode | aArchitectureMode | |||
) | [inline] |
Purpose: Set a thread-specific breakpoint in an attached process.
TBreakId & aId | The address to which the assigned breakpoint ID will be written by this function |
const TThreadId aThreadId | The thread id to which the breakpoint will apply. |
const TUint32 aAddress | The virtual memory address at which to place the breakpoint. |
const TArchitectureMode aArchitectureMode | The kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE) |
TInt | SetEventAction | ( | const TDesC & | aExecutableName, |
TEventType | aEvent, | |||
TKernelEventAction | aEventAction | |||
) | [inline] |
Purpose: Set the requisite actions to be taken when a particular event occurs. The events are defined in Debug::TEventType and the actions are defined in Debug::TKernelEventAction.
The default action for all events is EActionIgnore.
const TDesC & aExecutableName | The name of the executable to which the Debug Agent is attached. |
TEventType aEvent | A TEventType enum defined in rm_debug_api.h:Debug::TEventType |
TKernelEventAction aEventAction | Any TKernelEventAction permitted by the DFBlock. |
TInt | SetProcessBreak | ( | TBreakId & | aId, |
const TProcessId | aProcessId, | |||
const TUint32 | aAddress, | |||
const TArchitectureMode | aArchitectureMode | |||
) | [inline] |
Purpose: Set a process-specific breakpoint in an attached process.
TBreakId & aId | The address to which the assigned breakpoint ID will be written by this function |
const TProcessId aProcessId | The process id to which the breakpoint will apply. |
const TUint32 aAddress | The virtual memory address at which to place the breakpoint. |
const TArchitectureMode aArchitectureMode | The kind of breakpoint which is to be set (e.g. ARM/Thumb/Thumb2EE) |
TInt | Step | ( | const TThreadId | aThreadId, |
TUint32 | aNumSteps | |||
) | [inline] |
Purpose: Step one or more CPU instructions in the specified thread from the current PC.
TInt | SuspendThread | ( | const TThreadId | aThreadId | ) | [inline] |
Suspends execution of the specified thread.
const TThreadId aThreadId | thread ID of the thread to suspend |
TInt | WriteCrashConfig | ( | const TUint32 | aPos, |
const TDesC8 & | aBuffer, | |||
TUint32 & | aSize | |||
) | [inline] |
Purpose: Method to write the crash flash config
TInt | WriteMemory | ( | const TThreadId | aThreadId, |
const TUint32 | aAddress, | |||
const TUint32 | aLength, | |||
const TDesC8 & | aData, | |||
const TAccess | aAccessSize, | |||
const TEndianess | aEndianess | |||
) | [inline] |
Write a block of memory to the target debug thread defined by aThreadId.
const TThreadId aThreadId | thread ID of the thread to write memory to |
const TUint32 aAddress | address to start writing memory at |
const TUint32 aLength | number of bytes of memory to write |
const TDesC8 & aData | descriptor to read memory from |
const TAccess aAccessSize | access size for memory writes, default is TAccess::EAccess32 |
const TEndianess aEndianess | interpretation of endianess of target data, default is TEndianess::EEndLE8 |
TInt | WriteRegisters | ( | const TThreadId | aThreadId, |
const TDesC8 & | aRegisterIds, | |||
const TDesC8 & | aRegisterValues, | |||
TDes8 & | aRegisterFlags | |||
) | [inline] |
Write register values to the thread with thread ID aThreadId. The IDs of the registers to write are stored as an array of TRegisterInfo objects in aRegisterIds. The values to put in the registers are stored as an array of objects in aRegisterValues. If the nth register to write could be written then EValid stored at offset n in aRegisterFlags. If the register is supported but could not be written then EInValid will be stored at offset n in aRegisterFlags. If writing to the specified register is not supported by the kernel then ENotSupported will be stored at offset n in aRegisterFlags. If an unknown register is specified then EUnknown will be put in aRegisterFlags.
const TThreadId aThreadId | thread ID of the thread to write register values to |
const TDesC8 & aRegisterIds | descriptor containing array of TFunctionalityRegister defined register IDs |
const TDesC8 & aRegisterValues | descriptor containing array of register values |
TDes8 & aRegisterFlags | descriptor containing array of TUint8 flags, with values taken from TRegisterFlag |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.