simulavr-devel
[Top][All Lists]
Advanced

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

Re: [Simulavr-devel] Crash after entering 'target remote localhost:1212'


From: Thomas K
Subject: Re: [Simulavr-devel] Crash after entering 'target remote localhost:1212' in avr-gdb
Date: Tue, 2 Feb 2016 07:47:25 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Hi Christian,

I think, we should proceed, like Jörg proposed. E.g. send back an error message instead of aborting simulavr. As I have seen, all avr_core_flash_... methods (in cmd/gdbserver.cpp) have the same behaviour - aborting!

This could be a lot of work to fix all. And I've not checked, if this methods are really only used while a gdb connection is active. If yes, then it should be ok, to replace avr_error call by code, which sends back a error message.

When do you plan to fix and upload it? It's because I have too some collected changes in preparation and to upload to master branch. So the question is, wait for your changes? Or you have to merge later? :-)

cu, Thomas


Am 01.02.2016 um 23:40 schrieb Joerg Wunsch:
I don't think it's appropriate to completely bail out in that situation. IMHO, simulavr should return an error to GDB. This is the respective code in AVaRICE: case 'm': // mAA..AA,LLLL Read LLLL bytes at address AA..AA { uchar *jtagBuffer; if((hexToInt(&ptr, &addr)) && (*(ptr++) == ',') && (hexToInt(&ptr, &length))) { debugOut("\nGDB: Read %d bytes from 0x%X\n", length, addr); try { jtagBuffer = theJtagICE->jtagRead(addr, length); mem2hex(jtagBuffer, remcomOutBuffer, length); delete [] jtagBuffer; } catch (jtag_exception&) { error(1); } } break; } And error() is defined as: /** Set remcomOutBuffer to error 'n' response */ static void error(int n) { char *ptr = remcomOutBuffer; *ptr++ = 'E'; ptr = byteToHex(n, ptr); *ptr = '\0'; } Thus, an attempt to read beyond the target's memory presumably would yield the response E01.




reply via email to

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