simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] ATmega328 Emulation


From: Petr Hluzín
Subject: Re: [Simulavr-devel] ATmega328 Emulation
Date: Thu, 17 Feb 2011 16:57:37 +0100

On 17 February 2011 05:25, David Madden <address@hidden> wrote:
> On 02/16/2011 08:14 PM, David Madden wrote:
>>
>> Hi, I'm a new user, hoping to use Simulavr to figure out how to run
>> FreeRTOS on an ATmega328.
>
> Uh oh, after more poking around, it's possible that it's a GDB
> communications (or pure GDB) issue.  Single-stepping goes to the expected
> instruction addresses, and the registers change as expected. It's just that
> x/i gives bad disassembly.  That makes it Really Hard to trace/debug, but
> it's better than nothing!

Actually this is a bug in simulavr. In file src/cmd/gdbserver.cpp in
function GdbServer::gdb_read_memory(const char *pkt) change these
lines:
        while (len > 1)
        {
-            wval = avr_core_flash_read( addr/2 );
+            wval = avr_core_flash_read( addr );

There are two more call sites that have the extra '/2', you may change them too.

I wonder why nobody reported the bug yet.

(I found it few weeks ago but I got busy with gdb. Bummer, it seems I
will have to commit my pending changes, then.)

Simulavr also eats 100% CPU when waiting for GDB. What a shame, I
should fix that before anyone notices. :) (But I did not write the
crappy function.)
Feel free to report bugs with avr-gdb, I will try to fix them.

-- 
Petr Hluzin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]