-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I just came across this project, which looks good! A while ago, I wrote something with a similar goal, which might be interesting to you: https://github.com/3devo/AvrMemoryAnalyzer
My project is not just about dumping the return value, but a full stack dump. The focus of that project is a tool which can analyze a stack dump and piece together a (not always completely accurate) stacktrace, but it also contains some Arduino code to make the stackdump, which operates in the same area as your code (but is a lot more rough and more of an example, and doesn't have this nice EEPROM saving of reports).
Looking at your code, particular ideas you could borrow from mine are:
- Using
__AVR_3_BYTE_PC__to detect 2 vs 3 byte program counter. - Using the
get_return_address()builtin (or some custom assembler for 3-byte PC units), which I think is more robust against the SP being modified, and doesn't need the ISR to be naked: https://github.com/3devo/AvrMemoryAnalyzer/blob/master/dump_memory.h#L101-L133
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels