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

 
 

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

Submitter:  None
Submitted:  Fri 25 Feb 2011 02:01:26 AM UTC
   
 
Category:  Simulation Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Email:  * -email is unavailable- Open/Closed:  Closed
Component Version:  * simulavrxx
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by petrh (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-02-27 petrh StatusNone Fixed
        Open/ClosedOpen Closed
        Component Versionsimulavr simulavrxx
    2011-02-25 None Attached File- Added decode_trace.patch, #22778

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code