-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support disassembly view #7
Conversation
When using multicore debugging using the CDT-amalgamator feature in the VS Code debug plugin. Disassembly view is not available for amalgamator debug launches. We need to support disassembly view for this case.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand what you are doing here. I assume the problem you are facing is there is no context in a disassembleRequest to identify which childDap to use? Your solution is reasonable, but has a limitation that it only works in this one use of the childDap creating the memory reference. What I propose below allows the IDE client to create new and arbitrary memory references. This will easily extend to memory reads and writes too.
We should define a bidirectional scheme that the amalgamator can use to map client requests to the correct child dap, and take memory references returned by a child dap and add something to them so they can be sent to the client.
e.g. memory references of child daps could require something like the name, index or ID as a prefix.
I would recommend that the memory reference be ChildDapArguments.index + ":" + addressReference
within child dap.
The index
field may need to be saved from the argument index
in createChild
I have made comments on the individual lines on what the local code should be.
This comment was marked as resolved.
This comment was marked as resolved.
Dear @jonahgraham-san, Here it the trace of that situation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, there is a big problem is that whenever we run program (step over, step in, step out....) with disassembly view opened, disassemble command is never called, So in this case disassembleRequest will not be called.
This sounds like a VSCode bug at first - but there may be something else going on as if I run cdt-gdb-adapter on its own I see subsequent disassemble requests happening. The trace you have provided looks like one of the children's traces. Do you have the trace of the amalgamator? The first thing I would look for is making sure all previous disassemble requests have a response, especially in light of the missing response in the else case below.
PS. I made two changes to this issue:
- I marked all resolved conversations as resolved so it is easier to see what is left to discuss
- I "hid" the trace in your last comment in a details.
The trace that I provided to you is the trace of the amalgamator. I have configurated launch.json like below:
|
Sorry, I misread it. I can see that it is indeed the amalgamator now. Sorry about the confusion. Can you provide the whole trace? Is there a message with no response earlier for example? |
Dear @jonahgraham |
Thanks - that is strange. When I run cdt-gdb-adapter by itself i see the subsequent disassemble requests coming from vscode. If you run directly with cdt-gdb-adapter does it work properly? Maybe there is something going bad with the way we annotate the instructionPointerReference. If you remove the annotation ( It sounds like we may have to debug vscode itself to figure this one out. |
It works normally when I run with cdt-gdb-adapter |
It also run normally when remove frame.instructionPointerReference = childIndex + ':' + frame.instructionPointerReference; |
Sounds like vscode is assuming something about the data in instructionPointerReference beyond what is in the spec. I will have a look at the code to see if it stands out to me, then you can file a bug report. |
There is indeed an issue in VSCode, this line which reads: if (element && this._disassemblyView.currentInstructionAddresses.includes(element.instruction.address)) { compares Two lines later the same same type of comparison error is made. So to me it looks like there are a number of assumptions in VSCode that don't match the DAP spec. However, what the code is doing is treating I think it would be great to fix vscode here so that it works with memory spaces. Did you ever file the earlier bugs on this issue we discussed in #7 (comment) ? |
-> I'm sorry I haven't done it yet. Since I don't really understand what the problem is here, I plan to report it after I really understand what the problem is. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Hopefully with my #7 (comment) you can now understand the problem. Feel free to ask follow ups. The summaries of the bugs:
|
Thank you so much. I will file these bugs in next working day. So does that mean we will support disassembly view once these bugs are resolved? |
I think so, needs testing to see what else may be going on here. I don't know if it is in scope for Renesas to fund, but Renesas could simply provide a PR to VSCode that fixes these things. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks quite reasonable to me, just needs some code simplification and an explanation somewhere as to "why" do it this way, and what the risk is, cross-referenced with the VSCode issue.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Thank you for the comment @QuocDoBV - I am reproducing it in the OP for visibility. |
When using multicore debugging using the CDT-amalgamator feature in the VS Code debug plugin. Disassembly view is not available for amalgamator debug launches. We need to support disassembly view for this case.
The eventual solution that was agreed on needed to workaround problems in VSCode:
Solution:
Notes: