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

2024-05-17 Thread John Harrison via lldb-commits
ashgti wrote: Sounds good to me https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-05-17 Thread Walter Erquinigo via lldb-commits
walter-erquinigo wrote: I'm okay with anything that ensures hovering is fast. https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-05-17 Thread Pavel Labath via lldb-commits
labath wrote: Thanks for checking this out. > I just checked and I'm not seeing the hover's in the same format as they were > when I made the pull request. The expression context should still have the > expanded forms though for example: >

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

2024-05-16 Thread John Harrison via lldb-commits
ashgti wrote: I just checked and I'm not seeing the hover's in the same format as they were when I made the pull request. The expression context should still have the expanded forms though for example: https://github.com/llvm/llvm-project/assets/22535/28db4adc-d488-44ff-8d99-78966e0e0e05;> I

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

2024-05-15 Thread Pavel Labath via lldb-commits
labath wrote: Thanks for checking this out. I'll try to whip something up tomorrow. https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-05-14 Thread Walter Erquinigo via lldb-commits
walter-erquinigo wrote: I don't think anything has changed on VSCode proper. I've just verified I have the same experience as you. Given what you said, I'm in favor of reverting this or at least gating this feature under a json initialization option until the original author can look at this.

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

2024-05-14 Thread Pavel Labath via lldb-commits
labath wrote: I'm currently optimizing our data formatters for some fairly complex data structures, and I've ran into something I don't understand. My DAP packet sequence for a hover request consists of two (mostly redundant) packets: ``` --> Content-Length: 114 { "arguments": {

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

