URL:
  <http://savannah.nongnu.org/bugs/?32592>

                 Summary: simulavr trace get stuck while printing branching
instructions
                 Project: Simulavr: an AVR simulator
            Submitted by: None
            Submitted on: Fri 25 Feb 2011 02:01:26 AM UTC
                Category: Simulation
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: bestp...@yahoo.com
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: simulavr

    _______________________________________________________

Details:

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.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 25 Feb 2011 02:01:26 AM UTC  Name: decode_trace.patch  Size: 3kB  
By: None

<http://savannah.nongnu.org/bugs/download.php?file_id=22778>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?32592>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
Simulavr-devel mailing list
Simulavr-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/simulavr-devel

Reply via email to