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 Detecting null pointers (Read 2072 times)
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Detecting null pointers
Jun 20th, 2016 at 6:48pm
Print Post  
My program keeps restarting at the point where I am making a fall to a function in an object. The call looks like:

vehicle->motor->diagnostic();

The code in diagnostic never gets reached. From this I am assuming that the motor pointer is not being initialized correctly. I tested to see if (vehicle->motor == NULL) and it is not NULL. What I need is a run-time ability to step to the next line of code (single step) and inspect complex variables. Right now, I can display simple values like int, but cannot find a way to display a class or struct. 

Is it possible to display a complex variable? Is it possible to single step the code into a pointer-based function call? Lips Sealed
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Detecting null pointers
Reply #1 - Jun 20th, 2016 at 7:03pm
Print Post  
If you are using an Arduino Zero or Gdb capable board then yes otherwise no not at the moment although the {} can contain any expression or call to a method.
« Last Edit: Jun 20th, 2016 at 7:04pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint