Debugging with 5.6 and 5.8 versions

General discussion on mikroBasic PRO for AVR.
Post Reply
Author
Message
robert_d1968
Posts: 145
Joined: 14 Nov 2012 00:30
Location: China
Contact:

Debugging with 5.6 and 5.8 versions

#1 Post by robert_d1968 » 24 Nov 2012 17:42

I brought this up with some of my posts in ADC Library.

Concerning the debugger, it was not too bad in 5.6, I could comment out sections of my code to avoid the debugging problems I was having.

I have uninstalled version 5.6 and installed version 5.8. I now have some serious problems with break points. Not stopping at the break points, and stopping at places with no breakpoints set.

It is worse in version 5.8. This makes it extremely difficult to debug with. Lets say you set a break point someplace, then start running the program. It will just run right along, ignoring the break point. but if you leave it running and clear that break point, it will then break there.

This gets really hairy when you have like 6 or seven break points set, not only does it not break on the break points, it breaks where you have no break point set.

I'm not sure whats going on, is nobody else having this problem? If nobody else is having this problem, then maybe it's related to my computer setup. Either way, it's very annoying.

Robert

robert_d1968
Posts: 145
Joined: 14 Nov 2012 00:30
Location: China
Contact:

Re: Debugging with 5.6 and 5.8 versions

#2 Post by robert_d1968 » 24 Nov 2012 22:39

Well,

I can confirm that it works great on my laptop, the desktop is the one that's giving me trouble.
So, the program must be OK. I'll have do to some checking on my end, maybe a service pack issue or
Because I purchased it in China, and the operating system was in Chinese (I switched language packs) that may be giving me some trouble.

But I have never had a problem with any software on it, until Mikro's software was installed on it.
Might be some sort of framework issue, as I only have Microsoft 4 framework installed on it.

Can you guys confirm if it would need any earlier version of Microsoft's frame work installed to run your IDE?

In the mean time, I'll try some other avenues.

Regards,

Robert

robert_d1968
Posts: 145
Joined: 14 Nov 2012 00:30
Location: China
Contact:

Re: Debugging with 5.6 and 5.8 versions

#3 Post by robert_d1968 » 25 Nov 2012 11:50

OK,
I now have it working correctly on the desktop.
It stops on all the breakpoints, and does not break else where.

But this still leaves both the desktop and the laptop hanging in the debugger when it comes time to read the ADC.

L__ADC_Get_Sample3:
0x0050 0x007A91B0 LDS R27, ADSC_bit+0 ' Load from sram into r27, the ADSC bit
0x0054 0xFFB6 SBRS R27, 6 ' Skip if bit in register is set , if set then conversion is not complete
0x0056 0xC002 RJMP L__ADC_Get_Sample4 ' If not set, then conversion is complete, get next sample
0x0058 0x0000 NOP ' No operation , land here after skip.
0x005A 0xCFFA RJMP L__ADC_Get_Sample3 ' if we got here, then conversion was not complete. Test it again

I can comment out the read get adc sample and I don't have to worry about this. But I would still like it to work.

Can one of the mods comment on this? It seems like a bug in the debugger, as only the debugger can clear that bit.
But I would like to confirm this, so I don't have to keep looking on my end.

Thanks,

Robert

robert_d1968
Posts: 145
Joined: 14 Nov 2012 00:30
Location: China
Contact:

Re: Debugging with 5.6 and 5.8 versions

#4 Post by robert_d1968 » 30 Nov 2012 01:59

Hello again.

I thought I had this cleared up, but tonight It did it again. The debugger would not stop on any break points. So I decided to save my work and restart the computer. I saved it ok, but when I closed the program, it crashed. I filled out the bug report and sent it. ( Some type of pointer fault ) Makes sense since it could not stop on the break points.

I then restarted my computer, opened the project and tried to debug it again. It still would not stop on any of the break points. I then close out the ide and opened up another project that was debugging with no problems. This program stopped on all of the break points I had set.

So I figure there must be something wrong with my program. So I did a copy and paste to a text file, from the program in the ide, I then closed the ide and deleted the contents of the project folder. I started up mikro-basic avr pro from the shortcut, when it opened, it still had the program in it. I highlighted all of the program text and back spaced it out of there. closed one more time, and it asked me do I want to save? I clicked no and it closed.

Now I open the project folder and delete the two files that it saved, I then start the ide up again from the short cut and make a new project, saved to the same project folder. I then open up the text file that I made earlier and copy the contents back into the ide, save, build and run it again.

Now all of a sudden, it can break on all of the break points I have set, and seems to work OK.

Is there some type of file corruption going on here? I have also noticed that if I make a change to the program and build it, I can no longer save it. save is disabled in the menu. however if I save before the build, then it's OK.

If I build and can't save it, I just make a small change in the ide again, then remove the change and I can save from the drop down menu again (it's no longer greyed out).

Hopefully the bug report contains enough information to rectify this problem.

Robert

robert_d1968
Posts: 145
Joined: 14 Nov 2012 00:30
Location: China
Contact:

Re: Debugging with 5.6 and 5.8 versions

#5 Post by robert_d1968 » 30 Nov 2012 02:03

Ok,

I started using it again, and once again it starts skipping the break points. I close it and the same crash again.
I did this a couple of more times, to see if I could get it to skip breakpoints and crash again.

I am now very successful at crashing your IDE at will. :)

the steps are as follows.
1. Open up any project, run it in the debugger.
2. Once the debugging process is running, but still paused, set a break point.
3 Debug as normal, all works well.
4. After it stops on your break point, fold some code up.
5. Start debugging again, this time it will miss your break point and maybe break someplace else, where there was no break-point set.
6. To crash it, just stop debugging and highlight your code with control+a, then press the backspace button.
7. open your ide back up, your project will load up. Look it over, you now have break points that you did not set!.

From this I can conclude that code folding during debugging with a break point set causes a pointer fault of some type
and crashes the ide.

Robert

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: Debugging with 5.6 and 5.8 versions

#6 Post by dejan.odabasic » 30 Nov 2012 14:29

Hello,

Since we don't have hardware debugger for AVR, debugging option in IDE is limited to software simulation.
That's why you need to comment out the library function calls which are waiting for response from hardware module, like ADC.

When you build the project all files that are included in project manager will be saved before compiling.

Thank you for your reports, especially for bug reports which you completed because they contain more detail information which are helpful to our developers.
We are aware of code folding issues, and our developers are working on fixing them.

Thank you for understanding.

Best regards.

robert_d1968
Posts: 145
Joined: 14 Nov 2012 00:30
Location: China
Contact:

Re: Debugging with 5.6 and 5.8 versions

#7 Post by robert_d1968 » 30 Nov 2012 15:28

Thanks for your reply,

OK, that makes more sense now. I won't be pulling my hair out, going like now what's wrong with my code. lol
I'm playing with some code now, that just does not follow the rules, for some reason. I did manage to get it debugged in the IDE. It's part of my code I'm working on that I'm having some issues with.

I'll post some info on it in another topic, as it's really not tied into the break point issue.

Keep up the good work guys, I really love this IDE.

Robert

Post Reply

Return to “mikroBasic PRO for AVR General”