Support value formatting#506
Conversation
jonahgraham
left a comment
There was a problem hiding this comment.
In addition, please write a test or two to show requests with the format set.
|
After further discussions in this PR, also in eclipse-cdt-cloud/cdt-gdb-vscode#208 and privately with @jreineckearm I drastically changed the implementation in this PR to accommodate multiple value formats and also make it easier for other extensions to make use of the adapter. |
jreineckearm
left a comment
There was a problem hiding this comment.
Thanks for the updates, see some comments.
asimgunes
left a comment
There was a problem hiding this comment.
Minor comments about code quality.
|
Thanks for the feedback, @asimgunes . Comments make sense. Be aware that @omarArm is away until beginning of April. Hence will only pick the feedback up afterwards. |
|
Converted to draft until Omar is back to sort out review comments. |
cwalther
left a comment
There was a problem hiding this comment.
I am not familiar enough with these code areas for a thorough architectural review, but in the details it looks sensible now.
In some anecdotal testing on an Indel target, it appears to work.
I notice that when I make a watch expression with a local variable and a format specifier, that also affects the display of that variable in the Variables view. Is that intentional? Also, when I have two watch expressions with the same expression, but different format specifiers, they affect each other – that is probably not intentional. I think being able to see the same value in two different formats would sometimes be useful.
jreineckearm
left a comment
There was a problem hiding this comment.
Given feedback makes a lot of sense, thanks to everyone helping here.
Some of the feedback should probably go into a new PR to keep the changes better reviewable. Omar is working on some final changes for this one here.
I am away until Thursday next week. Can please one of the other committers help with merging after Omar did these changes and while I am away? Thanks
|
@cwalther @jonahgraham I did some preliminary investigation on why that might be happening. My guess so far is that caching the value format might not be a good idea after all, since GDB does that for us anyway. I suggest we merge the current PR first and then, for better review granularity, I will start right away with another PR to improve the behaviour. |
There was a problem hiding this comment.
I am fine with merging this as-is (squashed and rebased) and addressing the crosstalk separately, but I’ll defer to @jonahgraham.
|
I see you have continued to work on this - I just realized I never commented in response to #506 (comment) - but since the current implementation can show incorrect data I don't think we should merge until resolved. I see @omarArm has added new commits since with title "eliminating interference between same expressions with different valu…" so it sounds like that is the way things are progressing anyway. |
|
@jonahgraham yes, we came to the same conclusion that we should not merge without fixing the interference issue. After some investigation, I opted for the current implementation. |
jonahgraham
left a comment
There was a problem hiding this comment.
This LGTM - I tried it out and had a look. I know you are still polishing and resolving test failures, but besides that we should be good to go.
|
Would using |
|
@cwalther nice catch. I must have missed this command while reading the documentation. I tried it and it worked |
| expectRejection, | ||
| fillDefaults, | ||
| gdbAsync, | ||
| //gdbAsync, |
There was a problem hiding this comment.
One more leftover comment.
Also, I think the commits that touch this should be squashed separately from the rest, because that is not really related to this PR, but rather an amendment of #523. (Making a separate PR for it is probably overkill, but if you want I can merge it.)
There was a problem hiding this comment.
Done. I will squash before merging then
cwalther
left a comment
There was a problem hiding this comment.
Code looks good to me now, thanks for the patience! (You could have left the async, if you prefer it that way, my comments are not meant as orders.) I would like to give it another test, but that will have to wait until Monday. If you would prefer to have it merged before the weekend, I am fine with @jreineckearm or anyone else merging.
|
Thanks for the review, @cwalther . We had discussed offline why the |
Send invalidate event on radix change (eclipse-cdt-cloud#523) Sends an invalidate variables event to client when seeing GDB async notification that `output-radix` changes. removing residue changes originally introduced to var manager
trying out new eval expression command code cleanup restoring function prototype to old version prettier
removing a single leftover comment
0d69d2b to
93d43d3
Compare
cwalther
left a comment
There was a problem hiding this comment.
Tested, looks good.
I assume @jreineckearm will merge once you are done tidying up commits; if not, ping me if you want me to do it.
jreineckearm
left a comment
There was a problem hiding this comment.
Thanks, LGTM! Gave it a try, and it took me a while to realize I shouldn't add a space between , and x in ,x to make it work. ;-)
Thanks, @cwalther , for your support on this one!
Merging
|
But please get the commits into a clean shape before merging. (As mentioned I would prefer two commits.) |
|
You squashed it into one. Oh well, not a big deal. |
Sorry, forgot about it.... let me know if you'd like me to revert and split up. |
|
Do you have push access to the main branch? Last time I tried, I didn’t, the only write access I had was using the GitHub web UI to merge PRs. But anyway, don’t bother if you have more important things to do. The piece that doesn’t belong here is small and not important. |
|
I am afraid not, you should be able to see branch protection rules here: https://otterdog.eclipse.org/projects/ecd.cdt-cloud/repos/cdt-gdb-adapter#branch-protection-rules
OK, sorry again. Had completely forgotten about it over the weekend and only saw your comment the very second that I had pushed squash and merge after cleaning up the commit message..... |
|
No worries. |





Should solve eclipse-cdt-cloud/cdt-gdb-vscode#210
New implementation:
sendVarSetFormatToHexto make it more generic to different value formats. Also changed the return type from void to string, to retrieve the actual value.evaluaterequest, added support for setting value format for expressionsdisplayFormattoVarObjTypeNow users can provide format specifiers to their expressions. It can be
Old implementation:
Supporting value formatting in evaluate requests.
formatproperty of evaluate request arguments before sending resultNotes