[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread Adrian Prantl via lldb-commits

https://github.com/adrian-prantl closed 
https://github.com/llvm/llvm-project/pull/89433
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread Adrian Prantl via lldb-commits

https://github.com/adrian-prantl updated 
https://github.com/llvm/llvm-project/pull/89433

>From 162907c6527464f828756b7152e2364ae3be88b5 Mon Sep 17 00:00:00 2001
From: Adrian Prantl 
Date: Fri, 19 Apr 2024 11:08:16 -0700
Subject: [PATCH] [lldb] Provide a better error message for missing symbols

This adds a hint to the missing symbols error message to make it
easier to understand what this means to users.
---
 lldb/source/Expression/IRExecutionUnit.cpp | 4 +++-
 lldb/test/API/lang/cpp/constructors/TestCppConstructors.py | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Expression/IRExecutionUnit.cpp 
b/lldb/source/Expression/IRExecutionUnit.cpp
index cb9bee8733e15d..07df8c52a2a4f0 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -431,7 +431,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, 
lldb::addr_t &func_addr,
 }
 
 m_failed_lookups.clear();
-
+ss.PutCString(
+"\nHint: The expression tried to call a function that is not present "
+"in the target, perhaps because it was optimized out by the 
compiler.");
 error.SetErrorString(ss.GetString());
 
 return;
diff --git a/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py 
b/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
index 6724bfc8ed78e0..140877adba735a 100644
--- a/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
+++ b/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
@@ -47,7 +47,7 @@ def test_constructors(self):
 self.expect(
 "expr ClassWithDeletedDefaultCtor().value",
 error=True,
-substrs=["Couldn't look up symbols:"],
+substrs=["Couldn't look up symbols:", "function missing"],
 )
 
 @skipIfWindows  # Can't find operator new.

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/89433
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/89433
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread Jonas Devlieghere via lldb-commits


@@ -431,7 +431,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, 
lldb::addr_t &func_addr,
 }
 
 m_failed_lookups.clear();
-
+ss.PutCString(
+"\nHint: The expression tried to call a function missing from the "
+"target, perhaps because it was optimized out by the compiler.");

JDevlieghere wrote:

[bikeshedding] 
... a function that is not available in the target, perhaps because ...
[/bikeshedding]

https://github.com/llvm/llvm-project/pull/89433
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere approved this pull request.

LGMT with the formatting fixed.

https://github.com/llvm/llvm-project/pull/89433
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread Felipe de Azevedo Piovezan via lldb-commits

https://github.com/felipepiovezan approved this pull request.

This LGTM!
I like the wording in the sense that it uses a slightly less "systemy" 
language, and so it becomes less cryptic to a wider audience.

https://github.com/llvm/llvm-project/pull/89433
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 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 
4841d70a4b7d7cd8c492c16a9da339ec75bca135...d57f2adff84dc5148c417135aa4733e05476876c
 lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
``





View the diff from darker here.


``diff
--- TestCppConstructors.py  2024-04-19 18:22:28.00 +
+++ TestCppConstructors.py  2024-04-19 18:27:21.930974 +
@@ -45,12 +45,11 @@
 substrs=["Couldn't look up symbols:"],
 )
 self.expect(
 "expr ClassWithDeletedDefaultCtor().value",
 error=True,
-substrs=["Couldn't look up symbols:",
- "function missing"],
+substrs=["Couldn't look up symbols:", "function missing"],
 )
 
 @skipIfWindows  # Can't find operator new.
 @skipIfLinux  # Fails on some Linux systems with SIGABRT.
 def test_constructors_new(self):

``




https://github.com/llvm/llvm-project/pull/89433
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Adrian Prantl (adrian-prantl)


Changes

This adds a hint to the missing symbols error message to make it easier to 
understand what this means to users.

---
Full diff: https://github.com/llvm/llvm-project/pull/89433.diff


2 Files Affected:

- (modified) lldb/source/Expression/IRExecutionUnit.cpp (+3-1) 
- (modified) lldb/test/API/lang/cpp/constructors/TestCppConstructors.py (+2-1) 


``diff
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp 
b/lldb/source/Expression/IRExecutionUnit.cpp
index cb9bee8733e15d..8d4e5aaf9fe7ea 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -431,7 +431,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, 
lldb::addr_t &func_addr,
 }
 
 m_failed_lookups.clear();
-
+ss.PutCString(
+"\nHint: The expression tried to call a function missing from the "
+"target, perhaps because it was optimized out by the compiler.");
 error.SetErrorString(ss.GetString());
 
 return;
diff --git a/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py 
b/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
index 6724bfc8ed78e0..d73b2af1ca077c 100644
--- a/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
+++ b/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
@@ -47,7 +47,8 @@ def test_constructors(self):
 self.expect(
 "expr ClassWithDeletedDefaultCtor().value",
 error=True,
-substrs=["Couldn't look up symbols:"],
+substrs=["Couldn't look up symbols:",
+ "function missing"],
 )
 
 @skipIfWindows  # Can't find operator new.

``




https://github.com/llvm/llvm-project/pull/89433
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Provide a better error message for missing symbols (PR #89433)

2024-04-19 Thread Adrian Prantl via lldb-commits

https://github.com/adrian-prantl created 
https://github.com/llvm/llvm-project/pull/89433

This adds a hint to the missing symbols error message to make it easier to 
understand what this means to users.

>From d57f2adff84dc5148c417135aa4733e05476876c Mon Sep 17 00:00:00 2001
From: Adrian Prantl 
Date: Fri, 19 Apr 2024 11:08:16 -0700
Subject: [PATCH] [lldb] Provide a better error message for missing symbols

This adds a hint to the missing symbols error message to make it
easier to understand what this means to users.
---
 lldb/source/Expression/IRExecutionUnit.cpp | 4 +++-
 lldb/test/API/lang/cpp/constructors/TestCppConstructors.py | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Expression/IRExecutionUnit.cpp 
b/lldb/source/Expression/IRExecutionUnit.cpp
index cb9bee8733e15d..8d4e5aaf9fe7ea 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -431,7 +431,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, 
lldb::addr_t &func_addr,
 }
 
 m_failed_lookups.clear();
-
+ss.PutCString(
+"\nHint: The expression tried to call a function missing from the "
+"target, perhaps because it was optimized out by the compiler.");
 error.SetErrorString(ss.GetString());
 
 return;
diff --git a/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py 
b/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
index 6724bfc8ed78e0..d73b2af1ca077c 100644
--- a/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
+++ b/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
@@ -47,7 +47,8 @@ def test_constructors(self):
 self.expect(
 "expr ClassWithDeletedDefaultCtor().value",
 error=True,
-substrs=["Couldn't look up symbols:"],
+substrs=["Couldn't look up symbols:",
+ "function missing"],
 )
 
 @skipIfWindows  # Can't find operator new.

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits