[Lldb-commits] [lldb] 878d82c - Revert "[lldb-vscode] Emit the breakpoint changed event on location resolved"

António Afonso via lldb-commits lldb-commits at lists.llvm.org
Sun Feb 21 13:08:30 PST 2021


Author: António Afonso
Date: 2021-02-21T13:08:06-08:00
New Revision: 878d82c4f2b308f35394a6339e74e7e20434146a

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

LOG: Revert "[lldb-vscode] Emit the breakpoint changed event on location resolved"

This reverts commit 1f21d488bd79a06c9cf405cc5db985fcd71c4f70.

Added: 
    

Modified: 
    lldb/test/API/tools/lldb-vscode/breakpoint-events/Makefile
    lldb/tools/lldb-vscode/lldb-vscode.cpp

Removed: 
    lldb/test/API/tools/lldb-vscode/breakpoint-events/TestVSCode_breakpointLocationResolvedEvent.py
    lldb/test/API/tools/lldb-vscode/breakpoint-events/dylib.c
    lldb/test/API/tools/lldb-vscode/breakpoint-events/dylib_loader.c


################################################################################
diff  --git a/lldb/test/API/tools/lldb-vscode/breakpoint-events/Makefile b/lldb/test/API/tools/lldb-vscode/breakpoint-events/Makefile
index e93edef5e0fa..032f9cda29cd 100644
--- a/lldb/test/API/tools/lldb-vscode/breakpoint-events/Makefile
+++ b/lldb/test/API/tools/lldb-vscode/breakpoint-events/Makefile
@@ -1,15 +1,4 @@
 DYLIB_NAME := unlikely_name
 DYLIB_CXX_SOURCES := foo.cpp
 CXX_SOURCES := main.cpp
-USE_LIBDL := 1
-
-dylib.so: dylib.c
-	$(MAKE) -f $(MAKEFILE_RULES) \
-		DYLIB_ONLY=YES DYLIB_NAME=dylib DYLIB_C_SOURCES=dylib.c
-
-dylib_loader: dylib_loader.c
-	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-rpath "-Wl,$(shell pwd)" -o $@ $^
-
-all: dylib.so dylib_loader
-
 include Makefile.rules

diff  --git a/lldb/test/API/tools/lldb-vscode/breakpoint-events/TestVSCode_breakpointLocationResolvedEvent.py b/lldb/test/API/tools/lldb-vscode/breakpoint-events/TestVSCode_breakpointLocationResolvedEvent.py
deleted file mode 100644
index 8dc4e9a4ad1b..000000000000
--- a/lldb/test/API/tools/lldb-vscode/breakpoint-events/TestVSCode_breakpointLocationResolvedEvent.py
+++ /dev/null
@@ -1,71 +0,0 @@
-"""
-Test lldb-vscode setBreakpoints request
-"""
-
-
-import unittest2
-import vscode
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-import lldbvscode_testcase
-import os
-
-
-class TestVSCode_breakpointLocationResolvedEvent(lldbvscode_testcase.VSCodeTestCaseBase):
-
-    mydir = TestBase.compute_mydir(__file__)
-
-    def build_launch_and_attach(self):
-        self.build_and_create_debug_adaptor()
-        # launch externally
-        exe = self.getBuildArtifact("dylib_loader")
-        popen = self.spawnSubprocess(exe)
-        # attach
-        self.attach(exe, popen.pid)
-
-    def set_breakpoint(self, filename, comment):
-        source_basename = filename
-        source_path = os.path.join(os.getcwd(), source_basename)
-        bp_line = line_number(filename, comment)
-        return self.vscode.request_setBreakpoints(source_path,
-                                                      [bp_line])
-
-    @skipUnlessPlatform(["linux"])
-    def test_breakpoint_location_resolved_event(self):
-        '''
-            This test sets a breakpoint in a shared library before it's loaded.
-            This will make the client receive a breakpoint notification of
-            unresolved location. Once the library is loaded the client should
-            receive another change event indicating the location is resolved.
-        '''
-        self.build_launch_and_attach()
-        self.set_breakpoint('dylib_loader.c', 'break after dlopen')
-        response = self.set_breakpoint('dylib.c', 'breakpoint dylib')
-        if response:
-            breakpoints = response['body']['breakpoints']
-            for breakpoint in breakpoints:
-                bp_id = breakpoint['id']
-                self.assertFalse(breakpoint['verified'],
-                                "expect dylib breakpoint to be unverified")
-                break
-        response = self.vscode.request_evaluate("flip_to_1_to_continue = 1")
-        self.assertTrue(response['success'])
-
-        self.continue_to_next_stop()
-        self.assertTrue(len(self.vscode.breakpoint_events) > 1,
-                        "make sure we got a breakpoint event")
-
-        # find the last breakpoint event for bp_id
-        for event in reversed(self.vscode.breakpoint_events):
-            if event['body']['breakpoint']['id'] == bp_id:
-                break
-        body = event['body']
-        # Verify the details of the breakpoint changed notification.
-        self.assertTrue(body['reason'] == 'changed',
-                "breakpoint event reason should be changed")
-        breakpoint = body['breakpoint']
-        self.assertTrue(breakpoint['verified'] == True,
-                "breakpoint event should be verified")
-        self.assertTrue(breakpoint['id'] == bp_id,
-                "breakpoint event is for breakpoint %i" % (bp_id))

diff  --git a/lldb/test/API/tools/lldb-vscode/breakpoint-events/dylib.c b/lldb/test/API/tools/lldb-vscode/breakpoint-events/dylib.c
deleted file mode 100644
index 4ed7fd5fb94c..000000000000
--- a/lldb/test/API/tools/lldb-vscode/breakpoint-events/dylib.c
+++ /dev/null
@@ -1,3 +0,0 @@
-extern void foo() {
-    // breakpoint dylib
-}

diff  --git a/lldb/test/API/tools/lldb-vscode/breakpoint-events/dylib_loader.c b/lldb/test/API/tools/lldb-vscode/breakpoint-events/dylib_loader.c
deleted file mode 100644
index b6b242b45454..000000000000
--- a/lldb/test/API/tools/lldb-vscode/breakpoint-events/dylib_loader.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <dlfcn.h>
-#include <assert.h>
-#include <unistd.h>
-
-volatile int flip_to_1_to_continue = 0;
-
-int main() {
-  lldb_enable_attach();
-  while (! flip_to_1_to_continue) // Wait for debugger to attach
-    sleep(1);
-  void *dylib = dlopen("libdylib.so", RTLD_LAZY);
-  assert(dylib && "dlopen failed?");
-  return 0; // break after dlopen
-}

diff  --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp b/lldb/tools/lldb-vscode/lldb-vscode.cpp
index 946764188029..9469690cd7db 100644
--- a/lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -417,8 +417,7 @@ void EventThreadFunction() {
           // of wether the locations were added or removed, the breakpoint
           // ins't going away, so we the reason is always "changed".
           if ((event_type & lldb::eBreakpointEventTypeLocationsAdded ||
-               event_type & lldb::eBreakpointEventTypeLocationsRemoved ||
-               event_type & lldb::eBreakpointEventTypeLocationsResolved) &&
+               event_type & lldb::eBreakpointEventTypeLocationsRemoved) &&
               bp.MatchesName(BreakpointBase::GetBreakpointLabel())) {
             auto bp_event = CreateEventObject("breakpoint");
             llvm::json::Object body;


        


More information about the lldb-commits mailing list