|
Lou Sortman <lou_sortman@servicemerchandise.com> wrote:
> Do you guys have an established mechanism for debugging?
> I'm thinking of writing certain numbers to the display using cputw().
> The idea being that the number frozen forever on the display will be the
> (approximately) last place the code was ok before the RCX got wedged. I
> do this on larger systems with printf frequently.
> I'm reasonably sure cputw will work, but if there are better ways, I'm
> open to suggestions. I can't test my code in gdb, because it depends on
> interrupts. Well, I could, but it might be more painful than the cputw
> method.
That's the method I've used. Just be sure to put an lcd_refresh() after
the cputw() call - I can't remember if cputw() does the lcd_refresh() or
not. Another thing I've done is write out a number where the upper byte
indicates a position in the code and the lower byte is some useful data,
and put a second or two pause after displaying each number. It's kind
of a poorman's trace mechanism.
I'm working on a debugger for LegOS that will allow you to suspend &
resume tasks, examine the registers of suspended tasks, look at memory,
and set breakpoints, all over the IR port. But don't hold your breath
waiting for it - I just switched jobs recently and that is taking most
of my time :-)
-Matt
|
|
Message has 1 Reply: | | Re: Debugging
|
| (...) I don't think it does. Of course, the source would answer definitively, but I also know that until I remembered to put the refreshes in there, I didn't get useful output. (...) I did that too. In my case, the lower byte was the priority (...) (26 years ago, 16-Mar-99, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Debugging
|
| Do you guys have an established mechanism for debugging? I'm thinking of writing certain numbers to the display using cputw(). The idea being that the number frozen forever on the display will be the (approximately) last place the code was ok before (...) (26 years ago, 15-Mar-99, to lugnet.robotics.rcx.legos)
|
7 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|