If a checkpoint for multiple ops is created (e.g. load and store), the binary monitor will report this checkpoint multiple times, once per operation.
The reason for this is that the checkpoints are kept in a list per op, and the binary monitor implementation just reports all checkpoints from all lists. This is probably not a bug, as the documentation doesn't mention anything about checkpoints being reported only once, but it is somewhat annoying for binary monitor clients, as they need to filter out duplicates.
The fix proposed in this patch solves the problem by introducing a "master checkpoint list". Every checkpoint is added to the master list, as well as to the per-op lists. When looking for checkpoints, or reporting all checkpoints, only the master list is consulted. Besides fixing the duplication "bug", the master list also simplifies other parts of the code.
The price of the master list is additional 24 bytes per checkpoints. On a modern system, this is negligible.
Not sure i understand what problem it fixes... can you give a quick example please?
Assume you create a load/store checkpoint at address 400 (e.g. in the regular monitor with "bk load store 400")
If you now look at the list of checkpoints in the regular monitor with "bk", only 1 checkpoint will be reported.
However, if you connect to the binary monitor and issue a "Checkpoint list (0x14)" command, you will receive 2 MON_RESPONSE_CHECKPOINT_INFO messages with the identical checkpoint information.
(The regular monitor does not show this behavior because it iterates over the checkpoints differently)
Does this make more sense now? I can try and get a wireshark dump if this helps.
As I said, I don't think that this can be considered a bug, as the docs are somewhat vague about dupes, but I find reporting dupes rather inelegant :-)
I see, and i agree :)
I think this is okay, and I can't think of a reason it would break most code. I'll check it out on the weekend
Empathic Qubit, did you have a chance to look at my patch already? Happy to provide more details if there are any questions!
Sorry I haven't gotten to this. I've been dealing with some burnout
No worries! Health is definitely more important, hope you fully recovered!
friendly ping?
He is still taking a break.... i don't dare to apply this and break his code
Thanks for the update! I was just not sure whether this fell through the cracks. No worries about not applying this, after all, it's just a minor cleanup.
Hey, is there an update on this? It'd be totally great if it could go in before the christmas release. I'd consider this a low hanging fruit in the patches tracker, but then, I might be biased :-)
If you want to push it - i'd feel much better merging this, if the remotemon test program would also check for this (the right behaviour after the patch of course). -> https://sourceforge.net/p/vice-emu/code/HEAD/tree/testprogs/remotemonitor/binmontest/
I don't know that code very well myself, so i am a bit reluctant to touch it without a test :)
Oh, I didn't notice that there is test program for it! In this case I totally agree, the new behavior should be tested. Can I withdraw this patch, or can you close it for me? I will resubmit the patch once I have a test ready. Thanks again!
just post the new patch here... perhaps even a seperate one just for the test
I added a new test for the checkpoint deduping. Given that testprogrs lives on the same level as trunk (which is probably why I didn't see it :-( ), I think that a separate patch is better; the attached patch was created in testprogs.
Here are the results from running the new tests against an unpatched x64sc:
Against a patched x64sc, the output looks like this:
The new test cleans up any existing checkpoints before it checks whether breakpoints are correctly deduped, so it also works when you just run the whole test suite.
Last edit: Andreas Signer 2023-11-25
applied in r44790 and r44791 - thanks!