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 How about Pre-Pend option for Breakpoints? (Read 4644 times)
Evan
Junior Member
**
Offline


Posts: 27
Location: Northeast U.S.A.
Joined: Oct 25th, 2012
How about Pre-Pend option for Breakpoints?
Nov 6th, 2012 at 2:54pm
Print Post  
In the thread regarding breakpoints on "if" statements, it finally became clear that traditional debugger features like "Step Into" and "Step Over" are simply not applicable to an injected code mechanism.  However, adding a "Pre-Pend" option might provide a workaround for certain cases.

In the referenced tread it was explained that if the original program statement is

    abc = 5 ;

then the injected breakpoint code would follow the original, i.e.

   abc = 5 ; Serial.println( "some debug notification" ) ;

How difficult would it be to implement a Pre-Pend option to breakpoint definitions such that the code sent to the compiler would look like

    Serial.println( "some debug notification" ) ; abc = 5 ;

This gets around part of the problem with setting  break on an "if" statement that has a condition which will test false.  By adding suitable conditionals to the breakpoint I could at least signal whether the statement body will execute.  It seems to me this is superior to having the appended trace only execute when the "if" condition is true.
  
Back to top
 
IP Logged
 
James Brown
Junior Member
**
Offline


Posts: 46
Location: Near San Diego
Joined: Jul 31st, 2012
Re: How about Pre-Pend option for Breakpoints?
Reply #1 - Nov 6th, 2012 at 3:06pm
Print Post  
I think you can do the same thing by simply putting a breakpoint on an empty line ahead of the the code...
  
Back to top
IP Logged
 
txvs_
Junior Member
**
Offline


Posts: 12
Location: Spain
Joined: Sep 11th, 2012
Re: How about Pre-Pend option for Breakpoints?
Reply #2 - Nov 6th, 2012 at 3:08pm
Print Post  
Hi.

As far as I understand, it is very similar to send debug information before or after the execution of the current line, as it is just matter of where you locate the break point:

If you need to stop and evaluate the expresion before if condition, you can just mark the break point the line before with debug information about the condition.

Regards.
  
Back to top
 
IP Logged
 
txvs_
Junior Member
**
Offline


Posts: 12
Location: Spain
Joined: Sep 11th, 2012
Re: How about Pre-Pend option for Breakpoints?
Reply #3 - Nov 6th, 2012 at 3:11pm
Print Post  
James Brown wrote on Nov 6th, 2012 at 3:06pm:
I think you can do the same thing by simply putting a breakpoint on an empty line ahead of the the code... 


Ops, sorry. I missed your answer...  Smiley
  
Back to top
 
IP Logged
 
Evan
Junior Member
**
Offline


Posts: 27
Location: Northeast U.S.A.
Joined: Oct 25th, 2012
Re: How about Pre-Pend option for Breakpoints?
Reply #4 - Nov 6th, 2012 at 3:42pm
Print Post  
Fair enough.  Certainly good enough for V1.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint