Repository navigation
Conversation
A context query with a mistake was only refused by the agent once the session sent it. The user then saw an error, or a symbol file or breakpoint that applied to nothing, long after typing the query. Typical mistakes are IDs with '.' or '[' that are not in quotes, and HasState=True, which the agent takes as false without an error. The context picker and the launch configurations editor now check the query. The checker follows the agent's parser, not only the grammar on the spec page, so it accepts what the agent accepts. It also knows the Simics IDList attribute. It rejects '"a"b', which the agent accepts but which can never match. Problems show when the user stops typing for five seconds or tries to save the query, so a half-typed query is not marked at every key press. The input box of the picker cannot color text, so it names the column and the wrong part instead. IDs in an IDList are not checked against the target, because the editor has no session to ask. Signed-off-by: Claes Lillieskold <claes.lillieskold@intel.com>
A context query can be valid and still not select the contexts the user wants, for example when an ID has a typo. For a symbol file, a query can also select only threads. Threads have no memory map of their own, so the agent adds the file nowhere. The user only found this out after the session started. While a session to the agent runs, the query is now sent to ContextQuery.query shortly after the user stops typing. The launch configurations editor lists the contexts it selects, and for a symbol file which of them get the file. The context picker tells how many. A query the agent refuses is marked like the other problems, so the mistakes the local checker misses are found too. To type a query, the user also needs the attribute names and the context IDs of the target. Suggestions now come from the agent (ContextQuery.getAttrNames and the contexts of the session). Without a session, only the wildcards and the common attributes are suggested. In the editor, the query is typed in a box below the row, which has room for the suggestions and the list of contexts. The screenshots in docs/images/ are not made again yet. Signed-off-by: Claes Lillieskold <claes.lillieskold@intel.com>
| for `ID` and the IDs in an `IDList`. Names and IDs that need double quotes | ||
| get them. An `IDList` suggests the IDs of the contexts that can run and be | ||
| stopped, without quotes around them. It adds the `"[` when you type an ID | ||
| without it, as in `IDList="cpu`, and the `]"` when the list is not closed |
There was a problem hiding this comment.
The IDList context query is not documented anywhere. I would say that it's an internal / tech preview type of context-query. Same for TreeID, although that is used internally by code-coverage.
We could remove any of these at any point. Should either be made official by documenting etc or not be exposed through this extension.
One thing I noticed with this is that we have missed to include some newer context query comparators from open source, ParentName, AncestorID and AncestorName from 61d5800f.
We should include those in base and include them here. AncestorID is rather close to TreeID, with the difference that TreeID includes the context with the provided id, while Ancestor excludes that.
| } | ||
| const added = result.matches.filter((m) => m.ownMemoryMap).length; | ||
| if (added === 0) { | ||
| return `${selects}, but none has a memory map of its own, so the symbol file is added to none`; |
There was a problem hiding this comment.
This was rather confusing to me when I saw.
I tried to add a symbol file to "UEFI Firmware"/* and got this. Why would this not work. What does it mean that it's added to none? And that none has a memory map of its own, I am adding a memory map by adding a symbol file.
A strange thing around this is that this works perfectly fine when I add a symbol file with this context query in CLI, but when I add a symbol file like this in the extension I don't see the same stack trace. Shouldn't have anything to do with this PR I guess. Doesn't even work if I add to the specific context or all.
| } | ||
|
|
||
| /** The names of `contexts` as completions, each once, with the ID of the context that has it. */ | ||
| function contextNames(contexts: QueryContext[]): ContextQueryCompletion[] { |
There was a problem hiding this comment.
Not sure from exact what part of the code it comes from, but the contexts shown in the view include the ISD specific contexts such as PLREG, CPUID etc. Likely contexts without state that exist under a context with state should be filtered out or something like that.
| case "part": | ||
| items = [ | ||
| { label: "*", text: "*", detail: "Any context" }, | ||
| { label: "**", text: "**", detail: "Any number of contexts, also none" }, |
There was a problem hiding this comment.
Why does ** clarify that it also applies to none but * does not. Both can apply to 0 or more contexts.
At top level (without any slashes included) then * and ** should be the same, but the explanation is rather different, can be confusing.
| ? "it" | ||
| : "all of them" | ||
| : added === 1 | ||
| ? "the one with a memory map of its own" |
There was a problem hiding this comment.
I find this rather confusing as well. What does it mean with "a memory map of its own" when I am adding a symbol file that adds a memory map?
aragners
left a comment
There was a problem hiding this comment.
Nice in general, some output is confusing even to me.
And some queries and contexts are internal.
A context query with a mistake was only refused by the agent once the session sent it. The user then saw an error, or a symbol file or breakpoint that applied to nothing, long after typing the query. Typical mistakes are IDs with '.' or '[' that are not in quotes, and HasState=True, which the agent takes as false without an error.
The context picker and the launch configurations editor now check the query. The checker follows the agent's parser, not only the grammar on the spec page, so it accepts what the agent accepts. It also knows the Simics IDList attribute. It rejects '"a"b', which the agent accepts but which can never match.
Problems show when the user stops typing for five seconds or tries to save the query, so a half-typed query is not marked at every key press. The input box of the picker cannot color text, so it names the column and the wrong part instead.
IDs in an IDList are not checked against the target, because the editor has no session to ask.