1.6.9. Target functions

Target functions can be called within a debugger expression. Depending on the processor, the data type of the return value determines the type that the function call takes. Public labels, like runtime routines, are assumed to return an integer. Passing structures by returning a pointer is not supported.

A target function called from a debugger expression behaves the same way as if it were called from a user program. Target functions can invoke I/O operations or error messages in addition to activate breakpoints and associated macros. If a breakpoint is hit that stops execution, the registers are restored and the call ends with an error.

Arguments are copied to the stack below the current function. The return address is the entry point of the application where a breakpoint is placed.

Macros take higher precedence than target functions. If a target function and a macro have the same name, the macro is executed unless the target function is qualified. For example, strcpy is a predefined debugger macro, while PROG\strcpy is a function within the module PROG. The predefined macro is referenced as strcpy(t,s), while PROG\strcpy(t,s) refers to the function within PROG. A target function must be called within a debugger expression that is used within a command. It cannot be directly executed as a command, but a macro can.

Example 1.1. Calling a target function


CE PROG\strcpy(t,s)

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0175G
Non-Confidential