bugSimulavr: an AVR simulator - Bugs: bug #32592, simulavr trace get stuck while...

 
 

bug #32592: simulavr trace get stuck while printing branching instructions

Submitted by:  None
Submitted on:  Fri 25 Feb 2011 02:01:26 AM UTC  
 
Category: SimulationSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Closed
Component Version: simulavrxx

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 27 Feb 2011 08:51:21 PM UTC, comment #1:

Fix commited.
Thank you for the bug report and for your patch!

Petr Hluzin <petrh>
Project Member
Fri 25 Feb 2011 02:01:26 AM UTC, original submission:

Hi,

I started using simulavr today, and after a successful bootstrap, configure and make, I started to try the simulator for a project I'm working with Arduino code.

I found the trace option extremely useful for debugging interrupt-driven tasks in the AVR uC, but it was not working ok. Some times, when it reached a branch instruction (BRBC and the like), the trace output stopped, and a new trace file was created a few seconds later. However, that new file suffered from the same problems, i.e. it was unexpectedly terminated right before a branch instruction. (I was able to find this comparing the trace output and the compiler's output)

The test suit passed all ok, so I found a problem in the trace code in decoder_trace.cpp. While decoding the BRBC and BRBS instructions, the names are located in arrays using the "bitmask" variable as an index. However, the "bitmask" variable is set by a bit shift in decoder.cpp, and is not a suitable index for the array.

I wrote a macro that fixes that, but I'm sure you might find a better, optimized solution. I'm attaching a diff of the original and modified files.

I hope this helps you in the development of this wonderful tool!

Thanks,

Patricio

PS: I also added an #include in avrerror.cpp to make it compile, and appears on the same diff.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #22778:  decode_trace.patch added by None (3KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by petrh (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 27 Feb 2011 08:51:21 PM UTCpetrhStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Component Versionsimulavr=>simulavrxx
    Fri 25 Feb 2011 02:01:26 AM UTCNoneAttached File-=>Added decode_trace.patch, #22778

    Back to the top


    Powered by Savane 3.1-cleanup1