[Lldb-commits] [lldb] [lldb-dap] Updating VariableDescription to use GetDescription() as a fallback. (PR #77026)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 10 12:28:46 PST 2024


clayborg wrote:

> > Is there a way we can tell that the request is from the console and only enable this feature if we are going to dump it to the debug console?
> 
> Yea, the DAP has a context we can use to limit this https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Evaluate
> 
> ```
>   /**
>    * The context in which the evaluate request is used.
>    * Values:
>    * 'watch': evaluate is called from a watch view context.
>    * 'repl': evaluate is called from a REPL context.
>    * 'hover': evaluate is called to generate the debug hover contents.
>    * This value should only be used if the corresponding capability
>    * `supportsEvaluateForHovers` is true.
>    * 'clipboard': evaluate is called to generate clipboard contents.
>    * This value should only be used if the corresponding capability
>    * `supportsClipboardContext` is true.
>    * 'variables': evaluate is called from a variables view context.
>    * etc.
>    */
>   context?: 'watch' | 'repl' | 'hover' | 'clipboard' | 'variables' | string;
> ```
> 
> I'll work on an update to this logic to only use GetDescription for `hover` and `repl` cases.

That will work nicely.

https://github.com/llvm/llvm-project/pull/77026


More information about the lldb-commits mailing list