In the old code, the found flag is cleared the next line after a line number is found. ( just after if (found) { )
In the patch, the found flag is only cleared when a code line is found.
Oh yes... maybe I need new glasses.
In any case doing these changes here can make other debuggers to fail.
This is quite tricky, because the fact that some source code appears in the list file does not mean that necessarily is followed by a line containing the address.
And this fix might work in some cases and fail in other cases.
For example, seems to me that here it ill fail:
- Code:
309 ;------------------------------------------------------------
310 ; /home/roy/sources/simulide/mcs51/led_timer/led_timer.c:5: void main(void) {
311 ; -----------------------------------------
312 ; function main
313 ; -----------------------------------------
000000 314 _main:
000007 315 ar7 = 0x07
000006 316 ar6 = 0x06
000005 317 ar5 = 0x05
If I understand correctly, your fix will ignore lines until line 315, and take address = 7, which is wrong.
As we have a dedicated debugger for SDCC, we could do the parsing in SdccDebugger::postProcess() instead of calling BaseDebugger::postProcess()
But debugging SDCC is tricky...