Open AntonKrug opened 5 years ago
Does this happen for ARM too?
Does this happen when using the CDT alone (GDB Hardware Debugging)?
I also suggest you monitor the GDB dialog, in the GDB trace console (not visible by default, you need to enable it explicitly).
My guess is that the problem is caused by the huge number of registers used by RISC-V.
No it doesn't happen with ARM, only in RISC-V. The ARM doesn't even need scrolling when the dialog is resized a bit, it might be related to the "need to be resized" that this dialog was never designed to have so much entries to get scrolled through:
My theory is similar that it is possibly present in ARM just the number of registers are in reasonable size where the internal data-structure doesn't fall apart when it contains more entries. Previously the ARM had issue as the target CPUs contained lot of options, so CDT improved the internal data-structure. But the "Register Find" was maybe forgotten and still using some inefficient structure which explodes exponentially. It looks very similar to these: https://github.com/gnu-mcu-eclipse/eclipse-plugins/issues/307 https://github.com/gnu-mcu-eclipse/eclipse-plugins/issues/313 https://github.com/gnu-mcu-eclipse/eclipse-plugins/issues/325
So it might be similar problem just not fixed on this GUI element (while the others got re-implemented properly).
I didn't test the CDT directly , I expect the native GDB will not have a problem (like ARM does) and it might still contain the issue. So I need to figure out how to prove which module is actually the cause. I might run OpenOCD/emulation by hand, help it a lot and setup things by hand and then see what it does. Or the other idea what I had that I will pinpoint corresponding source code and then it might be clear where the cause of the problem is.
It might be inherited issue from CDT, but CDT might not experience it directly, so even if it's not GME caused issue probably it would be good to keep it here so it's a known limitation.
Just from the curiosity, is MAC affected as well? Could you give it try, the Linux/Windows slightly differ a bit how the UI stops responding, but the gist is the same that the Find dialog is making it haywire. It looks like it doesn't matter as much about the target and project details, just any target with huge amount of registers (so all RISC-V) could cause it.
is MAC affected as well?
yes, selecting the Register tab takes a long time to populate the content, and trying to Find also takes long time to open, but then the selection of the desired register seems ok. the UI is hardly usable if the Registers tab is concerned, but otherwise the debug session seems functional.
I'm afraid you are fighting a lost fight, as long as OpenOCD will list all those thousand registers, debuggers using it will have a hard life to handle them.
It looks like it triggers the edge cases on many tools, it's getting a bit better, but yes it's extreme condition for them.
I'm not sure I can do anything to fix this bug. If you can, please do, otherwise perhaps we should close this ticket.
Description
Find on RISC-V registers will make the UI unresponsive and eventually crashes
Steps to Reproduce
Expected behaviour: To see the Find dialog:
Actual behaviour: Get non-responding process, 100% CPU utilization, memory allocation increased, the dialog not showing up and if waited long enough it will crash with "Java heap space" error message. I get lot of "Warn : Got exception 0xffffffff when reading csr3563" warnings (with many CSR numbers, which do not even seem to be fetched sequentially). See the attached log, which was concatenated for brevity, but it kept running and logging out warning very quickly all the time:
reg-ctrl-warn.txt
Sometimes when I manage to terminate quickly the session I will get the dialog (of course now it's no good).
Versions