| |||
| Home > Setting Breakpoints > Setting breakpoints on functions > Setting a breakpoint at the entry point to a function | |||
You can set a breakpoint at the entry point of a function
by qualifying the function name with the @entry symbol.
This identifies the first location in the function after the code that
sets up the function parameters. In general, refers
to either:function\@entry
the first executable line of code in that function
the first local variable that is initialized in that function.
To set a breakpoint on the entry to a function:
Locate a source line containing a call to the function.
For example locate line 156 in dhry_1.c.
Right-click on the function name, for example, Func_2,
to display the context menu.
Select Set Break... from the context menu.
The Create Breakpoint dialog box is displayed.
Enter for
the breakpoint Location.function\@entry
In this example, enter Func_2\@entry.
Click OK.
The breakpoint is set in the body of the function.
If no lines exist that set up any parameters for the function (for example, an embedded assembler function), then the following error message is displayed:
Error: E0039: Line number not found.
As an example, if you have a function func_1(value) you
might want to set a breakpoint that activates only when the argument value has
a specific value on entry to the function:
bi,when:{value==2} func_1\@entry
This is different to specifying a function name without the @entry qualifier.
For example, in the dhrystone.axf image:
specifying main sets a breakpoint
at 0x000083D0, the first address in the function (line
78 in dhry_1.c)
specifying main\@entry sets a
breakpoint at 0x000083D8, which is the first
line of executable code (line 91 in dhry_1.c).