2024-01-12 Thread David Goldman via lldb-commits
https://github.com/DavidGoldman closed https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-01-12 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-01-12 Thread John Harrison via lldb-commits
@@ -1210,15 +1210,16 @@ bool SBValue::GetDescription(SBStream ) { ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); - if (value_sp) { -DumpValueObjectOptions options; -options.SetUseDynamicType(m_opaque_sp->GetUseDynamic()); -

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

2024-01-12 Thread John Harrison via lldb-commits
@@ -405,6 +405,9 @@ struct VariableDescription { /// Create a JSON object that represents these extensions to the DAP variable /// response. llvm::json::Object GetVariableExtensionsJSON(); + + /// Returns a description of the value appropraite for the specified context.

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

2024-01-12 Thread John Harrison via lldb-commits
@@ -173,21 +173,21 @@ TryCreateAutoSummaryForContainer(lldb::SBValue ) { lldb::SBValue child = v.GetChildAtIndex(i); if (llvm::StringRef name = child.GetName(); !name.empty()) { - llvm::StringRef value; + llvm::StringRef desc; if (llvm::StringRef

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

2024-01-12 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/77026 >From 56d1520f2ce7eb9a9f0c5b5c199deefab15dadfa Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 4 Jan 2024 15:42:35 -0800 Subject: [PATCH] [lldb-dap] Updating VariableDescription to use GetDescription()

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

2024-01-12 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/77026 >From 52d6dc8f26477b8fba839194ac1485274312a865 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 4 Jan 2024 15:42:35 -0800 Subject: [PATCH] [lldb-dap] Updating VariableDescription to use GetDescription()

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

2024-01-11 Thread John Harrison via lldb-commits
@@ -1210,15 +1210,16 @@ bool SBValue::GetDescription(SBStream ) { ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); - if (value_sp) { -DumpValueObjectOptions options; -options.SetUseDynamicType(m_opaque_sp->GetUseDynamic()); -

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

2024-01-11 Thread Greg Clayton via lldb-commits
@@ -1210,15 +1210,16 @@ bool SBValue::GetDescription(SBStream ) { ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); - if (value_sp) { -DumpValueObjectOptions options; -options.SetUseDynamicType(m_opaque_sp->GetUseDynamic()); -

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

2024-01-11 Thread Greg Clayton via lldb-commits
@@ -173,21 +173,21 @@ TryCreateAutoSummaryForContainer(lldb::SBValue ) { lldb::SBValue child = v.GetChildAtIndex(i); if (llvm::StringRef name = child.GetName(); !name.empty()) { - llvm::StringRef value; + llvm::StringRef desc; if (llvm::StringRef

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

2024-01-11 Thread Greg Clayton via lldb-commits
@@ -405,6 +405,9 @@ struct VariableDescription { /// Create a JSON object that represents these extensions to the DAP variable /// response. llvm::json::Object GetVariableExtensionsJSON(); + + /// Returns a description of the value appropraite for the specified context.

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

2024-01-11 Thread John Harrison via lldb-commits
ashgti wrote: > That will work nicely. Done, the latest revision will only use the description for hovers and repl contexts. https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

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

2024-01-10 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/77026 >From 7656af47e058aa7101504cb31aaa067178110351 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 4 Jan 2024 15:42:35 -0800 Subject: [PATCH 1/6] [lldb-dap] Updating VariableDescription to use

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

2024-01-10 Thread John Harrison via lldb-commits
ashgti wrote: Sorry about the spam, I synced my branch and it looks like the pull request added reviewers from all the patches. https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

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

2024-01-10 Thread via lldb-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 241fe83704476f81e3438e32b6d988ea123e624d...d8eb78e220b2127b78cee2868daddbe57ae2c5c8

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

2024-01-10 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/77026 >From 7656af47e058aa7101504cb31aaa067178110351 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 4 Jan 2024 15:42:35 -0800 Subject: [PATCH 1/5] [lldb-dap] Updating VariableDescription to use

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

2024-01-10 Thread Greg Clayton via lldb-commits
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 >

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

2024-01-10 Thread John Harrison via lldb-commits
ashgti 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

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

2024-01-10 Thread Walter Erquinigo via lldb-commits
walter-erquinigo wrote: Now that I think of it, it would be really nice if GetDescription() could get a `one_line` flag that prints the description as a single line. Then the rendering will be much better on vscode, because we already dump the children of each object anyway.

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

2024-01-10 Thread Greg Clayton via lldb-commits
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? https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list

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

2024-01-10 Thread Greg Clayton via lldb-commits
clayborg wrote: > > Looks fine to me. Can we add a test? > > Updated the existing tests to check the adjusted format. > > One issue I did notice with tests is that the response to an expression will > include a response are automatically persisted by > `SBValue::GetDescription()`, so you

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

2024-01-09 Thread John Harrison via lldb-commits
@@ -135,6 +135,21 @@ std::vector GetStrings(const llvm::json::Object *obj, return strs; } +static std::string GetDescriptionTrimmed(lldb::SBValue ) { + lldb::SBStream stream; + if (!value.GetDescription(stream)) { +return ""; + } ashgti wrote:

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

2024-01-09 Thread John Harrison via lldb-commits
@@ -135,6 +135,21 @@ std::vector GetStrings(const llvm::json::Object *obj, return strs; } +static std::string GetDescriptionTrimmed(lldb::SBValue ) { ashgti wrote: Done. https://github.com/llvm/llvm-project/pull/77026

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

2024-01-09 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/77026 >From 7656af47e058aa7101504cb31aaa067178110351 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 4 Jan 2024 15:42:35 -0800 Subject: [PATCH 1/4] [lldb-dap] Updating VariableDescription to use

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

2024-01-09 Thread Walter Erquinigo via lldb-commits
@@ -135,6 +135,21 @@ std::vector GetStrings(const llvm::json::Object *obj, return strs; } +static std::string GetDescriptionTrimmed(lldb::SBValue ) { + lldb::SBStream stream; + if (!value.GetDescription(stream)) { +return ""; + } walter-erquinigo

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

2024-01-09 Thread Walter Erquinigo via lldb-commits
@@ -135,6 +135,21 @@ std::vector GetStrings(const llvm::json::Object *obj, return strs; } +static std::string GetDescriptionTrimmed(lldb::SBValue ) { walter-erquinigo wrote: add a comment for this function mentioning that this returns an empty string if

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

2024-01-09 Thread Walter Erquinigo via lldb-commits
https://github.com/walter-erquinigo edited https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-01-09 Thread Walter Erquinigo via lldb-commits
https://github.com/walter-erquinigo approved this pull request. just two minor things left, but otherwise LGTM https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

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

2024-01-09 Thread Walter Erquinigo via lldb-commits
@@ -242,19 +254,57 @@ def do_test_scopes_variables_setVariable_evaluate( }, "pt": { "equals": {"type": "PointType"}, -"startswith": { -"result": "{x:11, y:22}" +"equals": { +

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

2024-01-09 Thread John Harrison via lldb-commits
@@ -242,19 +254,57 @@ def do_test_scopes_variables_setVariable_evaluate( }, "pt": { "equals": {"type": "PointType"}, -"startswith": { -"result": "{x:11, y:22}" +"equals": { +

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

2024-01-09 Thread John Harrison via lldb-commits
@@ -135,6 +135,18 @@ std::vector GetStrings(const llvm::json::Object *obj, return strs; } +static std::string GetDescriptionTrimmed(lldb::SBValue ) { + lldb::SBStream stream; + value.GetDescription(stream); ashgti wrote: Updated `bool

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

2024-01-09 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/77026 >From 7656af47e058aa7101504cb31aaa067178110351 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 4 Jan 2024 15:42:35 -0800 Subject: [PATCH 1/3] [lldb-dap] Updating VariableDescription to use

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

2024-01-09 Thread Walter Erquinigo via lldb-commits
@@ -242,19 +254,57 @@ def do_test_scopes_variables_setVariable_evaluate( }, "pt": { "equals": {"type": "PointType"}, -"startswith": { -"result": "{x:11, y:22}" +"equals": { +

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

2024-01-09 Thread Walter Erquinigo via lldb-commits
@@ -135,6 +135,18 @@ std::vector GetStrings(const llvm::json::Object *obj, return strs; } +static std::string GetDescriptionTrimmed(lldb::SBValue ) { + lldb::SBStream stream; + value.GetDescription(stream); walter-erquinigo wrote: The method `bool

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

2024-01-09 Thread John Harrison via lldb-commits
ashgti wrote: cc @walter-erquinigo since this looks like it has similar overlap to the auto generated summeries. https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

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

2024-01-05 Thread John Harrison via lldb-commits
ashgti wrote: > Looks fine to me. Can we add a test? Updated the existing tests to check the adjusted format. One issue I did notice with tests is that the response to an expression will include a response are automatically persisted by `SBValue::GetDescription()`, so you will see the value

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

2024-01-05 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/77026 >From 7656af47e058aa7101504cb31aaa067178110351 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 4 Jan 2024 15:42:35 -0800 Subject: [PATCH 1/2] [lldb-dap] Updating VariableDescription to use

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

2024-01-05 Thread via lldb-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 241fe83704476f81e3438e32b6d988ea123e624d 4fe831e0bb779a3bda255033e475dcf3979daa61 --

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

2024-01-05 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/77026 >From 7656af47e058aa7101504cb31aaa067178110351 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 4 Jan 2024 15:42:35 -0800 Subject: [PATCH 1/2] [lldb-dap] Updating VariableDescription to use

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

2024-01-04 Thread Greg Clayton via lldb-commits
https://github.com/clayborg commented: Looks fine to me. Can we add a test? https://github.com/llvm/llvm-project/pull/77026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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

2024-01-04 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: John Harrison (ashgti) Changes When generating a `display_value` for a variable the current approach calls `SBValue::GetValue()` and `SBValue::GetSummary()` to generate a `display_value` for the `SBValue`. However, there are cases where

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

2024-01-04 Thread John Harrison via lldb-commits
https://github.com/ashgti created https://github.com/llvm/llvm-project/pull/77026 When generating a `display_value` for a variable the current approach calls `SBValue::GetValue()` and `SBValue::GetSummary()` to generate a `display_value` for the `SBValue`. However, there are cases where both