4.7.2. Unknown RDI information handler

The unknown RDI information function is called if ARMulator cannot handle an RDI_InfoProc request itself. It returns an RDIError value. This function can be used by a model extending the RDI interface between ARMulator and the debugger. For example, the profiler module (in profiler.c) provides the RDIProfile info calls.


typedef int RDI_InfoProc(void *handleunsigned type,                         ARMword *arg1, ARMword *arg2)



is the handle passed to ARMulif_InstallUnkRDIInfoHandler.


is the RDI_InfoProc subcode. These are defined in rdi_info.h. See below for some examples.


are arguments passed to the handler from ARMulator.


ARMulator stops calling RDI_InfoProc() functions when one returns a value other than RDIError_UnimplementedMessage.

The following codes are examples of the RDI_InfoProc subcodes that can be specified as type:


This enables models to declare how to extend the functionality of the target. For example, profiler.c intercepts this call to set the RDITarget_CanProfile flag.


This is passed around so that models can switch logging information on and off. For example, tracer.c uses this call to switch tracing on and off from bit 4 of the rdi_log value.


This enables models to extend the list of counters provided by the debugger in $statistics. Models call ARMul_AddCounterDesc() (see General purpose functions) to declare each counter in turn. It is essential that the model also trap the RDICycles RDI info call.


Models that have declared a statistics counter by trapping RDIRequestCyclesDesc must also respond to RDICycles by calling ARMul_AddCounterValue() (see General purpose functions) for each counter in turn, in the same order as they were declared.

The above RDI info calls have already been dealt with by ARMulator, and are passed for information only, or so that models can add information to the reply. Models must always respond to these messages with RDIError_UnimplementedMessage, so that the message is passed on even if the model has responded.

Install the handler using:

int ARMulif_InstallUnkRDIInfoHandler(RDI_ModuleDesc *mdesc,                                     RDI_InfoProc *funcvoid *handle)

Remove the handler using:

int ARMulif_RemoveUnkRDIInfoHandler(RDI_ModuleDesc *mdesc,                                    RDI_InfoProc *funcvoid *handle)


The semihost.c model supplied with ARMulator uses the UnkRDIInfoUpcall() to interact with the debugger:


returns errors raised by the program running under ARMulator to the debugger.


finds the command line set for the program by the debugger.


intercepts the hardware vectors.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI0058D