Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add live watch support when debug in eclipse ide #579

Open
fanghuaqi opened this issue Jun 28, 2023 · 12 comments
Open

Feature request: add live watch support when debug in eclipse ide #579

fanghuaqi opened this issue Jun 28, 2023 · 12 comments

Comments

@fanghuaqi
Copy link

Hello, @ilg-ul , I am using this eclipse plugins to debug riscv projects, and we found current debug don't support live watch on register and expression, and riscv support access memory via system bus, maybe when program running we can access the register and memory via system bus.

image

similar issue have been discussed here https://www.eclipse.org/forums/index.php/t/440474/

and similar work have been done in arm eclipse ide, see https://mcuoneclipse.com/2013/01/27/live-view-for-variables-and-memory/

I am wondering whether we can add this feature in this plugin? If possible, any idea in how to implement it, maybe when we have resource, we can try to work on it.

Thanks
Huaqi

@ilg-ul
Copy link
Contributor

ilg-ul commented Jun 28, 2023

support live watch ... whether we can add this feature?

Well, this is by all means not a quick patch but a complex project, and I don't even know which JTAG probes would support it.

... maybe when we have resource ...

If someone decides to dedicate resources to implement it, sure, we can consider it.

@TommyMurphyTM1234
Copy link

TommyMurphyTM1234 commented Jun 28, 2023

and we found current debug don't support live watch on register and expression, and riscv support access memory via system bus

Isn't it a prerequisite here that something like OpenOCD supports these features before the plugins can leverage/orchestrate them? Does it support them already? If not then adding support there would be a better place to start?

Edit: I guess that OpenOCD does support system bus access:

I can't see if access to registers - even using SBA - is possible while the target is still running. The debug spec suggests that it's only memory that can be accessed in this way:

2023-06-28 08 10 45

I think that a first step is to clarifiy:

  1. The capabilities provided by the RISC-V debug spec
  2. The set of such capabilities supported (or not) by the current OpenOCD implementation

before considering what needs to be done to the plugins to provide support for the capabilities originally mentioned.

@fanghuaqi
Copy link
Author

Well, this is by all means not a quick patch but a complex project, and I don't even know which JTAG probes would support it.

Hi @ilg-ul , this is a feature of riscv debug spec, as I know openocd1, jlink 2 support it.

Isn't it a prerequisite here that something like OpenOCD supports these features before the plugins can leverage/orchestrate them? Does it support them already? If not then adding support there would be a better place to start?

Hi @TommyMurphyTM1234 , openocd support it via config in openocd cfg file like riscv set_mem_access sysbus, but when we debug program in eclipse, and click run it, then you will not be able to view the expression value and memory content, other ide allow periodly monitor these values by a configured time such as 0.5s, but I didn't know how we can achive it in current plugin.

--

@TommyMurphyTM1234
Copy link

TommyMurphyTM1234 commented Jun 28, 2023

Hi @ilg-ul , this is a feature of riscv debug spec, as I know openocd1, jlink 2 support it.

Can you clarify where access to registers is provided by the current OpenOCD imlementation please?

Hi @TommyMurphyTM1234 , openocd support it via config in openocd cfg file like riscv set_mem_access sysbus, but when we debug program in eclipse, and click run it, then you will not be able to view the expression value and memory content, other ide allow periodly monitor these values by a configured time such as 0.5s, but I didn't know how we can achive it in current plugin.

Does GDB via the command line console in Eclipse - or eben GDB standalone outside of Eclipse altogether - allow you to exercise these features?
That would probably be another prerequisite before the plugins can do anything.

@fanghuaqi
Copy link
Author

Can you clarify where access to registers is provided by the current OpenOCD imlementation please?

This feature seems not available in openocd, hardware may not support it.

@fanghuaqi
Copy link
Author

Does GDB via the command line console in Eclipse - or eben GDB standalone outside of Eclipse altogether - allow you to exercise these features?

No, I tried send gdb command in eclipse debugger console when target is running, not response is back.

@TommyMurphyTM1234
Copy link

Does GDB via the command line console in Eclipse - or eben GDB standalone outside of Eclipse altogether - allow you to exercise these features?

No, I tried send gdb command in eclipse debugger console when target is running, not response is back.

@ilg-ul can correct me if I'm wrong but I believe that the plugins will only be able to exercise features that GDB allows to be used in the first place.

Sounds to me like this is potentially a mini project that needs to consider some or all of the following - and maybe others - and not just the plugins:

  1. RISC-V debug spec and debug capabilities - in particular what target resources are accessible via SBA while the target is free running
  2. OpenOCD (and other GDB servers) support for these capabilities
  3. GDB (and LLDB?) support for same
  4. What capabilities other commercial/non open-source tools provide
  5. Eclipse plugin support for these capabilities

@ilg-ul
Copy link
Contributor

ilg-ul commented Jun 28, 2023

I believe that the plugins will only be able to exercise features that GDB allows to be used in the first place.

That's correct.

Only if you can use a feature in a terminal we should consider changes to the debug plug-ins.

@fanghuaqi
Copy link
Author

I collect some live watch features supported in other IDE for riscv:

see https://wwwfiles.iar.com/riscv/EWRISCV_DebuggingGuide.pdf

image

@ilg-ul
Copy link
Contributor

ilg-ul commented Jul 4, 2023

Just that, as far as I know, IAR does not use GDB. Neither SEGGER.

@TommyMurphyTM1234
Copy link

TommyMurphyTM1234 commented Jul 4, 2023

Just that, as far as I know, IAR does not use GDB. Neither SEGGER.

I agree. While such info about other tools may be interesting and informative, the key issue here is to first determine what, if any, support GDB has for the capabilities in question. If it doesn't have any then support would need to be added to GDB before the plugins can be modified to leverage those capabilities.

In this context, GDB features such as background execution and non-stop mode may be relevant:

However, this:

Currently GDB only really executes asynchronously with remote targets and this interaction is mimicked in other cases.

makes me wonder how much can actually be done by GDB while the target is running and not in background debug/debug halt state?

@TommyMurphyTM1234
Copy link

Actually, this might be of relevance:

If VisualGDB can leverage GDB and OpenOCD to provide this feature then perhaps the plugins can too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants