Keil Logo

FUNC

The command FUNC defines ANSI-style C-like functions for being used during a debugging session. Though this command can be entered in the Command window, it is better suited for enhancing debugging using scripts.

The general syntax form is:

Syntax Description
FUNC f_name ( args[] ) { f_body } Creates a function for that debugging session. RESET commands have no impact.

 

f_name Is the function name. Refer to Debug Functions for details about creating and using functions.
args[] List of parameters. Parameters must be separated by commas and must have an type identifier. Can be left void.
f_body The function body must comply to ANSI-C standards. Refer to Differences Between µVision and C functions.

Examples

// define
FUNC add(int a, int b)  { return (a+b); }


// call
add(10,6)

User functions in debug scripts

The functions are removed when calling a LOAD command without INCREMENTAL from the command line after including the debug script. To work around this, do one of the following:

  • Use "LOAD ... INCREMENTAL" to preserve the functions.
  • Call "INCLUDE debug_script.ini" to redefine the functions after a LOAD without INCREMENTAL.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.