Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Macros to interface with debugger (Read 2251 times)
K S
Junior Member
**
Offline


Posts: 10
Joined: Dec 14th, 2015
Macros to interface with debugger
Dec 14th, 2015 at 5:01pm
Print Post  
This operation prints the expression, "i":
point + click + point + right_click + click + type "{i}" + click
 
Point-and-grunt interfaces are fine for a few minutes of ad-hoc debugging.  After that, I want my debugging expressions and diagnostic logging to be stored as source code (where I can see and edit them)

Can I interface with the debugger using macros?
For instance, is there anything like:
  VM_DEBUG_BREAK(expr...)  /* break, optionally print expression to debugger */
  VM_DEBUG_PRINT(expr...) /* print expression to debugger without stopping */
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Macros to interface with debugger
Reply #1 - Dec 14th, 2015 at 5:46pm
Print Post  
We are working on a much better system. 

+ In the code editor there will also shortly be right click "Add Watch" and "Add modifiable watch" menu items which will simply add the highlighted text to the "WhenHit" statement either as {myvar} or {myvar=?}. This uses the eixsting functionality but will be less clicks.

This isn't ideal but here are some things you can do at the moment...

Visual Micro always #defines VM_DEBUG when debug is enabled. (There is also the _DEBUG setting in the project properties which can be configured with different values).

You can return anything you like in a watch expression by calling your own method that calls code conditionally compiled using VM_DEBUG.

Your breakpoint Conditions can also call methods protected by VM_DEBUG in your own code for example WhenTrue=MYMACRO or function

Using VM_DEBUG or _DEBUG without breakpoints doesn't give much debug support other than allowing you to use the toolbar to easily switch between Release and Debug builds.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint