Embedded Development Tools and Debuggers for XC2000, TriCore, PowerPC, ARM, Cortex, SH-2A » Support & Updates » FAQ » UDE FAQ » How can I automatically change a variable and rerun my application after it was halted at a breakpoi
| Print |

How can I automatically change a variable and rerun my application after it was halted at a breakpoint?

Create a script file, that contains the appropriate procedure:

      Sub ChangeVariableAndRun()
          Dim Debugger
          Dim Value
          Dim VariableName

          ' get debugger - is always debugger of index 0 in workspace
          set Debugger = Workspace.CoreDebugger(0)

          ' Get the content of the following variable name (for example "ucMinutes")
          VariableName="ucMinutes"

          ' Get variable value
          Value = Debugger.Variable( VariableName )

          ' change the value
          Value = Value + 1

          ' Write new value to the variable
          Debugger.Variable( VariableName ) = Value

          ' rerun the application
          Debugger.Go()
      End Sub
  1. Start UDE
  2. Load/Create your workspace
  3. Click on Tools - Macros - Open File to open the Script file that contains your procedure
  4. Load the ELF application and source file
  5. Set a breakpoint to the appropriate source line
  6. Click on Debug - Breakpoints... from the UDE menu
  7. Select the breakpoint on which the variable name have to be changed
  8. Enable the Macro checkbox
  9. Enter the procedure name, that is enclosed in your script file (for example "ChangeVariableAndRun")
  10. Click on OK to save all.

After click on Run, the procedure is always called after the appropriate breakpoint was hit.

 

Events

Freescale TecDays 2013
Tool package for Kinetis (Cortex-M4), Embedded Linux Kernel and Application Debugging, Eclipse based development platform for Qorivva microcontrollers MPC56xx/MPC57xx

Read more ...

Crash Courses and Training
Multicore Debug Solution, MCDS, Architectures, UDE

Read more ...


News

Hercules™ security
MCU platform
TMS570LS and RM4x
from Texas
Instruments now
supported by UDE
Read more...
 
Optimized debugging
solution for
the new
ARM® Cortex™- M0
core-based XMC1000
family of Infineon
Read more...
 
Universal Debug
Engine 4.0
sets
new standards in
the development
of multicore targets
Read more...
 

New Universal
Access Devcie 2pro

(UAD2pro) enables
also strong electrically
isolated connections
to the target

Read more...
 

First optimized
test and debug
solution for the
new AURIX™
32-bit multi-
core MCUs
from Infineon

Read more...
 

Proven debug
solution for new
multicore auto-
motive micro-
controllers:
MPC57xx (Freescale)
and SPC57x (STM)

Read more...
 

Optimized debug
tools for the
new XMC4000
microcontroller
family
of Infineon
available now

Read more...
 

Complete debug
solution for the
Development
Device of the
new TriCore
Multicore
Architecture

Read more...
 
Optimized tools
for the new
TC1791, TC1793
and TC1798
AUDO MAX
microcontrollers
Read more...
 
netX controllers
and rcX RTOS
from Hilscher
now supported by UDE
Read more...
 
Dual-core debugging
of NXP's LPC4300
under the single user
interface of UDE
Read more...
 

Kinetis MCUs
from Freescale
based on Cortex-
M4 core supported
by UDE

Read more...
 

Complete new
toolchain for
Power Architecture
SoCs
from
STMicroelectronics
and Freescale
based on Eclipse,
GNU and
Universal Debug Engine

Read more...
 
UAD3+ sets new standards in the field of high-end trace and multi-core / multi-target debugging
Read more...