avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] Re: Patch: avrtest elf reader


From: Paulo Marques
Subject: [avr-gcc-list] Re: Patch: avrtest elf reader
Date: Wed, 21 May 2008 12:39:19 +0100
User-agent: Thunderbird 1.5.0.14 (X11/20071210)

Tristan Gingold wrote:
Hi,

Hi,

I don't know if this is the right list to speak about avrtest or if patches can be sent by mails. If not,
please tell me the right way.

Since avrtest was born mostly to run gcc's testsuite, I guess this is the best mailing list for it.

We (=AdaCore) have been using avrtest for a while, using the first posted version. We have improved its speed and feature. In the same time, avrtest had had a repository and has been improved (predecoding).

I am now trying to do a local merge.

Great!

One of our improvement is direct support of ELF files. This avoids to launch avr-objcopy and also directly load the SRAM.

I have been wanting to do this for a while now, and I must say that the code looks very similar to something I would have done myself. So, good work! :)

The only thing I think needs to be changed is the way the program aborts on error. The gcc testsuite requires the program to print either "EXIT", "ABORTED" or "TIMEOUT" to give a PASS / FAIL / etc. result to the test.

So, maybe changing the lines that simply "return -1" in the "load_elf" function to 'leave(EXIT_STATUS_ABORTED, "...")' would be enough. For instance, change:

+         if (addr + memsz > MAX_FLASH_SIZE)
+              return -1;

to:

+         if (addr + memsz > MAX_FLASH_SIZE)
+              leave(EXIT_STATUS_ABORTED, "program too big to fit in flash");

This would ensure that the testsuite would correctly FAIL this test, and the user would quickly understand why.

This second feature allows to use a strip down version of crt1 that doesn't
initialize the SRAM.

The only downside of this, is that if we introduce a bug in the "real" crt1, the testsuite might not catch it, because the memory is being "magically" initialized to the correct values. Maybe change this to a command line option?

Comments are welcome.

All in all, good work :)

This also opens the way for reading the symbols directly from the elf file. This would allow avrtest to have symbolic breakpoints and better address <-> name translations in the logged version to make it easier to follow code execution.

--
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com

"All generalizations are false."




reply via email to

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