Adding actions to breakpoints

You can specify some actions to a breakpoint to log a message to the output window or run a specific function when the breakpoint reaches. This is generally done to trace an execution log and print various values at different moments of the process.

To add actions to a breakpoint, right click on the red circle on the left-hand side bar and click on Actions... from the context menu that pops up in the screen:

This will open the Breakpoint settings dialog on screen having the Actions checkbox as checked. In the input box, either you can enter the name of the function that you want to execute for tracing or enter the string with the variable that you want to print:

You can use curly braces to print the value of a variable. For example, the following expression The value of 'i' is {i} will print the value of the variable i along with the text that we specified.

You can also use some special keywords, as mentioned in the following list, to print their current values:

  • $ADDRESS: Current instruction
  • $CALLER: Previous function name
  • $CALLSTACK: Call stack
  • $FUNCTION: Current function name
  • $PID: Process ID
  • $PNAME: Process name
  • $TID: Thread ID
  • $TNAME: Thread name

By default, the Continue execution checkbox is selected. That means the actions that we selected will be executed without stopping the code execution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.23.101.60