AlchemicRaker / alchemy65

A vscode debugger extension for NES projects using cc65 and ca65.
MIT License
18 stars 4 forks source link

[Bug] When snooping symbol values, labels are incorrectly identified as a single byte. #1

Closed zeta0134 closed 2 years ago

zeta0134 commented 2 years ago

The symbol snooping logic is correctly identifying words in some cases, notably for word-sized constants:

good_labels

But this logic is not working correctly for labels, which are only showing one of their bytes:

bad_labels

Since a label denotes a memory address, it should always be treated as a word. The only time a label is converted to a single byte is branch instructions, and there the single byte is a relative offset from the branch position. In source code, that symbol should still logically resolve to the full word.

AlchemicRaker commented 2 years ago

Symbols now resolve to two bytes unless more context is known about them, which will cue the debugger to display up to eight bytes.

empathicqubit commented 2 years ago

Hi. I wasn't sure where off the top of my head would be best to contact you. I figure you're probably already aware of my project, but I recently added debugging support with unmodified Mesen to it. I just wanted to link to you the driver script I wrote in case in might help you develop your project. It's designed to mimic the protocol I wrote for a different emulator so I could just drop it into my project, so it may or may not be what you need. There are still some issues that need to be resolved with how it handles stepping:

https://github.com/empathicqubit/mesen-binary-monitor

Regards, empathicqubit

AlchemicRaker commented 2 years ago

Hi. I wasn't sure where off the top of my head would be best to contact you. I figure you're probably already aware of my project, but I recently added debugging support with unmodified Mesen to it. I just wanted to link to you the driver script I wrote in case in might help you develop your project. It's designed to mimic the protocol I wrote for a different emulator so I could just drop it into my project, so it may or may not be what you need. There are still some issues that need to be resolved with how it handles stepping:

https://github.com/empathicqubit/mesen-binary-monitor

Regards, empathicqubit

Hello empathicqubit! I did become aware of your project around the time I was preparing to publish Alchemy65. I've reached out to you directly at the email listed in your bio. I do have some questions about your implementation and perhaps I can answer any questions you may have as well.

Thanks for reaching out!