View unanswered posts | View active topics It is currently Thu Oct 23, 2014 9:49 am






Reply to topic  [ 7 posts ] 
Some debugger questions 
Author Message
Expert
User avatar

Joined: Mon Oct 06, 2008 6:30 pm
Posts: 176
Location: Netherlands
Post Some debugger questions
Hi,

Some basic debugger questions here.

How to execute one (the next) line of code. What key do I use?

What happens with other tasks when I break the main task. Do they keep running?

Thanx in advance.

_________________
My most recent blog: A grain of sugar


Sun Oct 26, 2008 6:15 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post Re: Some debugger questions
Hi Aswin,

If you want to step through your program one line at a time, compile and download your program and the debugger window should show up. Click on the Step Into button and it will start your program and execute the first line of code. If you keep clicking the Step Into button, it will keep steeping one line at a time and execute that line of code.

As for the tasks, they will keep running even if main ended. You would have to use the StopAllTasks(); command to end the program.

Hope this helps
Scott B-)

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Tue Nov 04, 2008 6:40 pm
Profile WWW
Rookie

Joined: Sat Oct 25, 2008 3:47 pm
Posts: 38
Post Re: Some debugger questions
starwarslegokid wrote:
Hi Aswin,
As for the tasks, they will keep running even if main ended. You would have to use the StopAllTasks(); command to end the program.

That's what I thought, until someone kindly explained the contrary:
http://www.robotc.net/forums/viewtopic.php?p=4117#p4117


Tue Nov 04, 2008 7:20 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post Re: Some debugger questions
Hmm, the following code does not stop when task main gets to the end.

I am going to further the task subject in the other thread:

Scott

Code:
task test()
{
    while (true)
    {
        PlayTone(2000, 100);
    }
}


task main()
{
  StartTask(test);
}

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Tue Nov 04, 2008 7:34 pm
Profile WWW
Expert
User avatar

Joined: Mon Oct 06, 2008 6:30 pm
Posts: 176
Location: Netherlands
Post Re: Some debugger questions
starwarslegokid wrote:
Hi Aswin,

If you want to step through your program one line at a time, compile and download your program and the debugger window should show up. Click on the Step Into button and it will start your program and execute the first line of code. If you keep clicking the Step Into button, it will keep steeping one line at a time and execute that line of code.

As for the tasks, they will keep running even if main ended. You would have to use the StopAllTasks(); command to end the program.

Hope this helps
Scott B-)


I was not very precise in my questions it seems. Let me try again.

Can I use a keyboard button to step into the next line of code instead of clicking the step into button with the mouse?

What happens to other threads if one of the threads encounters a break point and pauses execution. Are they suspended as well or do they keep on running? (I never developed or debugged multi-threaded programs before)

_________________
My most recent blog: A grain of sugar


Thu Nov 06, 2008 4:00 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post Re: Some debugger questions
Ahh a keyboard command to step through, no there is none at this time. If you think it would be a nice feature, I may suggest adding it to the bugtracker as a new feature to consider.

I never considered breakpoints for multiple tasks lol, hmmm. I did some tests and it appears that the task that has a break will stop, while the other tasks will keep going. Here is the code I tested it with. If you break one task, the other will keep running and make its ticking sound.

Hope this helps B-)
Scott

Code:
task test()
{
    while (true)
    {
        PlayTone(1000, 1);
        wait1Msec(200);
    }
}


task main()
{
  StartTask(test);

    while (true)
    {
        PlayTone(5000, 1);
        wait1Msec(100);

    }

}

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Thu Nov 06, 2008 4:21 pm
Profile WWW
Rookie

Joined: Sat Oct 25, 2008 3:47 pm
Posts: 38
Post Re: Some debugger questions
starwarslegokid wrote:
Ahh a keyboard command to step through, no there is none at this time. If you think it would be a nice feature, I may suggest adding it to the bugtracker as a new feature to consider.

Please do. Personally I use my mouse as little as possible and I find it especially annoying for repetitive tasks.


Thu Nov 06, 2008 6:13 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.