[Lldb-commits] [lldb] Add asan tests for libsanitizers. (PR #88349)

2024-04-10 Thread Usama Hameed via lldb-commits

https://github.com/usama54321 updated 
https://github.com/llvm/llvm-project/pull/88349

>From de4ed3289ecb52b4971f6abe942c0a3af9e6425a Mon Sep 17 00:00:00 2001
From: usama 
Date: Wed, 10 Apr 2024 21:07:11 -0700
Subject: [PATCH] [LLDB] Add asan tests for libsanitizers.

This patch tests LLDB integration with libsanitizers for ASan. This
integration works through the ASanLibsanitizers plugin in the
InstrumentationRuntime.

rdar://111856681
---
 lldb/test/API/functionalities/asan/Makefile   |  6 +-
 .../functionalities/asan/TestMemoryHistory.py | 68 ++-
 .../functionalities/asan/TestReportData.py| 16 -
 3 files changed, 85 insertions(+), 5 deletions(-)

diff --git a/lldb/test/API/functionalities/asan/Makefile 
b/lldb/test/API/functionalities/asan/Makefile
index 4913a18d8cc6f9..d66696fed7078f 100644
--- a/lldb/test/API/functionalities/asan/Makefile
+++ b/lldb/test/API/functionalities/asan/Makefile
@@ -1,4 +1,8 @@
 C_SOURCES := main.c
-CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
+asan: CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
+asan: all
+
+libsanitizers: CFLAGS_EXTRAS := -fsanitize=address -fsanitize-stable-abi -g 
-gcolumn-info
+libsanitizers: all
 
 include Makefile.rules
diff --git a/lldb/test/API/functionalities/asan/TestMemoryHistory.py 
b/lldb/test/API/functionalities/asan/TestMemoryHistory.py
index 00162ae8822c74..9ade65f97af1db 100644
--- a/lldb/test/API/functionalities/asan/TestMemoryHistory.py
+++ b/lldb/test/API/functionalities/asan/TestMemoryHistory.py
@@ -15,9 +15,14 @@ class AsanTestCase(TestBase):
 @expectedFailureNetBSD
 @skipUnlessAddressSanitizer
 def test(self):
-self.build()
+self.build(make_targets=["asan"])
 self.asan_tests()
 
+@skipIf(macos_version=["<", "15.0"], oslist=no_match(["macosx"]))
+def test_libsanitizers_asan(self):
+self.build(make_targets=["libsanitizers"])
+self.libsanitizer_tests()
+
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
@@ -26,6 +31,67 @@ def setUp(self):
 self.line_free = line_number("main.c", "// free line")
 self.line_breakpoint = line_number("main.c", "// break line")
 
+# Test line numbers: rdar://126237493
+def libsanitizer_tests(self):
+target = self.createTestTarget()
+
+self.runCmd(
+"env SanitizersAddress=1 MallocSanitizerZone=1 
MallocSecureAllocator=0"
+)
+
+self.runCmd("run")
+# In libsanitizers, memory history is not supported until a report has 
been generated
+# test the 'memory history' command
+self.expect(
+"memory history 'pointer'",
+substrs=[
+"Memory deallocated by Thread",
+"a.out`f2",
+"main.c",
+"Memory allocated by Thread",
+"a.out`f1",
+"main.c",
+],
+)
+
+# do the same using SB API
+process = self.dbg.GetSelectedTarget().process
+val = (
+
process.GetSelectedThread().GetSelectedFrame().EvaluateExpression("pointer")
+)
+addr = val.GetValueAsUnsigned()
+threads = process.GetHistoryThreads(addr)
+self.assertEqual(threads.GetSize(), 2)
+
+history_thread = threads.GetThreadAtIndex(0)
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+history_thread = threads.GetThreadAtIndex(1)
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+# let's free the container (SBThreadCollection) and see if the
+# SBThreads still live
+threads = None
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+self.expect(
+"thread list",
+"Process should be stopped due to ASan report",
+substrs=["stopped", "stop reason = Use of deallocated memory"],
+)
+
 def asan_tests(self):
 target = self.createTestTarget()
 
diff --git a/lldb/test/API/functionalities/asan/TestReportData.py 
b/lldb/test/API/functionalities/asan/TestReportData.py
index 543c5fe66a208d..0a6ff384a869e9 100644
--- a/lldb/test/API/functionalities/asan/TestReportData.py
+++ b/lldb/test/API/functionalities/asan/TestReportData.py
@@ -16,9 +16,14 @@ class AsanTestReportDataCase(TestBase):
 @skipUnlessAddressSanitizer
 @skipIf(archs=["i386"], bugnumber="llvm.org/PR36710")
 def test(self):
-self.build()
+self.build(make_targets=["asan"])
 self.asan_tests()
 
+

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (PR #88349)

2024-04-10 Thread Usama Hameed via lldb-commits

https://github.com/usama54321 updated 
https://github.com/llvm/llvm-project/pull/88349

>From a1ef63cd8f5bb927fc58827996b22c1f4dba15bb Mon Sep 17 00:00:00 2001
From: usama 
Date: Wed, 10 Apr 2024 21:07:11 -0700
Subject: [PATCH] [LLDB] Add asan tests for libsanitizers.

This patch tests LLDB integration with libsanitizers for ASan. This
integration works through the ASanLibsanitizers plugin in the
InstrumentationRuntime.

rdar://111856681
---
 lldb/test/API/functionalities/asan/Makefile   |  6 +-
 .../functionalities/asan/TestMemoryHistory.py | 66 ++-
 .../functionalities/asan/TestReportData.py| 14 +++-
 3 files changed, 81 insertions(+), 5 deletions(-)

diff --git a/lldb/test/API/functionalities/asan/Makefile 
b/lldb/test/API/functionalities/asan/Makefile
index 4913a18d8cc6f9..d66696fed7078f 100644
--- a/lldb/test/API/functionalities/asan/Makefile
+++ b/lldb/test/API/functionalities/asan/Makefile
@@ -1,4 +1,8 @@
 C_SOURCES := main.c
-CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
+asan: CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
+asan: all
+
+libsanitizers: CFLAGS_EXTRAS := -fsanitize=address -fsanitize-stable-abi -g 
-gcolumn-info
+libsanitizers: all
 
 include Makefile.rules
diff --git a/lldb/test/API/functionalities/asan/TestMemoryHistory.py 
b/lldb/test/API/functionalities/asan/TestMemoryHistory.py
index 00162ae8822c74..484f26e3fed5eb 100644
--- a/lldb/test/API/functionalities/asan/TestMemoryHistory.py
+++ b/lldb/test/API/functionalities/asan/TestMemoryHistory.py
@@ -15,9 +15,14 @@ class AsanTestCase(TestBase):
 @expectedFailureNetBSD
 @skipUnlessAddressSanitizer
 def test(self):
-self.build()
+self.build(make_targets=["asan"])
 self.asan_tests()
 
+@skipIf(macos_version=["<", "15.0"], oslist=no_match(["macosx"]))
+def test_libsanitizers_asan(self):
+self.build(make_targets=["libsanitizers"])
+self.libsanitizer_tests()
+
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
@@ -26,6 +31,65 @@ def setUp(self):
 self.line_free = line_number("main.c", "// free line")
 self.line_breakpoint = line_number("main.c", "// break line")
 
+# Test line numbers: rdar://126237493
+def libsanitizer_tests(self):
+target = self.createTestTarget()
+
+self.runCmd("env SanitizersAddress=1 MallocSanitizerZone=1 
MallocSecureAllocator=0")
+
+self.runCmd("run")
+# In libsanitizers, memory history is not supported until a report has 
been generated
+# test the 'memory history' command
+self.expect(
+"memory history 'pointer'",
+substrs=[
+"Memory deallocated by Thread",
+"a.out`f2",
+"main.c",
+"Memory allocated by Thread",
+"a.out`f1",
+"main.c",
+],
+)
+
+# do the same using SB API
+process = self.dbg.GetSelectedTarget().process
+val = (
+
process.GetSelectedThread().GetSelectedFrame().EvaluateExpression("pointer")
+)
+addr = val.GetValueAsUnsigned()
+threads = process.GetHistoryThreads(addr)
+self.assertEqual(threads.GetSize(), 2)
+
+history_thread = threads.GetThreadAtIndex(0)
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+history_thread = threads.GetThreadAtIndex(1)
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+# let's free the container (SBThreadCollection) and see if the
+# SBThreads still live
+threads = None
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+self.expect(
+"thread list",
+"Process should be stopped due to ASan report",
+substrs=["stopped", "stop reason = Use of deallocated memory"],
+)
+
 def asan_tests(self):
 target = self.createTestTarget()
 
diff --git a/lldb/test/API/functionalities/asan/TestReportData.py 
b/lldb/test/API/functionalities/asan/TestReportData.py
index 543c5fe66a208d..558b7be12d8f07 100644
--- a/lldb/test/API/functionalities/asan/TestReportData.py
+++ b/lldb/test/API/functionalities/asan/TestReportData.py
@@ -16,9 +16,14 @@ class AsanTestReportDataCase(TestBase):
 @skipUnlessAddressSanitizer
 @skipIf(archs=["i386"], bugnumber="llvm.org/PR36710")
 def test(self):
-self.build()
+self.build(make_targets=["asan"])
 self.asan_tests()
 
+@skipIf(macos_version=["<", "15.0"], 

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (PR #88349)

2024-04-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 
026165fad70420d85defb5fc9109c138250058ee...4cee76dff9b474a6a6bd278ea69cde6c3be924ad
 lldb/test/API/functionalities/asan/TestMemoryHistory.py 
lldb/test/API/functionalities/asan/TestReportData.py
``





View the diff from darker here.


``diff
--- TestMemoryHistory.py2024-04-11 04:07:36.00 +
+++ TestMemoryHistory.py2024-04-11 04:13:35.480116 +
@@ -33,11 +33,13 @@
 
 # Test line numbers: rdar://126237493
 def libsanitizer_tests(self):
 target = self.createTestTarget()
 
-self.runCmd("env SanitizersAddress=1 MallocSanitizerZone=1 
MallocSecureAllocator=0")
+self.runCmd(
+"env SanitizersAddress=1 MallocSanitizerZone=1 
MallocSecureAllocator=0"
+)
 
 self.runCmd("run")
 # In libsanitizers, memory history is not supported until a report has 
been generated
 # test the 'memory history' command
 self.expect(
--- TestReportData.py   2024-04-11 04:07:36.00 +
+++ TestReportData.py   2024-04-11 04:13:35.523564 +
@@ -36,11 +36,13 @@
 
 def asan_tests(self, libsanitizers=False):
 target = self.createTestTarget()
 
 if libsanitizers:
-self.runCmd("env SanitizersAddress=1 MallocSanitizerZone=1 
MallocSecureAllocator=0")
+self.runCmd(
+"env SanitizersAddress=1 MallocSanitizerZone=1 
MallocSecureAllocator=0"
+)
 else:
 self.registerSanitizerLibrariesWithTarget(target)
 
 self.runCmd("run")
 

``




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


[Lldb-commits] [lldb] Add asan tests for libsanitizers. (PR #88349)

2024-04-10 Thread Usama Hameed via lldb-commits

usama54321 wrote:

I reused the test in TestReportData because the output should match exactly 
with current ASan. For TestMemoryHistory, libsanitizers currently only supports 
the memory history plugin for addresses for which a report has been generated, 
so I wrote a test separately.

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


[Lldb-commits] [lldb] Add asan tests for libsanitizers. (PR #88349)

2024-04-10 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Usama Hameed (usama54321)


Changes

This patch tests LLDB integration with libsanitizers for ASan.

rdar://111856681

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


3 Files Affected:

- (modified) lldb/test/API/functionalities/asan/Makefile (+5-1) 
- (modified) lldb/test/API/functionalities/asan/TestMemoryHistory.py (+65-1) 
- (modified) lldb/test/API/functionalities/asan/TestReportData.py (+11-3) 


``diff
diff --git a/lldb/test/API/functionalities/asan/Makefile 
b/lldb/test/API/functionalities/asan/Makefile
index 4913a18d8cc6f9..d66696fed7078f 100644
--- a/lldb/test/API/functionalities/asan/Makefile
+++ b/lldb/test/API/functionalities/asan/Makefile
@@ -1,4 +1,8 @@
 C_SOURCES := main.c
-CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
+asan: CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
+asan: all
+
+libsanitizers: CFLAGS_EXTRAS := -fsanitize=address -fsanitize-stable-abi -g 
-gcolumn-info
+libsanitizers: all
 
 include Makefile.rules
diff --git a/lldb/test/API/functionalities/asan/TestMemoryHistory.py 
b/lldb/test/API/functionalities/asan/TestMemoryHistory.py
index 00162ae8822c74..484f26e3fed5eb 100644
--- a/lldb/test/API/functionalities/asan/TestMemoryHistory.py
+++ b/lldb/test/API/functionalities/asan/TestMemoryHistory.py
@@ -15,9 +15,14 @@ class AsanTestCase(TestBase):
 @expectedFailureNetBSD
 @skipUnlessAddressSanitizer
 def test(self):
-self.build()
+self.build(make_targets=["asan"])
 self.asan_tests()
 
+@skipIf(macos_version=["<", "15.0"], oslist=no_match(["macosx"]))
+def test_libsanitizers_asan(self):
+self.build(make_targets=["libsanitizers"])
+self.libsanitizer_tests()
+
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
@@ -26,6 +31,65 @@ def setUp(self):
 self.line_free = line_number("main.c", "// free line")
 self.line_breakpoint = line_number("main.c", "// break line")
 
+# Test line numbers: rdar://126237493
+def libsanitizer_tests(self):
+target = self.createTestTarget()
+
+self.runCmd("env SanitizersAddress=1 MallocSanitizerZone=1 
MallocSecureAllocator=0")
+
+self.runCmd("run")
+# In libsanitizers, memory history is not supported until a report has 
been generated
+# test the 'memory history' command
+self.expect(
+"memory history 'pointer'",
+substrs=[
+"Memory deallocated by Thread",
+"a.out`f2",
+"main.c",
+"Memory allocated by Thread",
+"a.out`f1",
+"main.c",
+],
+)
+
+# do the same using SB API
+process = self.dbg.GetSelectedTarget().process
+val = (
+
process.GetSelectedThread().GetSelectedFrame().EvaluateExpression("pointer")
+)
+addr = val.GetValueAsUnsigned()
+threads = process.GetHistoryThreads(addr)
+self.assertEqual(threads.GetSize(), 2)
+
+history_thread = threads.GetThreadAtIndex(0)
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+history_thread = threads.GetThreadAtIndex(1)
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+# let's free the container (SBThreadCollection) and see if the
+# SBThreads still live
+threads = None
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+self.expect(
+"thread list",
+"Process should be stopped due to ASan report",
+substrs=["stopped", "stop reason = Use of deallocated memory"],
+)
+
 def asan_tests(self):
 target = self.createTestTarget()
 
diff --git a/lldb/test/API/functionalities/asan/TestReportData.py 
b/lldb/test/API/functionalities/asan/TestReportData.py
index 543c5fe66a208d..558b7be12d8f07 100644
--- a/lldb/test/API/functionalities/asan/TestReportData.py
+++ b/lldb/test/API/functionalities/asan/TestReportData.py
@@ -16,9 +16,14 @@ class AsanTestReportDataCase(TestBase):
 @skipUnlessAddressSanitizer
 @skipIf(archs=["i386"], bugnumber="llvm.org/PR36710")
 def test(self):
-self.build()
+self.build(make_targets=["asan"])
 self.asan_tests()
 
+@skipIf(macos_version=["<", "15.0"], oslist=no_match(["macosx"]))
+def test_libsanitizers_asan(self):
+self.build(make_targets=["libsanitizers"])
+self.asan_tests(libsanitizers=True)
+
 def setUp(self):
 

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (PR #88349)

2024-04-10 Thread Usama Hameed via lldb-commits

https://github.com/usama54321 created 
https://github.com/llvm/llvm-project/pull/88349

This patch tests LLDB integration with libsanitizers for ASan.

rdar://111856681

>From 4cee76dff9b474a6a6bd278ea69cde6c3be924ad Mon Sep 17 00:00:00 2001
From: usama 
Date: Wed, 10 Apr 2024 21:07:11 -0700
Subject: [PATCH] Add asan tests for libsanitizers.

This patch tests LLDB integration with libsanitizers for ASan.

rdar://111856681
---
 lldb/test/API/functionalities/asan/Makefile   |  6 +-
 .../functionalities/asan/TestMemoryHistory.py | 66 ++-
 .../functionalities/asan/TestReportData.py| 14 +++-
 3 files changed, 81 insertions(+), 5 deletions(-)

diff --git a/lldb/test/API/functionalities/asan/Makefile 
b/lldb/test/API/functionalities/asan/Makefile
index 4913a18d8cc6f9..d66696fed7078f 100644
--- a/lldb/test/API/functionalities/asan/Makefile
+++ b/lldb/test/API/functionalities/asan/Makefile
@@ -1,4 +1,8 @@
 C_SOURCES := main.c
-CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
+asan: CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
+asan: all
+
+libsanitizers: CFLAGS_EXTRAS := -fsanitize=address -fsanitize-stable-abi -g 
-gcolumn-info
+libsanitizers: all
 
 include Makefile.rules
diff --git a/lldb/test/API/functionalities/asan/TestMemoryHistory.py 
b/lldb/test/API/functionalities/asan/TestMemoryHistory.py
index 00162ae8822c74..484f26e3fed5eb 100644
--- a/lldb/test/API/functionalities/asan/TestMemoryHistory.py
+++ b/lldb/test/API/functionalities/asan/TestMemoryHistory.py
@@ -15,9 +15,14 @@ class AsanTestCase(TestBase):
 @expectedFailureNetBSD
 @skipUnlessAddressSanitizer
 def test(self):
-self.build()
+self.build(make_targets=["asan"])
 self.asan_tests()
 
+@skipIf(macos_version=["<", "15.0"], oslist=no_match(["macosx"]))
+def test_libsanitizers_asan(self):
+self.build(make_targets=["libsanitizers"])
+self.libsanitizer_tests()
+
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
@@ -26,6 +31,65 @@ def setUp(self):
 self.line_free = line_number("main.c", "// free line")
 self.line_breakpoint = line_number("main.c", "// break line")
 
+# Test line numbers: rdar://126237493
+def libsanitizer_tests(self):
+target = self.createTestTarget()
+
+self.runCmd("env SanitizersAddress=1 MallocSanitizerZone=1 
MallocSecureAllocator=0")
+
+self.runCmd("run")
+# In libsanitizers, memory history is not supported until a report has 
been generated
+# test the 'memory history' command
+self.expect(
+"memory history 'pointer'",
+substrs=[
+"Memory deallocated by Thread",
+"a.out`f2",
+"main.c",
+"Memory allocated by Thread",
+"a.out`f1",
+"main.c",
+],
+)
+
+# do the same using SB API
+process = self.dbg.GetSelectedTarget().process
+val = (
+
process.GetSelectedThread().GetSelectedFrame().EvaluateExpression("pointer")
+)
+addr = val.GetValueAsUnsigned()
+threads = process.GetHistoryThreads(addr)
+self.assertEqual(threads.GetSize(), 2)
+
+history_thread = threads.GetThreadAtIndex(0)
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+history_thread = threads.GetThreadAtIndex(1)
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+# let's free the container (SBThreadCollection) and see if the
+# SBThreads still live
+threads = None
+self.assertTrue(history_thread.num_frames >= 2)
+self.assertEqual(
+
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
+"main.c",
+)
+
+self.expect(
+"thread list",
+"Process should be stopped due to ASan report",
+substrs=["stopped", "stop reason = Use of deallocated memory"],
+)
+
 def asan_tests(self):
 target = self.createTestTarget()
 
diff --git a/lldb/test/API/functionalities/asan/TestReportData.py 
b/lldb/test/API/functionalities/asan/TestReportData.py
index 543c5fe66a208d..558b7be12d8f07 100644
--- a/lldb/test/API/functionalities/asan/TestReportData.py
+++ b/lldb/test/API/functionalities/asan/TestReportData.py
@@ -16,9 +16,14 @@ class AsanTestReportDataCase(TestBase):
 @skipUnlessAddressSanitizer
 @skipIf(archs=["i386"], bugnumber="llvm.org/PR36710")
 def test(self):
-self.build()
+self.build(make_targets=["asan"])
 self.asan_tests()
 
+@skipIf(macos_version=["<", "15.0"], oslist=no_match(["macosx"]))

[Lldb-commits] [lld] [lldb] [lldb/test] Add basic ld.lld --debug-names tests (PR #88335)

2024-04-10 Thread Fangrui Song via lldb-commits

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


[Lldb-commits] [lld] [lldb] [lldb/test] Add basic ld.lld --debug-names tests (PR #88335)

2024-04-10 Thread Fangrui Song via lldb-commits

MaskRay wrote:

This is not for review yet. When ld.lld --debug-names is added, this PR will be 
changed to add a few lines to `lldb/test/Shell/SymbolFile/DWARF/x86` tests.

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


[Lldb-commits] [clang] [lldb] [NFC][Clang] Improve const correctness for IdentifierInfo (PR #79365)

2024-04-10 Thread Bill Wendling via lldb-commits

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


[Lldb-commits] [lldb] Reland "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into ll… (PR #88331)

2024-04-10 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Chelsea Cassanova (chelcassanova)


Changes

…db-enumerations.h" (#88324)"

This reverts commit 9f6d08f2566a26144ea1753f80aebb1f2ecfdc63. This broke the 
build because of a usage of one of the original SBDebugger broadcast bits that 
wasn't updated in the original commit.

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


7 Files Affected:

- (modified) lldb/include/lldb/API/SBDebugger.h (-7) 
- (modified) lldb/include/lldb/lldb-enumerations.h (+8) 
- (modified) 
lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
(+1-1) 
- (modified) 
lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py 
(+1-1) 
- (modified) 
lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
 (+1-1) 
- (modified) lldb/test/API/macosx/rosetta/TestRosetta.py (+1-1) 
- (modified) lldb/tools/lldb-dap/lldb-dap.cpp (+2-2) 


``diff
diff --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index 62b2f91f5076d5..cf5409a12a056a 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,13 +42,6 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
-  FLAGS_ANONYMOUS_ENUM(){
-  eBroadcastBitProgress = (1 << 0),
-  eBroadcastBitWarning = (1 << 1),
-  eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
-  };
-
   SBDebugger();
 
   SBDebugger(const lldb::SBDebugger );
diff --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index 646f7bfda98475..f3b07ea6d20395 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcastBit {
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 3),
+};
+
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H
diff --git 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
index 36a3be695628f5..6353e3e8cbedbd 100644
--- 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
+++ 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
@@ -15,7 +15,7 @@ def setUp(self):
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
 self.broadcaster,
-lldb.SBDebugger.eBroadcastBitWarning | 
lldb.SBDebugger.eBroadcastBitError,
+lldb.eBroadcastBitWarning | lldb.eBroadcastBitError,
 )
 
 def test_dwarf_symbol_loading_diagnostic_report(self):
diff --git 
a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py 
b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
index 9af53845ca1b77..98988d7624da3c 100644
--- a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
+++ b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
@@ -13,7 +13,7 @@ def setUp(self):
 TestBase.setUp(self)
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
-self.broadcaster, lldb.SBDebugger.eBroadcastBitProgress
+self.broadcaster, lldb.eBroadcastBitProgress
 )
 
 def test_dwarf_symbol_loading_progress_report(self):
diff --git 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
index 228f676aedf6ac..33c7c269c081e4 100644
--- 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
+++ 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
@@ -34,7 +34,7 @@ def test_clang_module_build_progress_report(self):
 # other unrelated progress events.
 broadcaster = self.dbg.GetBroadcaster()
 listener = lldbutil.start_listening_from(
-broadcaster, lldb.SBDebugger.eBroadcastBitProgress
+broadcaster, lldb.eBroadcastBitProgress
 )
 
 # Trigger module builds.
diff --git a/lldb/test/API/macosx/rosetta/TestRosetta.py 
b/lldb/test/API/macosx/rosetta/TestRosetta.py
index ce40de475ef16c..669db95a1624c6 100644
--- a/lldb/test/API/macosx/rosetta/TestRosetta.py
+++ b/lldb/test/API/macosx/rosetta/TestRosetta.py
@@ -49,7 +49,7 @@ def test_rosetta(self):
 if rosetta_debugserver_installed():
 broadcaster = self.dbg.GetBroadcaster()
 listener = lldbutil.start_listening_from(

[Lldb-commits] [lldb] Reland "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into ll… (PR #88331)

2024-04-10 Thread Chelsea Cassanova via lldb-commits

https://github.com/chelcassanova created 
https://github.com/llvm/llvm-project/pull/88331

…db-enumerations.h" (#88324)"

This reverts commit 9f6d08f2566a26144ea1753f80aebb1f2ecfdc63. This broke the 
build because of a usage of one of the original SBDebugger broadcast bits that 
wasn't updated in the original commit.

>From 535923f710c61ab1273ac527099691e32e08a2df Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Wed, 10 Apr 2024 16:22:44 -0700
Subject: [PATCH] Reland "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum
 into lldb-enumerations.h" (#88324)"

This reverts commit 9f6d08f2566a26144ea1753f80aebb1f2ecfdc63. This broke
the build because of a usage of one of the original SBDebugger broadcast
bits that wasn't updated in the original commit.
---
 lldb/include/lldb/API/SBDebugger.h| 7 ---
 lldb/include/lldb/lldb-enumerations.h | 8 
 .../diagnostic_reporting/TestDiagnosticReporting.py   | 2 +-
 .../progress_reporting/TestProgressReporting.py   | 2 +-
 .../clang_modules/TestClangModuleBuildProgress.py | 2 +-
 lldb/test/API/macosx/rosetta/TestRosetta.py   | 2 +-
 lldb/tools/lldb-dap/lldb-dap.cpp  | 4 ++--
 7 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index 62b2f91f5076d5..cf5409a12a056a 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,13 +42,6 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
-  FLAGS_ANONYMOUS_ENUM(){
-  eBroadcastBitProgress = (1 << 0),
-  eBroadcastBitWarning = (1 << 1),
-  eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
-  };
-
   SBDebugger();
 
   SBDebugger(const lldb::SBDebugger );
diff --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index 646f7bfda98475..f3b07ea6d20395 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcastBit {
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 3),
+};
+
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H
diff --git 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
index 36a3be695628f5..6353e3e8cbedbd 100644
--- 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
+++ 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
@@ -15,7 +15,7 @@ def setUp(self):
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
 self.broadcaster,
-lldb.SBDebugger.eBroadcastBitWarning | 
lldb.SBDebugger.eBroadcastBitError,
+lldb.eBroadcastBitWarning | lldb.eBroadcastBitError,
 )
 
 def test_dwarf_symbol_loading_diagnostic_report(self):
diff --git 
a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py 
b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
index 9af53845ca1b77..98988d7624da3c 100644
--- a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
+++ b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
@@ -13,7 +13,7 @@ def setUp(self):
 TestBase.setUp(self)
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
-self.broadcaster, lldb.SBDebugger.eBroadcastBitProgress
+self.broadcaster, lldb.eBroadcastBitProgress
 )
 
 def test_dwarf_symbol_loading_progress_report(self):
diff --git 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
index 228f676aedf6ac..33c7c269c081e4 100644
--- 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
+++ 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
@@ -34,7 +34,7 @@ def test_clang_module_build_progress_report(self):
 # other unrelated progress events.
 broadcaster = self.dbg.GetBroadcaster()
 listener = lldbutil.start_listening_from(
-broadcaster, lldb.SBDebugger.eBroadcastBitProgress
+broadcaster, lldb.eBroadcastBitProgress
 )
 
 # Trigger module builds.
diff --git a/lldb/test/API/macosx/rosetta/TestRosetta.py 
b/lldb/test/API/macosx/rosetta/TestRosetta.py
index 

[Lldb-commits] [lldb] Revert "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h" (PR #88324)

2024-04-10 Thread Chelsea Cassanova via lldb-commits

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


[Lldb-commits] [lldb] 9f6d08f - Revert "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h" (#88324)

2024-04-10 Thread via lldb-commits

Author: Chelsea Cassanova
Date: 2024-04-10T14:54:30-07:00
New Revision: 9f6d08f2566a26144ea1753f80aebb1f2ecfdc63

URL: 
https://github.com/llvm/llvm-project/commit/9f6d08f2566a26144ea1753f80aebb1f2ecfdc63
DIFF: 
https://github.com/llvm/llvm-project/commit/9f6d08f2566a26144ea1753f80aebb1f2ecfdc63.diff

LOG: Revert "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into 
lldb-enumerations.h" (#88324)

Reverts llvm/llvm-project#87409 due a missed update to the broadcast bit
causing a build failure on the x86_64 Debian buildbot.

Added: 


Modified: 
lldb/include/lldb/API/SBDebugger.h
lldb/include/lldb/lldb-enumerations.h

lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py

lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
lldb/test/API/macosx/rosetta/TestRosetta.py

Removed: 




diff  --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index cf5409a12a056a..62b2f91f5076d5 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,6 +42,13 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
+  FLAGS_ANONYMOUS_ENUM(){
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 3),
+  };
+
   SBDebugger();
 
   SBDebugger(const lldb::SBDebugger );

diff  --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index f3b07ea6d20395..646f7bfda98475 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,14 +1339,6 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
-/// Used by the debugger to indicate which events are being broadcasted.
-enum DebuggerBroadcastBit {
-  eBroadcastBitProgress = (1 << 0),
-  eBroadcastBitWarning = (1 << 1),
-  eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
-};
-
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H

diff  --git 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
index 6353e3e8cbedbd..36a3be695628f5 100644
--- 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
+++ 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
@@ -15,7 +15,7 @@ def setUp(self):
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
 self.broadcaster,
-lldb.eBroadcastBitWarning | lldb.eBroadcastBitError,
+lldb.SBDebugger.eBroadcastBitWarning | 
lldb.SBDebugger.eBroadcastBitError,
 )
 
 def test_dwarf_symbol_loading_diagnostic_report(self):

diff  --git 
a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py 
b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
index 98988d7624da3c..9af53845ca1b77 100644
--- a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
+++ b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
@@ -13,7 +13,7 @@ def setUp(self):
 TestBase.setUp(self)
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
-self.broadcaster, lldb.eBroadcastBitProgress
+self.broadcaster, lldb.SBDebugger.eBroadcastBitProgress
 )
 
 def test_dwarf_symbol_loading_progress_report(self):

diff  --git 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
index 33c7c269c081e4..228f676aedf6ac 100644
--- 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
+++ 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
@@ -34,7 +34,7 @@ def test_clang_module_build_progress_report(self):
 # other unrelated progress events.
 broadcaster = self.dbg.GetBroadcaster()
 listener = lldbutil.start_listening_from(
-broadcaster, lldb.eBroadcastBitProgress
+broadcaster, lldb.SBDebugger.eBroadcastBitProgress
 )
 
 # Trigger module builds.

diff  --git a/lldb/test/API/macosx/rosetta/TestRosetta.py 
b/lldb/test/API/macosx/rosetta/TestRosetta.py
index 669db95a1624c6..ce40de475ef16c 100644
--- a/lldb/test/API/macosx/rosetta/TestRosetta.py
+++ b/lldb/test/API/macosx/rosetta/TestRosetta.py
@@ -49,7 +49,7 @@ def test_rosetta(self):
 if rosetta_debugserver_installed():
 broadcaster = 

[Lldb-commits] [lldb] Revert "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h" (PR #88324)

2024-04-10 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Chelsea Cassanova (chelcassanova)


Changes

Reverts llvm/llvm-project#87409 due a missed update to the broadcast 
bit causing a build failure on the x86_64 Debian buildbot.

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


6 Files Affected:

- (modified) lldb/include/lldb/API/SBDebugger.h (+7) 
- (modified) lldb/include/lldb/lldb-enumerations.h (-8) 
- (modified) 
lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
(+1-1) 
- (modified) 
lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py 
(+1-1) 
- (modified) 
lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
 (+1-1) 
- (modified) lldb/test/API/macosx/rosetta/TestRosetta.py (+1-1) 


``diff
diff --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index cf5409a12a056a..62b2f91f5076d5 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,6 +42,13 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
+  FLAGS_ANONYMOUS_ENUM(){
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 3),
+  };
+
   SBDebugger();
 
   SBDebugger(const lldb::SBDebugger );
diff --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index f3b07ea6d20395..646f7bfda98475 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,14 +1339,6 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
-/// Used by the debugger to indicate which events are being broadcasted.
-enum DebuggerBroadcastBit {
-  eBroadcastBitProgress = (1 << 0),
-  eBroadcastBitWarning = (1 << 1),
-  eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
-};
-
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H
diff --git 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
index 6353e3e8cbedbd..36a3be695628f5 100644
--- 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
+++ 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
@@ -15,7 +15,7 @@ def setUp(self):
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
 self.broadcaster,
-lldb.eBroadcastBitWarning | lldb.eBroadcastBitError,
+lldb.SBDebugger.eBroadcastBitWarning | 
lldb.SBDebugger.eBroadcastBitError,
 )
 
 def test_dwarf_symbol_loading_diagnostic_report(self):
diff --git 
a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py 
b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
index 98988d7624da3c..9af53845ca1b77 100644
--- a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
+++ b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
@@ -13,7 +13,7 @@ def setUp(self):
 TestBase.setUp(self)
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
-self.broadcaster, lldb.eBroadcastBitProgress
+self.broadcaster, lldb.SBDebugger.eBroadcastBitProgress
 )
 
 def test_dwarf_symbol_loading_progress_report(self):
diff --git 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
index 33c7c269c081e4..228f676aedf6ac 100644
--- 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
+++ 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
@@ -34,7 +34,7 @@ def test_clang_module_build_progress_report(self):
 # other unrelated progress events.
 broadcaster = self.dbg.GetBroadcaster()
 listener = lldbutil.start_listening_from(
-broadcaster, lldb.eBroadcastBitProgress
+broadcaster, lldb.SBDebugger.eBroadcastBitProgress
 )
 
 # Trigger module builds.
diff --git a/lldb/test/API/macosx/rosetta/TestRosetta.py 
b/lldb/test/API/macosx/rosetta/TestRosetta.py
index 669db95a1624c6..ce40de475ef16c 100644
--- a/lldb/test/API/macosx/rosetta/TestRosetta.py
+++ b/lldb/test/API/macosx/rosetta/TestRosetta.py
@@ -49,7 +49,7 @@ def test_rosetta(self):
 if rosetta_debugserver_installed():
 broadcaster = self.dbg.GetBroadcaster()
 listener = lldbutil.start_listening_from(
-broadcaster, lldb.eBroadcastBitWarning
+broadcaster, lldb.SBDebugger.eBroadcastBitWarning
 )
 
 

[Lldb-commits] [lldb] Revert "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h" (PR #88324)

2024-04-10 Thread Chelsea Cassanova via lldb-commits

https://github.com/chelcassanova created 
https://github.com/llvm/llvm-project/pull/88324

Reverts llvm/llvm-project#87409 due a missed update to the broadcast bit 
causing a build failure on the x86_64 Debian buildbot.

>From 27a49dc1d37f3e7ffa855ed7a536a796fa2e1642 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Wed, 10 Apr 2024 14:50:39 -0700
Subject: [PATCH] =?UTF-8?q?Revert=20"[lldb][sbdebugger]=20Move=20SBDebugge?=
 =?UTF-8?q?r=20Broadcast=20bit=20enum=20into=20lldb-enume=E2=80=A6"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit af7c196fb8d10f58a704b5a8d142feacf2f0236d.
---
 lldb/include/lldb/API/SBDebugger.h| 7 +++
 lldb/include/lldb/lldb-enumerations.h | 8 
 .../diagnostic_reporting/TestDiagnosticReporting.py   | 2 +-
 .../progress_reporting/TestProgressReporting.py   | 2 +-
 .../clang_modules/TestClangModuleBuildProgress.py | 2 +-
 lldb/test/API/macosx/rosetta/TestRosetta.py   | 2 +-
 6 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index cf5409a12a056a..62b2f91f5076d5 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,6 +42,13 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
+  FLAGS_ANONYMOUS_ENUM(){
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 3),
+  };
+
   SBDebugger();
 
   SBDebugger(const lldb::SBDebugger );
diff --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index f3b07ea6d20395..646f7bfda98475 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,14 +1339,6 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
-/// Used by the debugger to indicate which events are being broadcasted.
-enum DebuggerBroadcastBit {
-  eBroadcastBitProgress = (1 << 0),
-  eBroadcastBitWarning = (1 << 1),
-  eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
-};
-
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H
diff --git 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
index 6353e3e8cbedbd..36a3be695628f5 100644
--- 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
+++ 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
@@ -15,7 +15,7 @@ def setUp(self):
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
 self.broadcaster,
-lldb.eBroadcastBitWarning | lldb.eBroadcastBitError,
+lldb.SBDebugger.eBroadcastBitWarning | 
lldb.SBDebugger.eBroadcastBitError,
 )
 
 def test_dwarf_symbol_loading_diagnostic_report(self):
diff --git 
a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py 
b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
index 98988d7624da3c..9af53845ca1b77 100644
--- a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
+++ b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
@@ -13,7 +13,7 @@ def setUp(self):
 TestBase.setUp(self)
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
-self.broadcaster, lldb.eBroadcastBitProgress
+self.broadcaster, lldb.SBDebugger.eBroadcastBitProgress
 )
 
 def test_dwarf_symbol_loading_progress_report(self):
diff --git 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
index 33c7c269c081e4..228f676aedf6ac 100644
--- 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
+++ 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
@@ -34,7 +34,7 @@ def test_clang_module_build_progress_report(self):
 # other unrelated progress events.
 broadcaster = self.dbg.GetBroadcaster()
 listener = lldbutil.start_listening_from(
-broadcaster, lldb.eBroadcastBitProgress
+broadcaster, lldb.SBDebugger.eBroadcastBitProgress
 )
 
 # Trigger module builds.
diff --git a/lldb/test/API/macosx/rosetta/TestRosetta.py 
b/lldb/test/API/macosx/rosetta/TestRosetta.py
index 669db95a1624c6..ce40de475ef16c 100644
--- a/lldb/test/API/macosx/rosetta/TestRosetta.py
+++ b/lldb/test/API/macosx/rosetta/TestRosetta.py
@@ -49,7 +49,7 @@ def test_rosetta(self):
 if 

[Lldb-commits] [lldb] [lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h (PR #87409)

2024-04-10 Thread Chelsea Cassanova via lldb-commits

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


[Lldb-commits] [lldb] af7c196 - [lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h (#87409)

2024-04-10 Thread via lldb-commits

Author: Chelsea Cassanova
Date: 2024-04-10T14:45:49-07:00
New Revision: af7c196fb8d10f58a704b5a8d142feacf2f0236d

URL: 
https://github.com/llvm/llvm-project/commit/af7c196fb8d10f58a704b5a8d142feacf2f0236d
DIFF: 
https://github.com/llvm/llvm-project/commit/af7c196fb8d10f58a704b5a8d142feacf2f0236d.diff

LOG: [lldb][sbdebugger] Move SBDebugger Broadcast bit enum into 
lldb-enumerations.h (#87409)

When the `eBroadcastBitProgressCategory` bit was originally added to
Debugger.h and SBDebugger.h, each corresponding bit was added in order
of the other bits that were previously there. Since `Debugger.h` has an
enum bit that `SBDebugger.h` does not, this meant that their offsets did
not match.

Instead of trying to keep the bit offsets in sync between the two, it's
preferable to just move SBDebugger's enum into the main enumerations
header and use the bits from there. This also requires that API tests using the 
bits from SBDebugger update their usage.

Added: 


Modified: 
lldb/include/lldb/API/SBDebugger.h
lldb/include/lldb/lldb-enumerations.h

lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py

lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
lldb/test/API/macosx/rosetta/TestRosetta.py

Removed: 




diff  --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index 62b2f91f5076d5..cf5409a12a056a 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,13 +42,6 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
-  FLAGS_ANONYMOUS_ENUM(){
-  eBroadcastBitProgress = (1 << 0),
-  eBroadcastBitWarning = (1 << 1),
-  eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
-  };
-
   SBDebugger();
 
   SBDebugger(const lldb::SBDebugger );

diff  --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index 646f7bfda98475..f3b07ea6d20395 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcastBit {
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 3),
+};
+
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H

diff  --git 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
index 36a3be695628f5..6353e3e8cbedbd 100644
--- 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
+++ 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
@@ -15,7 +15,7 @@ def setUp(self):
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
 self.broadcaster,
-lldb.SBDebugger.eBroadcastBitWarning | 
lldb.SBDebugger.eBroadcastBitError,
+lldb.eBroadcastBitWarning | lldb.eBroadcastBitError,
 )
 
 def test_dwarf_symbol_loading_diagnostic_report(self):

diff  --git 
a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py 
b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
index 9af53845ca1b77..98988d7624da3c 100644
--- a/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
+++ b/lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py
@@ -13,7 +13,7 @@ def setUp(self):
 TestBase.setUp(self)
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
-self.broadcaster, lldb.SBDebugger.eBroadcastBitProgress
+self.broadcaster, lldb.eBroadcastBitProgress
 )
 
 def test_dwarf_symbol_loading_progress_report(self):

diff  --git 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
index 228f676aedf6ac..33c7c269c081e4 100644
--- 
a/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
+++ 
b/lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py
@@ -34,7 +34,7 @@ def test_clang_module_build_progress_report(self):
 # other unrelated progress events.
 broadcaster = self.dbg.GetBroadcaster()
 listener = lldbutil.start_listening_from(
-broadcaster, lldb.SBDebugger.eBroadcastBitProgress
+broadcaster, 

[Lldb-commits] [lldb] [lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h (PR #87409)

2024-04-10 Thread Chelsea Cassanova via lldb-commits

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


[Lldb-commits] [lldb] [lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h (PR #87409)

2024-04-10 Thread Chelsea Cassanova via lldb-commits

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


[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

2024-04-10 Thread Chelsea Cassanova via lldb-commits

https://github.com/chelcassanova updated 
https://github.com/llvm/llvm-project/pull/87409

>From 7561d03d775822f789a61a5b827dfa04b29b57b2 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Tue, 2 Apr 2024 13:22:15 -0700
Subject: [PATCH 1/3] [lldb][sbdebugger] Match progress category enum bit in
 Debugger.h

When the `eBroadcastBitProgressCategory` bit was originally added to
Debugger.h and SBDebugger.h, each corresponding bit was added in order
of the other bits that were previously there. Since `Debugger.h` has an
enum bit that `SBDebugger.h` does not, this meant that their offsets did
not match. This commit changes it so that the bit offsets match each other.
---
 lldb/include/lldb/API/SBDebugger.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index 62b2f91f5076d5..a994874dde6d4a 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,11 +42,13 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
+  // The enum values here need to match their corresponding values in
+  // Debugger.h.
   FLAGS_ANONYMOUS_ENUM(){
   eBroadcastBitProgress = (1 << 0),
   eBroadcastBitWarning = (1 << 1),
   eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
+  eBroadcastBitProgressCategory = (1 << 4),
   };
 
   SBDebugger();

>From a37c65dea5794e474e554f4b1762f0f630965afe Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Mon, 8 Apr 2024 16:39:41 -0700
Subject: [PATCH 2/3] Add SBDebugger broadcast bits to lldb-enumerations

Per Alex's suggestions, adds the broadcast bits from SBDebugger
into lldb-enumerations.
---
 lldb/include/lldb/lldb-enumerations.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index 646f7bfda98475..17f4125c50cced 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcast {
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 4),
+};
+
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H

>From 39b05ffc015476e854b301a84f1bdd3c46257448 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Wed, 10 Apr 2024 10:22:55 -0700
Subject: [PATCH 3/3] Remove broadcast enum from SBDebugger

Removes the enum for broadcast bits from SBDebugger as they're now in
lldb-enumerations.h. This also requires uses of these bits to be updated
in some API tests.
---
 lldb/include/lldb/API/SBDebugger.h   | 9 -
 lldb/include/lldb/lldb-enumerations.h| 4 ++--
 .../diagnostic_reporting/TestDiagnosticReporting.py  | 2 +-
 .../progress_reporting/TestProgressReporting.py  | 2 +-
 .../clang_modules/TestClangModuleBuildProgress.py| 2 +-
 lldb/test/API/macosx/rosetta/TestRosetta.py  | 2 +-
 6 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index a994874dde6d4a..cf5409a12a056a 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,15 +42,6 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
-  // The enum values here need to match their corresponding values in
-  // Debugger.h.
-  FLAGS_ANONYMOUS_ENUM(){
-  eBroadcastBitProgress = (1 << 0),
-  eBroadcastBitWarning = (1 << 1),
-  eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 4),
-  };
-
   SBDebugger();
 
   SBDebugger(const lldb::SBDebugger );
diff --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index 17f4125c50cced..f3b07ea6d20395 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1340,11 +1340,11 @@ enum AddressMaskRange {
 };
 
 /// Used by the debugger to indicate which events are being broadcasted.
-enum DebuggerBroadcast {
+enum DebuggerBroadcastBit {
   eBroadcastBitProgress = (1 << 0),
   eBroadcastBitWarning = (1 << 1),
   eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 4),
+  eBroadcastBitProgressCategory = (1 << 3),
 };
 
 } // namespace lldb
diff --git 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
index 36a3be695628f5..6353e3e8cbedbd 100644
--- 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
+++ 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
@@ -15,7 +15,7 @@ def setUp(self):
 

[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

2024-04-10 Thread Chelsea Cassanova via lldb-commits


@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcastBit {
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 4),

chelcassanova wrote:

Oh yeah, I guess since this is in `lldb-enumerations` it doesn't have to match 
the ones in Debugger.h anymore.

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


[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

2024-04-10 Thread Med Ismail Bennani via lldb-commits


@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcastBit {
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 4),

medismailben wrote:

typo ?

```suggestion
  eBroadcastBitProgressCategory = (1 << 3),
```

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


[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

2024-04-10 Thread Med Ismail Bennani via lldb-commits

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


[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

2024-04-10 Thread Med Ismail Bennani via lldb-commits

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

LGTM if you address the comment and rewrite the PR description and title :) 

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


[Lldb-commits] [lldb] Fix error in unrecognized register name handling for "SBFrame.register" (PR #88047)

2024-04-10 Thread Med Ismail Bennani via lldb-commits

medismailben wrote:

LGTM

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


[Lldb-commits] [lldb] Fix error in unrecognized register name handling for "SBFrame.register" (PR #88047)

2024-04-10 Thread Med Ismail Bennani via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb][TypeSynthetic][NFC] Make SyntheticChildrenFrontend::Update() return an enum (PR #80167)

2024-04-10 Thread Michael Buch via lldb-commits

Michael137 wrote:

> > No particular reason apart from it being scoped, which I thought we might 
> > prefer for new enums. But there's no reason it couldn't be an old-school 
> > enum
> 
> If that's the case I think consistency is more important. Mind putting up a 
> PR?

Yup will do sometime this week

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


[Lldb-commits] [libcxx] [lldb] [libc++][CI] Tests LLDB libc++ data formatters. (PR #88312)

2024-04-10 Thread Mark de Wever via lldb-commits

https://github.com/mordante created 
https://github.com/llvm/llvm-project/pull/88312

None

>From a94781dd9a993d88dc1eb0897eade23fb4acdf4e Mon Sep 17 00:00:00 2001
From: Mark de Wever 
Date: Wed, 10 Apr 2024 21:12:29 +0200
Subject: [PATCH] [libc++][CI] Tests LLDB libc++ data formatters.

---
 libcxx/utils/ci/run-buildbot| 10 +++---
 lldb/packages/Python/lldbsuite/test/lldbtest.py |  2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index a6f3eb174308b4..e6240a829b0c73 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -376,18 +376,22 @@ bootstrapping-build)
   -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
   -DCMAKE_BUILD_TYPE=Release \
   -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-  -DLLVM_ENABLE_PROJECTS="clang" \
+  -DLLVM_ENABLE_PROJECTS="clang;lldb" \
   -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
   -DLLVM_RUNTIME_TARGETS="$(${CXX} --print-target-triple)" \
+  -DLLVM_HOST_TRIPLE="$(${CXX} --print-target-triple)" \
   -DLLVM_TARGETS_TO_BUILD="host" \
   -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
   -DLLVM_ENABLE_ASSERTIONS=ON \
   -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml 
--timeout=1500 --time-tests"
 
-echo "+++ Running the libc++ and libc++abi tests"
+echo "+++ Running the LLDB libc++ data formatter tests"
+${NINJA} -vC "${BUILD_DIR}" 
check-lldb-api-functionalities-data-formatter-data-formatter-stl-libcxx
+
+echo "--- Running the libc++ and libc++abi tests"
 ${NINJA} -vC "${BUILD_DIR}" check-runtimes
 
-echo "--- Installing libc++ and libc++abi to a fake location"
+echo "+++ Installing libc++ and libc++abi to a fake location"
 ${NINJA} -vC "${BUILD_DIR}" install-runtimes
 
 ccache -s
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py 
b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index c28a78a2c4a27a..7a7afec7345707 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -751,6 +751,8 @@ def setUpCommands(cls):
 "settings set symbols.enable-external-lookup false",
 # Inherit the TCC permissions from the inferior's parent.
 "settings set target.inherit-tcc true",
+# Based on 
https://discourse.llvm.org/t/running-lldb-in-a-container/76801/4
+"settings set target.disable-aslr false",
 # Kill rather than detach from the inferior if something goes 
wrong.
 "settings set target.detach-on-error false",
 # Disable fix-its by default so that incorrect expressions in 
tests don't

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


[Lldb-commits] [lldb] [RFC][LLDB] Telemetry in LLDB (PR #87815)

2024-04-10 Thread Vy Nguyen via lldb-commits

oontvoo wrote:

> A bunch of time has passed since the original RFC. It would be great, and 
> help with reviewing the PR, to have an overview of the currently proposed 
> architecture, the different pieces and how it all fits together. I left some 
> inline comments, but I'm not sure if it's worth fixing those before we're all 
> on the same page about the higher level stuff.

I've replied to the Discourse thread just now with an [updated doc]( 
(https://discourse.llvm.org/t/rfc-lldb-telemetry-metrics/64588/14?u=oontvoo))

PTAL. Thanks!



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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88301)

2024-04-10 Thread via lldb-commits

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

LGTM

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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88301)

2024-04-10 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Ayush Sahay (ayushsahay1837)


Changes

Currently, GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo asserts if the 
number of processes under debug isn’t 1 and the multiprocess feature isn’t 
supported. This is so that we don't string IDs of threads belonging to 
different processes together without including the IDs of the processes 
themselves in the response when there are multiple processes under debug. 
However, it’s conceivable that we have no process under debug and the 
multiprocess feature isn’t supported. So, have 
GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo assert if the number of 
processes under debug is greater than 1 and the multiprocess feature isn’t 
supported.

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


1 Files Affected:

- (modified) 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp 
(+1-1) 


``diff
diff --git 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 3d37bb226a65fd..ae1a77e5be8321 100644
--- 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -2087,7 +2087,7 @@ void GDBRemoteCommunicationServerLLGS::AddProcessThreads(
 GDBRemoteCommunication::PacketResult
 GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo(
 StringExtractorGDBRemote ) {
-  assert(m_debugged_processes.size() == 1 ||
+  assert(m_debugged_processes.size() <= 1 ||
  bool(m_extensions_supported &
   NativeProcessProtocol::Extension::multiprocess));
 

``




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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88301)

2024-04-10 Thread Ayush Sahay via lldb-commits

https://github.com/ayushsahay1837 created 
https://github.com/llvm/llvm-project/pull/88301

Currently, GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo asserts if the 
number of processes under debug isn’t 1 and the multiprocess feature isn’t 
supported. This is so that we don't string IDs of threads belonging to 
different processes together without including the IDs of the processes 
themselves in the response when there are multiple processes under debug. 
However, it’s conceivable that we have no process under debug and the 
multiprocess feature isn’t supported. So, have 
GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo assert if the number of 
processes under debug is greater than 1 and the multiprocess feature isn’t 
supported.

>From f4794dc0711005be1a98b2208855ba81d0fb3854 Mon Sep 17 00:00:00 2001
From: Ayush Sahay 
Date: Wed, 10 Apr 2024 22:50:04 +0530
Subject: [PATCH] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently, GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo asserts
if the number of processes under debug isn’t 1 and the multiprocess
feature isn’t supported. This is so that we don't string IDs of threads
belonging to different processes together without including the IDs of
the processes themselves in the response when there are multiple
processes under debug. However, it’s conceivable that we have no process
under debug and the multiprocess feature isn’t supported. So, have
GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo assert if the
number of processes under debug is greater than 1 and the multiprocess
feature isn’t supported.
---
 .../Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 3d37bb226a65fd..ae1a77e5be8321 100644
--- 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -2087,7 +2087,7 @@ void GDBRemoteCommunicationServerLLGS::AddProcessThreads(
 GDBRemoteCommunication::PacketResult
 GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo(
 StringExtractorGDBRemote ) {
-  assert(m_debugged_processes.size() == 1 ||
+  assert(m_debugged_processes.size() <= 1 ||
  bool(m_extensions_supported &
   NativeProcessProtocol::Extension::multiprocess));
 

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


[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

2024-04-10 Thread Chelsea Cassanova via lldb-commits

https://github.com/chelcassanova updated 
https://github.com/llvm/llvm-project/pull/87409

>From 7561d03d775822f789a61a5b827dfa04b29b57b2 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Tue, 2 Apr 2024 13:22:15 -0700
Subject: [PATCH 1/3] [lldb][sbdebugger] Match progress category enum bit in
 Debugger.h

When the `eBroadcastBitProgressCategory` bit was originally added to
Debugger.h and SBDebugger.h, each corresponding bit was added in order
of the other bits that were previously there. Since `Debugger.h` has an
enum bit that `SBDebugger.h` does not, this meant that their offsets did
not match. This commit changes it so that the bit offsets match each other.
---
 lldb/include/lldb/API/SBDebugger.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index 62b2f91f5076d5..a994874dde6d4a 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,11 +42,13 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
+  // The enum values here need to match their corresponding values in
+  // Debugger.h.
   FLAGS_ANONYMOUS_ENUM(){
   eBroadcastBitProgress = (1 << 0),
   eBroadcastBitWarning = (1 << 1),
   eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
+  eBroadcastBitProgressCategory = (1 << 4),
   };
 
   SBDebugger();

>From a37c65dea5794e474e554f4b1762f0f630965afe Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Mon, 8 Apr 2024 16:39:41 -0700
Subject: [PATCH 2/3] Add SBDebugger broadcast bits to lldb-enumerations

Per Alex's suggestions, adds the broadcast bits from SBDebugger
into lldb-enumerations.
---
 lldb/include/lldb/lldb-enumerations.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index 646f7bfda98475..17f4125c50cced 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcast {
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 4),
+};
+
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H

>From 3dc9c9fe56be78ece6f3702719d9f61a1a7bf965 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova 
Date: Wed, 10 Apr 2024 10:22:55 -0700
Subject: [PATCH 3/3] Remove broadcast enum from SBDebugger

Removes the enum for broadcast bits from SBDebugger as they're now in
lldb-enumerations.h. This also requires uses of these bits to be updated
in some API tests.
---
 lldb/include/lldb/API/SBDebugger.h   | 9 -
 lldb/include/lldb/lldb-enumerations.h| 2 +-
 .../diagnostic_reporting/TestDiagnosticReporting.py  | 2 +-
 .../progress_reporting/TestProgressReporting.py  | 2 +-
 .../clang_modules/TestClangModuleBuildProgress.py| 2 +-
 lldb/test/API/macosx/rosetta/TestRosetta.py  | 2 +-
 6 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index a994874dde6d4a..cf5409a12a056a 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,15 +42,6 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
-  // The enum values here need to match their corresponding values in
-  // Debugger.h.
-  FLAGS_ANONYMOUS_ENUM(){
-  eBroadcastBitProgress = (1 << 0),
-  eBroadcastBitWarning = (1 << 1),
-  eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 4),
-  };
-
   SBDebugger();
 
   SBDebugger(const lldb::SBDebugger );
diff --git a/lldb/include/lldb/lldb-enumerations.h 
b/lldb/include/lldb/lldb-enumerations.h
index 17f4125c50cced..fb262503272e80 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1340,7 +1340,7 @@ enum AddressMaskRange {
 };
 
 /// Used by the debugger to indicate which events are being broadcasted.
-enum DebuggerBroadcast {
+enum DebuggerBroadcastBit {
   eBroadcastBitProgress = (1 << 0),
   eBroadcastBitWarning = (1 << 1),
   eBroadcastBitError = (1 << 2),
diff --git 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
index 36a3be695628f5..6353e3e8cbedbd 100644
--- 
a/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
+++ 
b/lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py
@@ -15,7 +15,7 @@ def setUp(self):
 self.broadcaster = self.dbg.GetBroadcaster()
 self.listener = lldbutil.start_listening_from(
 

[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

2024-04-10 Thread Chelsea Cassanova via lldb-commits


@@ -42,11 +42,13 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
+  // The enum values here need to match their corresponding values in
+  // Debugger.h.
   FLAGS_ANONYMOUS_ENUM(){
   eBroadcastBitProgress = (1 << 0),
   eBroadcastBitWarning = (1 << 1),
   eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
+  eBroadcastBitProgressCategory = (1 << 4),

chelcassanova wrote:

Yup, will remove.

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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88279)

2024-04-10 Thread Ayush Sahay via lldb-commits

ayushsahay1837 wrote:

Accidentally merged branch 'main' into main; hence, abandoning.

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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88279)

2024-04-10 Thread Ayush Sahay via lldb-commits

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


[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

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


@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcast {

JDevlieghere wrote:

`DebuggerBroadcastBit` maybe?

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


[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

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


@@ -42,11 +42,13 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
+  // The enum values here need to match their corresponding values in
+  // Debugger.h.
   FLAGS_ANONYMOUS_ENUM(){
   eBroadcastBitProgress = (1 << 0),
   eBroadcastBitWarning = (1 << 1),
   eBroadcastBitError = (1 << 2),
-  eBroadcastBitProgressCategory = (1 << 3),
+  eBroadcastBitProgressCategory = (1 << 4),

JDevlieghere wrote:

This one can go now, right?

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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88279)

2024-04-10 Thread Ayush Sahay via lldb-commits

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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88279)

2024-04-10 Thread Michał Górny via lldb-commits

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

Sure, I suppose it makes sense. Thanks!

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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88279)

2024-04-10 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Ayush Sahay (ayushsahay1837)


Changes

Currently, GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo asserts if the 
number of processes under debug isn’t 1 and the multiprocess feature isn’t 
supported. This is so that we don't string IDs of threads belonging to 
different processes together without including the IDs of the processes 
themselves in the response when there are multiple processes under debug. 
However, it’s conceivable that we have no process under debug and the 
multiprocess feature isn’t supported. So, have 
GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo assert if the number of 
processes under debug is greater than 1 and the multiprocess feature isn’t 
supported.

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


1 Files Affected:

- (modified) 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp 
(+1-1) 


``diff
diff --git 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 3d37bb226a65fd..ae1a77e5be8321 100644
--- 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -2087,7 +2087,7 @@ void GDBRemoteCommunicationServerLLGS::AddProcessThreads(
 GDBRemoteCommunication::PacketResult
 GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo(
 StringExtractorGDBRemote ) {
-  assert(m_debugged_processes.size() == 1 ||
+  assert(m_debugged_processes.size() <= 1 ||
  bool(m_extensions_supported &
   NativeProcessProtocol::Extension::multiprocess));
 

``




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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88279)

2024-04-10 Thread Ayush Sahay via lldb-commits

https://github.com/ayushsahay1837 updated 
https://github.com/llvm/llvm-project/pull/88279

>From e5f994d2ccc359b90c9aaae33f08d702f2ca8d4b Mon Sep 17 00:00:00 2001
From: Ayush Sahay 
Date: Wed, 10 Apr 2024 13:40:15 +0530
Subject: [PATCH] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently, GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo asserts
if the number of processes under debug isn’t 1 and the multiprocess
feature isn’t supported. This is so that we don't string IDs of threads
belonging to different processes together without including the IDs of
the processes themselves in the response when there are multiple
processes under debug. However, it’s conceivable that we have no process
under debug and the multiprocess feature isn’t supported. So, have
GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo assert if the
number of processes under debug is greater than 1 and the multiprocess
feature isn’t supported.
---
 .../Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 3d37bb226a65fd..ae1a77e5be8321 100644
--- 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -2087,7 +2087,7 @@ void GDBRemoteCommunicationServerLLGS::AddProcessThreads(
 GDBRemoteCommunication::PacketResult
 GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo(
 StringExtractorGDBRemote ) {
-  assert(m_debugged_processes.size() == 1 ||
+  assert(m_debugged_processes.size() <= 1 ||
  bool(m_extensions_supported &
   NativeProcessProtocol::Extension::multiprocess));
 

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


[Lldb-commits] [lldb] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo (PR #88279)

2024-04-10 Thread Ayush Sahay via lldb-commits

https://github.com/ayushsahay1837 created 
https://github.com/llvm/llvm-project/pull/88279

Currently, GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo asserts if the 
number of processes under debug isn’t 1 and the multiprocess feature isn’t 
supported. This is so that we don't string IDs of threads belonging to 
different processes together without including the IDs of the processes 
themselves in the response when there are multiple processes under debug. 
However, it’s conceivable that we have no process under debug and the 
multiprocess feature isn’t supported. So, have 
GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo assert if the number of 
processes under debug is greater than 1 and the multiprocess feature isn’t 
supported.

>From e5f994d2ccc359b90c9aaae33f08d702f2ca8d4b Mon Sep 17 00:00:00 2001
From: Ayush Sahay 
Date: Wed, 10 Apr 2024 13:40:15 +0530
Subject: [PATCH] [lldb] [llgs] Fix assertion in Handle_qfThreadInfo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently, GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo asserts
if the number of processes under debug isn’t 1 and the multiprocess
feature isn’t supported. This is so that we don't string IDs of threads
belonging to different processes together without including the IDs of
the processes themselves in the response when there are multiple
processes under debug. However, it’s conceivable that we have no process
under debug and the multiprocess feature isn’t supported. So, have
GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo assert if the
number of processes under debug is greater than 1 and the multiprocess
feature isn’t supported.
---
 .../Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 3d37bb226a65fd..ae1a77e5be8321 100644
--- 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -2087,7 +2087,7 @@ void GDBRemoteCommunicationServerLLGS::AddProcessThreads(
 GDBRemoteCommunication::PacketResult
 GDBRemoteCommunicationServerLLGS::Handle_qfThreadInfo(
 StringExtractorGDBRemote ) {
-  assert(m_debugged_processes.size() == 1 ||
+  assert(m_debugged_processes.size() <= 1 ||
  bool(m_extensions_supported &
   NativeProcessProtocol::Extension::multiprocess));
 

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


[Lldb-commits] [lldb] [lldb] Add support for updating string during debug process (PR #67782)

2024-04-10 Thread Pavel Kosov via lldb-commits

kpdev wrote:

Hello, @jimingham , first of all - sorry for the long delay in reply.

I carefully read through all your messages once again and found, that I totally 
misunderstood some places, i.e. "Why isn't it enough to have the 
ValueObjectSynthetic's SetValueFromCString do this" - I think it should be 
enough, I'll fix it.

> Secondly, lldb only supports changing scalars because it's hard to give 
> meaning to "changing an aggregate object".  You have to change it in situ - 
> which really means changing the values of its contents, i.e. its children - 
> or you will end up invalidating code that relies on the location of the 
> aggregate

I agree with this, but I think there is not so much aggregates for which it 
makes sense to change their length as for strings (at least in libcxx) - I mean 
it is natural to update whole string to completely different value, but it is 
not natural to do so for e.g. vector. In case of strings, one might want to set 
string longer, than the one he has now for the debug purposes, so this will 
indeed invalidate code, that relies on the pointers that was obtained through 
`.data` or `.c_str` methods, but it is the programmer responsibility to care 
about this. This it the same behaviour as if you change your string in the 
program - you should update your pointers.

> However, I think it's confusing here to start with the model that 
> ValueObjects with SCPs have "underlying strings".  

Sorry, I think that I didn't express my thoughts carefully, by the underlying 
string I didn't mean, that we have some string in the SCP or ValueObjects, I 
meant the strings in the code that is under debug. 

> By the way, as a side note, watching the part of your example where you 
> change the raw string guts, it looks like we don't update summaries of a 
> ValueObject if one of its children gets changed.  Be good to file bug on that 
> one so we don't forget.

I'm not sure that this bug might be reproduced without the string example, I 
don't know which type have the summary which represent all its children. Is it 
ok, to file a bug with current strings example or how to do it better?

> In the case of std::strings, which seems to be your primary motivator here, I 
> think considering the string value to be the summary makes the most sense  

And in the end, may I kindly ask you to clarify your position about these 
changes please? Do you suggest to return to the `SetSummaryFromCString` API?


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


[Lldb-commits] [lldb] [lldb] Add support for updating string during debug process (PR #67782)

2024-04-10 Thread Pavel Kosov via lldb-commits

https://github.com/kpdev updated https://github.com/llvm/llvm-project/pull/67782

>From ccc9fb6be2f390cd894e0632cfded98f329f3059 Mon Sep 17 00:00:00 2001
From: Pavel Kosov 
Date: Wed, 10 Apr 2024 14:45:49 +0300
Subject: [PATCH] [LLDB] Add ability to update string during debugging

This is the last patch needed for adding an ability to update 
std::string/wstring/etc during debug process.

std::string/std::wstring/std::u16(32)string synthetic frontend implemented
Also tests for the frontend added.

~~

Huawei RRI, OS Lab
---
 .../lldb/DataFormatters/TypeSynthetic.h   |   4 +
 lldb/source/Core/ValueObject.cpp  |   2 +-
 .../Core/ValueObjectSyntheticFilter.cpp   |   2 +
 lldb/source/DataFormatters/FormatManager.cpp  |  10 +-
 .../Plugins/Language/CPlusPlus/CMakeLists.txt |   1 +
 .../Language/CPlusPlus/CPlusPlusLanguage.cpp  |  88 +
 .../Plugins/Language/CPlusPlus/LibCxx.cpp |  96 +-
 .../Plugins/Language/CPlusPlus/LibCxx.h   |  15 ++
 .../Language/CPlusPlus/LibCxxString.cpp   | 171 ++
 .../CPlusPlus/LibCxxStringInfoExtractor.h | 119 
 .../change_values/libcxx/string/Makefile  |   6 +
 .../libcxx/string/TestChangeStringValue.py|  56 ++
 .../change_values/libcxx/string/main.cpp  |  21 +++
 13 files changed, 461 insertions(+), 130 deletions(-)
 create mode 100644 lldb/source/Plugins/Language/CPlusPlus/LibCxxString.cpp
 create mode 100644 
lldb/source/Plugins/Language/CPlusPlus/LibCxxStringInfoExtractor.h
 create mode 100644 
lldb/test/API/python_api/value/change_values/libcxx/string/Makefile
 create mode 100644 
lldb/test/API/python_api/value/change_values/libcxx/string/TestChangeStringValue.py
 create mode 100644 
lldb/test/API/python_api/value/change_values/libcxx/string/main.cpp

diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h 
b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
index ede7442a02bf6af..6de32eed79942b3 100644
--- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
@@ -80,6 +80,10 @@ class SyntheticChildrenFrontEnd {
   // display purposes
   virtual ConstString GetSyntheticTypeName() { return ConstString(); }
 
+  virtual bool SetValueFromCString(const char *value_str, Status ) {
+return false;
+  }
+
   typedef std::shared_ptr SharedPointer;
   typedef std::unique_ptr AutoPointer;
 
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index f39bd07a255366a..dca15e4d427b26d 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1461,7 +1461,7 @@ bool ValueObject::SetValueFromCString(const char 
*value_str, Status ) {
   if (value_type == Value::ValueType::Scalar) {
 // If the value is already a scalar, then let the scalar change itself:
 m_value.GetScalar().SetValueFromCString(value_str, encoding, byte_size);
-  } else if (byte_size <= 16) {
+  } else if (byte_size <= 16 && encoding != eEncodingInvalid) {
 // If the value fits in a scalar, then make a new scalar and again let the
 // scalar code do the conversion, then figure out where to put the new
 // value.
diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp 
b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index adac1b400705e20..f2d7e240200693f 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
@@ -379,6 +379,8 @@ bool ValueObjectSynthetic::CanProvideValue() {
 
 bool ValueObjectSynthetic::SetValueFromCString(const char *value_str,
Status ) {
+  if (m_synth_filter_up->SetValueFromCString(value_str, error))
+return true;
   return m_parent->SetValueFromCString(value_str, error);
 }
 
diff --git a/lldb/source/DataFormatters/FormatManager.cpp 
b/lldb/source/DataFormatters/FormatManager.cpp
index d7ba5b4b70c949c..8b2be03694ede56 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -504,9 +504,13 @@ bool FormatManager::ShouldPrintAsOneLiner(ValueObject 
) {
   // wait.. wat? just get out of here..
   if (!synth_sp)
 return false;
-  // but if we only have them to provide a value, keep going
-  if (!synth_sp->MightHaveChildren() &&
-  synth_sp->DoesProvideSyntheticValue())
+  // but if they can fit in one line or ...
+  if (auto format = synth_sp->GetSummaryFormat()) {
+is_synth_val = format->IsOneLiner();
+  }
+  // ... if we only have them to provide a value, keep going
+  else if (!synth_sp->MightHaveChildren() &&
+   synth_sp->DoesProvideSyntheticValue())
 is_synth_val = true;
   else
 return false;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt 
b/lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
index 0c6fdb2b9573152..6987838b758ebde 100644
---