[Lldb-commits] [lldb] r354556 - testsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked build dir
Author: jankratochvil Date: Thu Feb 21 01:05:27 2019 New Revision: 354556 URL: http://llvm.org/viewvc/llvm-project?rev=354556&view=rev Log: testsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked build dir Getting failure when building in a directory which is symlinked elsewhere: Failing Tests (1): lldb-Suite :: functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py lldb-Suite :: source-manager/TestSourceManager.py For TestCompDirSymLink: -- runCmd: file .../lldb-test-build.noindex/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.test_symlink_paths_set_procselfcwd_dwarf/CompDirSymLink output: Current executable set to '.../lldb-test-build.noindex/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.test_symlink_paths_set_procselfcwd_dwarf/CompDirSymLink' (x86_64). runCmd: settings set plugin.symbol-file.dwarf.comp-dir-symlink-paths /proc/self/cwd output: None runCmd: breakpoint set -f ".../lldb-test-build.noindex/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.test_symlink_paths_set_procselfcwd_dwarf/relative.cpp" -l 11 output: Breakpoint 1: no locations (pending). WARNING: Unable to resolve breakpoint to any actual locations. It is because /proc/self/cwd (used above for plugin.symbol-file.dwarf.comp-dir-symlink-paths) points to an already resolved directory: (cd /tmp;mkdir real;ln -s real symlink;cd symlink;ls -l /proc/self/cwd) lrwxrwxrwx 1 jkratoch jkratoch 0 Feb 20 19:55 /proc/self/cwd -> /tmp/real/ -- For TestSourceManager the resolving is done by 'make -C' as found by Pavel Labath. Differential Revision: https://reviews.llvm.org/D58465 Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py?rev=354556&r1=354555&r2=354556&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py Thu Feb 21 01:05:27 2019 @@ -48,6 +48,8 @@ class CompDirSymLinkTestCase(TestBase): "settings set %s %s" % (_COMP_DIR_SYM_LINK_PROP, pwd_symlink)) src_path = self.getBuildArtifact(_SRC_FILE) +# /proc/self/cwd points to a realpath form of current directory. +src_path = os.path.realpath(src_path) lldbutil.run_break_set_by_file_and_line(self, src_path, self.line) @skipIf(hostoslist=["windows"]) Modified: lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py?rev=354556&r1=354555&r2=354556&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py Thu Feb 21 01:05:27 2019 @@ -158,12 +158,15 @@ class SourceManagerTestCase(TestBase): error=True, substrs=['''error: the replacement path doesn't exist: "/q/r/s/t/u"''']) +# 'make -C' has resolved current directory to its realpath form. +builddir_real = os.path.realpath(self.getBuildDir()) +hidden_real = os.path.realpath(hidden) # Set target.source-map settings. self.runCmd("settings set target.source-map %s %s" % -(self.getBuildDir(), hidden)) +(builddir_real, hidden_real)) # And verify that the settings work. self.expect("settings show target.source-map", -substrs=[self.getBuildDir(), hidden]) +substrs=[builddir_real, hidden_real]) # Display main() and verify that the source mapping has been kicked in. self.expect("source list -n main", SOURCE_DISPLAYED_CORRECTLY, @@ -238,11 +241,14 @@ class SourceManagerTestCase(TestBase): self.build() hidden = self.getBuildArtifact("hidden") lldbutil.mkdir_p(hidden) +# 'make -C' has resolved current directory to its realpath form. +builddir_real = os.path.realpath(self.getBuildDir()) +hidden_real = os.path.realpath(hidden) self.runCmd("settings set target.source-map %
[Lldb-commits] [PATCH] D58465: testsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked build dir
This revision was automatically updated to reflect the committed changes. Closed by commit rLLDB354556: testsuite: Fix TestCompDirSymLink and TestSourceManager on Linux with symlinked… (authored by jankratochvil, committed by ). Changed prior to commit: https://reviews.llvm.org/D58465?vs=187666&id=187733#toc Repository: rLLDB LLDB CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58465/new/ https://reviews.llvm.org/D58465 Files: packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py packages/Python/lldbsuite/test/source-manager/TestSourceManager.py Index: packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py === --- packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py +++ packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py @@ -48,6 +48,8 @@ "settings set %s %s" % (_COMP_DIR_SYM_LINK_PROP, pwd_symlink)) src_path = self.getBuildArtifact(_SRC_FILE) +# /proc/self/cwd points to a realpath form of current directory. +src_path = os.path.realpath(src_path) lldbutil.run_break_set_by_file_and_line(self, src_path, self.line) @skipIf(hostoslist=["windows"]) Index: packages/Python/lldbsuite/test/source-manager/TestSourceManager.py === --- packages/Python/lldbsuite/test/source-manager/TestSourceManager.py +++ packages/Python/lldbsuite/test/source-manager/TestSourceManager.py @@ -158,12 +158,15 @@ error=True, substrs=['''error: the replacement path doesn't exist: "/q/r/s/t/u"''']) +# 'make -C' has resolved current directory to its realpath form. +builddir_real = os.path.realpath(self.getBuildDir()) +hidden_real = os.path.realpath(hidden) # Set target.source-map settings. self.runCmd("settings set target.source-map %s %s" % -(self.getBuildDir(), hidden)) +(builddir_real, hidden_real)) # And verify that the settings work. self.expect("settings show target.source-map", -substrs=[self.getBuildDir(), hidden]) +substrs=[builddir_real, hidden_real]) # Display main() and verify that the source mapping has been kicked in. self.expect("source list -n main", SOURCE_DISPLAYED_CORRECTLY, @@ -238,11 +241,14 @@ self.build() hidden = self.getBuildArtifact("hidden") lldbutil.mkdir_p(hidden) +# 'make -C' has resolved current directory to its realpath form. +builddir_real = os.path.realpath(self.getBuildDir()) +hidden_real = os.path.realpath(hidden) self.runCmd("settings set target.source-map %s %s" % -(self.getBuildDir(), hidden)) +(builddir_real, hidden_real)) exe = self.getBuildArtifact("a.out") -main = os.path.join(self.getBuildDir(), "hidden", "main-copy.c") +main = os.path.join(builddir_real, "hidden", "main-copy.c") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) lldbutil.run_break_set_by_file_and_line( Index: packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py === --- packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py +++ packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py @@ -48,6 +48,8 @@ "settings set %s %s" % (_COMP_DIR_SYM_LINK_PROP, pwd_symlink)) src_path = self.getBuildArtifact(_SRC_FILE) +# /proc/self/cwd points to a realpath form of current directory. +src_path = os.path.realpath(src_path) lldbutil.run_break_set_by_file_and_line(self, src_path, self.line) @skipIf(hostoslist=["windows"]) Index: packages/Python/lldbsuite/test/source-manager/TestSourceManager.py === --- packages/Python/lldbsuite/test/source-manager/TestSourceManager.py +++ packages/Python/lldbsuite/test/source-manager/TestSourceManager.py @@ -158,12 +158,15 @@ error=True, substrs=['''error: the replacement path doesn't exist: "/q/r/s/t/u"''']) +# 'make -C' has resolved current directory to its realpath form. +builddir_real = os.path.realpath(self.getBuildDir()) +hidden_real = os.path.realpath(hidden) # Set target.source-map settings. self.runCmd("settings set target.source-map %s %s" % -(self.getBuildDir(), hidden)) +(builddir_real, hidden_real)) # And verify that the settings work. self.
[Lldb-commits] [lldb] r354602 - [unittest] Fix missing user-provided default constructor
Author: jdevlieghere Date: Thu Feb 21 09:18:06 2019 New Revision: 354602 URL: http://llvm.org/viewvc/llvm-project?rev=354602&view=rev Log: [unittest] Fix missing user-provided default constructor error: default initialization of an object of const type 'const Pod' without a user-provided default constructor Modified: lldb/trunk/unittests/Utility/ReproducerInstrumentationTest.cpp Modified: lldb/trunk/unittests/Utility/ReproducerInstrumentationTest.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/ReproducerInstrumentationTest.cpp?rev=354602&r1=354601&r2=354602&view=diff == --- lldb/trunk/unittests/Utility/ReproducerInstrumentationTest.cpp (original) +++ lldb/trunk/unittests/Utility/ReproducerInstrumentationTest.cpp Thu Feb 21 09:18:06 2019 @@ -41,6 +41,8 @@ struct Pod { unsigned long long k = 7; unsigned long l = 8; unsigned short m = 9; + + Pod() {} }; class TestingRegistry : public Registry { ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D58517: [lldb] [test] Do not link -ldl on NetBSD
mgorny created this revision. mgorny added reviewers: krytarowski, labath, jasonmolenda, jingham. mgorny added a project: LLDB. Herald added a subscriber: abidh. Fix the load_* using test Makefiles not to link -ldl on NetBSD. There is no such a library on NetBSD, and dlopen() is available without a library. Quoting the manpage: (These functions are not in a library. They are included in every dynamically linked program automatically.) Repository: rLLDB LLDB https://reviews.llvm.org/D58517 Files: lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile Index: lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile === --- lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile +++ lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile @@ -1,10 +1,14 @@ LEVEL := ../../make CXX_SOURCES := main.cpp -LD_EXTRAS := -ldl +LD_EXTRAS := include $(LEVEL)/Makefile.rules +ifneq ($(OS),NetBSD) +LD_EXTRAS += -ldl +endif + all: hidden_lib a.out hidden_lib: Index: lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile === --- lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -2,11 +2,15 @@ LIB_PREFIX := loadunload_ -LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl +LD_EXTRAS := -L. -l$(LIB_PREFIX)d CXX_SOURCES := main.cpp include $(LEVEL)/Makefile.rules +ifneq ($(OS),NetBSD) +LD_EXTRAS += -ldl +endif + a.out: lib_a lib_b lib_c lib_d hidden_lib_d install_name_tool lib_%: Index: lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile === --- lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile +++ lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile @@ -1,10 +1,14 @@ LEVEL := ../../make CXX_SOURCES := main.cpp -LD_EXTRAS := -ldl +LD_EXTRAS := include $(LEVEL)/Makefile.rules +ifneq ($(OS),NetBSD) +LD_EXTRAS += -ldl +endif + all: hidden_lib a.out hidden_lib: Index: lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile === --- lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -2,11 +2,15 @@ LIB_PREFIX := loadunload_ -LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl +LD_EXTRAS := -L. -l$(LIB_PREFIX)d CXX_SOURCES := main.cpp include $(LEVEL)/Makefile.rules +ifneq ($(OS),NetBSD) +LD_EXTRAS += -ldl +endif + a.out: lib_a lib_b lib_c lib_d hidden_lib_d install_name_tool lib_%: ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D58517: [lldb] [test] Do not link -ldl on NetBSD
labath added a comment. Could you define some variable like DL_LIBS in the main Makefile.rules? Then you could just do `LD_EXTRAS := $(DL_LIBS)` in the tests. Repository: rLLDB LLDB CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58517/new/ https://reviews.llvm.org/D58517 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D58517: [lldb] [test] Do not link -ldl on NetBSD
mgorny updated this revision to Diff 187826. mgorny edited the summary of this revision. mgorny added a comment. Switched to appending `-ldl` via Makefile.rules, using USE_LIBDL option. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58517/new/ https://reviews.llvm.org/D58517 Files: lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile lldb/packages/Python/lldbsuite/test/make/Makefile.rules Index: lldb/packages/Python/lldbsuite/test/make/Makefile.rules === --- lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -414,6 +414,15 @@ endif endif +#-- +# Additional system libraries +#-- +ifeq (1,$(USE_LIBDL)) + ifneq ($(OS),NetBSD) + LDFLAGS += -ldl + endif +endif + #-- # dylib settings #-- Index: lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile === --- lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile +++ lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile @@ -1,7 +1,7 @@ LEVEL := ../../make CXX_SOURCES := main.cpp -LD_EXTRAS := -ldl +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules Index: lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile === --- lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -2,8 +2,9 @@ LIB_PREFIX := loadunload_ -LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl +LD_EXTRAS := -L. -l$(LIB_PREFIX)d CXX_SOURCES := main.cpp +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules Index: lldb/packages/Python/lldbsuite/test/make/Makefile.rules === --- lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -414,6 +414,15 @@ endif endif +#-- +# Additional system libraries +#-- +ifeq (1,$(USE_LIBDL)) + ifneq ($(OS),NetBSD) + LDFLAGS += -ldl + endif +endif + #-- # dylib settings #-- Index: lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile === --- lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile +++ lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile @@ -1,7 +1,7 @@ LEVEL := ../../make CXX_SOURCES := main.cpp -LD_EXTRAS := -ldl +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules Index: lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile === --- lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -2,8 +2,9 @@ LIB_PREFIX := loadunload_ -LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl +LD_EXTRAS := -L. -l$(LIB_PREFIX)d CXX_SOURCES := main.cpp +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r354617 - [lldb] [test] Do not link -ldl on NetBSD
Author: mgorny Date: Thu Feb 21 12:28:21 2019 New Revision: 354617 URL: http://llvm.org/viewvc/llvm-project?rev=354617&view=rev Log: [lldb] [test] Do not link -ldl on NetBSD Fix the load_* using test Makefiles not to link -ldl on NetBSD. There is no such a library on NetBSD, and dlopen() is available without a library. Quoting the manpage: (These functions are not in a library. They are included in every dynamically linked program automatically.) To resolve this portably, introduce a new USE_LIBDL option. If it set to 1, Makefile.rules automatically appends -ldl on platforms needing it. Differential Revision: https://reviews.llvm.org/D58517 Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile?rev=354617&r1=354616&r2=354617&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile Thu Feb 21 12:28:21 2019 @@ -2,8 +2,9 @@ LEVEL := ../../make LIB_PREFIX := loadunload_ -LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl +LD_EXTRAS := -L. -l$(LIB_PREFIX)d CXX_SOURCES := main.cpp +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile?rev=354617&r1=354616&r2=354617&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile Thu Feb 21 12:28:21 2019 @@ -1,7 +1,7 @@ LEVEL := ../../make CXX_SOURCES := main.cpp -LD_EXTRAS := -ldl +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=354617&r1=354616&r2=354617&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original) +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Thu Feb 21 12:28:21 2019 @@ -415,6 +415,15 @@ ifeq (1,$(USE_LIBCPP)) endif #-- +# Additional system libraries +#-- +ifeq (1,$(USE_LIBDL)) + ifneq ($(OS),NetBSD) + LDFLAGS += -ldl + endif +endif + +#-- # dylib settings #-- ifneq "$(strip $(DYLIB_C_SOURCES))" "" ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D58517: [lldb] [test] Do not link -ldl on NetBSD
This revision was automatically updated to reflect the committed changes. Closed by commit rL354617: [lldb] [test] Do not link -ldl on NetBSD (authored by mgorny, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D58517?vs=187826&id=187842#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58517/new/ https://reviews.llvm.org/D58517 Files: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Index: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules === --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules @@ -415,6 +415,15 @@ endif #-- +# Additional system libraries +#-- +ifeq (1,$(USE_LIBDL)) + ifneq ($(OS),NetBSD) + LDFLAGS += -ldl + endif +endif + +#-- # dylib settings #-- ifneq "$(strip $(DYLIB_C_SOURCES))" "" Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -2,8 +2,9 @@ LIB_PREFIX := loadunload_ -LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl +LD_EXTRAS := -L. -l$(LIB_PREFIX)d CXX_SOURCES := main.cpp +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile @@ -1,7 +1,7 @@ LEVEL := ../../make CXX_SOURCES := main.cpp -LD_EXTRAS := -ldl +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules Index: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules === --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules @@ -415,6 +415,15 @@ endif #-- +# Additional system libraries +#-- +ifeq (1,$(USE_LIBDL)) + ifneq ($(OS),NetBSD) + LDFLAGS += -ldl + endif +endif + +#-- # dylib settings #-- ifneq "$(strip $(DYLIB_C_SOURCES))" "" Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -2,8 +2,9 @@ LIB_PREFIX := loadunload_ -LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl +LD_EXTRAS := -L. -l$(LIB_PREFIX)d CXX_SOURCES := main.cpp +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile === --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile @@ -1,7 +1,7 @@ LEVEL := ../../make CXX_SOURCES := main.cpp -LD_EXTRAS := -ldl +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r354631 - [Reproducers] Initialize reproducers before initializing the debugger.
Author: jdevlieghere Date: Thu Feb 21 14:26:16 2019 New Revision: 354631 URL: http://llvm.org/viewvc/llvm-project?rev=354631&view=rev Log: [Reproducers] Initialize reproducers before initializing the debugger. As per the discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20190218/048007.html This commit implements option (3): > Go back to initializing the reproducer before the rest of the debugger. > The method wouldn't be instrumented and guarantee no other SB methods are > called or SB objects are constructed. The initialization then becomes part > of the replay. Differential revision: https://reviews.llvm.org/D58410 Removed: lldb/trunk/include/lldb/API/SBInitializerOptions.h lldb/trunk/scripts/interface/SBInitializerOptions.i lldb/trunk/source/API/SBInitializerOptions.cpp Modified: lldb/trunk/include/lldb/API/SBDebugger.h lldb/trunk/include/lldb/API/SBDefines.h lldb/trunk/include/lldb/API/SBError.h lldb/trunk/include/lldb/API/SBFileSpec.h lldb/trunk/include/lldb/API/SBReproducer.h lldb/trunk/include/lldb/Initialization/SystemInitializer.h lldb/trunk/include/lldb/Initialization/SystemInitializerCommon.h lldb/trunk/include/lldb/Initialization/SystemLifetimeManager.h lldb/trunk/include/lldb/Utility/Reproducer.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/scripts/interface/SBDebugger.i lldb/trunk/scripts/lldb.swig lldb/trunk/source/API/CMakeLists.txt lldb/trunk/source/API/SBDebugger.cpp lldb/trunk/source/API/SBReproducer.cpp lldb/trunk/source/API/SystemInitializerFull.cpp lldb/trunk/source/API/SystemInitializerFull.h lldb/trunk/source/Initialization/SystemInitializerCommon.cpp lldb/trunk/source/Initialization/SystemLifetimeManager.cpp lldb/trunk/source/Utility/Reproducer.cpp lldb/trunk/tools/driver/Driver.cpp lldb/trunk/tools/lldb-server/SystemInitializerLLGS.cpp lldb/trunk/tools/lldb-server/SystemInitializerLLGS.h lldb/trunk/tools/lldb-server/lldb-server.cpp lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp lldb/trunk/tools/lldb-test/SystemInitializerTest.h lldb/trunk/tools/lldb-test/lldb-test.cpp Modified: lldb/trunk/include/lldb/API/SBDebugger.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=354631&r1=354630&r2=354631&view=diff == --- lldb/trunk/include/lldb/API/SBDebugger.h (original) +++ lldb/trunk/include/lldb/API/SBDebugger.h Thu Feb 21 14:26:16 2019 @@ -12,7 +12,6 @@ #include #include "lldb/API/SBDefines.h" -#include "lldb/API/SBInitializerOptions.h" #include "lldb/API/SBPlatform.h" namespace lldb { @@ -45,7 +44,8 @@ public: lldb::SBDebugger &operator=(const lldb::SBDebugger &rhs); static void Initialize(); - static lldb::SBError Initialize(SBInitializerOptions &options); + + static lldb::SBError InitializeWithErrorHandling(); static void Terminate(); Modified: lldb/trunk/include/lldb/API/SBDefines.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDefines.h?rev=354631&r1=354630&r2=354631&view=diff == --- lldb/trunk/include/lldb/API/SBDefines.h (original) +++ lldb/trunk/include/lldb/API/SBDefines.h Thu Feb 21 14:26:16 2019 @@ -50,7 +50,6 @@ class LLDB_API SBFileSpecList; class LLDB_API SBFrame; class LLDB_API SBFunction; class LLDB_API SBHostOS; -class LLDB_API SBInitializerOptions; class LLDB_API SBInstruction; class LLDB_API SBInstructionList; class LLDB_API SBLanguageRuntime; Modified: lldb/trunk/include/lldb/API/SBError.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBError.h?rev=354631&r1=354630&r2=354631&view=diff == --- lldb/trunk/include/lldb/API/SBError.h (original) +++ lldb/trunk/include/lldb/API/SBError.h Thu Feb 21 14:26:16 2019 @@ -51,22 +51,23 @@ public: bool GetDescription(lldb::SBStream &description); protected: + friend class SBBreakpoint; + friend class SBBreakpointLocation; + friend class SBBreakpointName; friend class SBCommandReturnObject; + friend class SBCommunication; friend class SBData; friend class SBDebugger; - friend class SBCommunication; friend class SBHostOS; friend class SBPlatform; friend class SBProcess; + friend class SBReproducer; friend class SBStructuredData; + friend class SBTarget; friend class SBThread; friend class SBTrace; - friend class SBTarget; friend class SBValue; friend class SBWatchpoint; - friend class SBBreakpoint; - friend class SBBreakpointLocation; - friend class SBBreakpointName; lldb_private::Status *get(); Modified: lldb/trunk/include/lldb/API/SBFileSpec.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFileSpec.h?rev=354631&r1=354630&r2=354631
[Lldb-commits] [PATCH] D58410: [Reproducers] Initialize reproducers before initializing the debugger.
This revision was automatically updated to reflect the committed changes. Closed by commit rL354631: [Reproducers] Initialize reproducers before initializing the debugger. (authored by JDevlieghere, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D58410?vs=187601&id=187865#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58410/new/ https://reviews.llvm.org/D58410 Files: lldb/trunk/include/lldb/API/SBDebugger.h lldb/trunk/include/lldb/API/SBDefines.h lldb/trunk/include/lldb/API/SBError.h lldb/trunk/include/lldb/API/SBFileSpec.h lldb/trunk/include/lldb/API/SBInitializerOptions.h lldb/trunk/include/lldb/API/SBReproducer.h lldb/trunk/include/lldb/Initialization/SystemInitializer.h lldb/trunk/include/lldb/Initialization/SystemInitializerCommon.h lldb/trunk/include/lldb/Initialization/SystemLifetimeManager.h lldb/trunk/include/lldb/Utility/Reproducer.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/scripts/interface/SBDebugger.i lldb/trunk/scripts/interface/SBInitializerOptions.i lldb/trunk/scripts/lldb.swig lldb/trunk/source/API/CMakeLists.txt lldb/trunk/source/API/SBDebugger.cpp lldb/trunk/source/API/SBInitializerOptions.cpp lldb/trunk/source/API/SBReproducer.cpp lldb/trunk/source/API/SystemInitializerFull.cpp lldb/trunk/source/API/SystemInitializerFull.h lldb/trunk/source/Initialization/SystemInitializerCommon.cpp lldb/trunk/source/Initialization/SystemLifetimeManager.cpp lldb/trunk/source/Utility/Reproducer.cpp lldb/trunk/tools/driver/Driver.cpp lldb/trunk/tools/lldb-server/SystemInitializerLLGS.cpp lldb/trunk/tools/lldb-server/SystemInitializerLLGS.h lldb/trunk/tools/lldb-server/lldb-server.cpp lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp lldb/trunk/tools/lldb-test/SystemInitializerTest.h lldb/trunk/tools/lldb-test/lldb-test.cpp Index: lldb/trunk/include/lldb/Initialization/SystemInitializer.h === --- lldb/trunk/include/lldb/Initialization/SystemInitializer.h +++ lldb/trunk/include/lldb/Initialization/SystemInitializer.h @@ -15,18 +15,12 @@ namespace lldb_private { -struct InitializerOptions { - bool reproducer_capture = false; - bool reproducer_replay = false; - std::string reproducer_path; -}; - class SystemInitializer { public: SystemInitializer(); virtual ~SystemInitializer(); - virtual llvm::Error Initialize(const InitializerOptions &options) = 0; + virtual llvm::Error Initialize() = 0; virtual void Terminate() = 0; }; } Index: lldb/trunk/include/lldb/Initialization/SystemInitializerCommon.h === --- lldb/trunk/include/lldb/Initialization/SystemInitializerCommon.h +++ lldb/trunk/include/lldb/Initialization/SystemInitializerCommon.h @@ -27,7 +27,7 @@ SystemInitializerCommon(); ~SystemInitializerCommon() override; - llvm::Error Initialize(const InitializerOptions &options) override; + llvm::Error Initialize() override; void Terminate() override; }; Index: lldb/trunk/include/lldb/Initialization/SystemLifetimeManager.h === --- lldb/trunk/include/lldb/Initialization/SystemLifetimeManager.h +++ lldb/trunk/include/lldb/Initialization/SystemLifetimeManager.h @@ -24,7 +24,6 @@ ~SystemLifetimeManager(); llvm::Error Initialize(std::unique_ptr initializer, - const InitializerOptions &options, LoadPluginCallbackType plugin_callback); void Terminate(); Index: lldb/trunk/include/lldb/API/SBReproducer.h === --- lldb/trunk/include/lldb/API/SBReproducer.h +++ lldb/trunk/include/lldb/API/SBReproducer.h @@ -9,13 +9,17 @@ #ifndef LLDB_API_SBREPRODUCER_H #define LLDB_API_SBREPRODUCER_H -#include "lldb/lldb-defines.h" +#include "lldb/API/SBDefines.h" namespace lldb { +/// The SBReproducer class is special because it bootstraps the capture and +/// replay of SB API calls. As a result we cannot rely on any other SB objects +/// in the interface or implementation of this class. class LLDB_API SBReproducer { public: - static bool Replay(); + static const char *Capture(const char *path); + static const char *Replay(const char *path); }; } // namespace lldb Index: lldb/trunk/include/lldb/API/SBDefines.h === --- lldb/trunk/include/lldb/API/SBDefines.h +++ lldb/trunk/include/lldb/API/SBDefines.h @@ -50,7 +50,6 @@ class LLDB_API SBFrame; class LLDB_API SBFunction; class LLDB_API SBHostOS; -class LLDB_API SBInitializerOptions; class LLDB_API SBInstruction; class LLDB_API SBInstructionList; class LLDB_API SBLanguageRuntime; Index: lldb/trunk/include/lldb/API/SBFileSpec.h ===
[Lldb-commits] [lldb] r354637 - [xcodeproj] Add SBReproducer to LLDB.framework
Author: jdevlieghere Date: Thu Feb 21 15:58:36 2019 New Revision: 354637 URL: http://llvm.org/viewvc/llvm-project?rev=354637&view=rev Log: [xcodeproj] Add SBReproducer to LLDB.framework Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=354637&r1=354636&r2=354637&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Feb 21 15:58:36 2019 @@ -824,7 +824,9 @@ AF0EBBE9185940FB0059E52F /* SBQueueItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0EBBE7185940FB0059E52F /* SBQueueItem.cpp */; }; AF0EBBED185941360059E52F /* SBQueueItem.h in Headers */ = {isa = PBXBuildFile; fileRef = AF0EBBEB185941360059E52F /* SBQueueItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; DD1E0ACE220BC3A100B815F8 /* SBReproducer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD1E0AC9220B660100B815F8 /* SBReproducer.cpp */; }; + DD238F75221F71DD006FA10A /* SBReproducer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD238F74221F71DD006FA10A /* SBReproducer.cpp */; }; DD1E0AD1220BC3DC00B815F8 /* SBReproducer.h in Headers */ = {isa = PBXBuildFile; fileRef = DD1E0AD0220BC3D400B815F8 /* SBReproducer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DD238F78221F7243006FA10A /* SBReproducer.h in Headers */ = {isa = PBXBuildFile; fileRef = DD238F77221F7243006FA10A /* SBReproducer.h */; }; 26B82840142D020F002DBC64 /* SBSection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B8283F142D020F002DBC64 /* SBSection.cpp */; }; 26B8283D142D01E9002DBC64 /* SBSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B8283C142D01E9002DBC64 /* SBSection.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26680327116005DC008E1FE4 /* SBSourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831051125FC5800A56CB0 /* SBSourceManager.cpp */; }; @@ -2845,7 +2847,9 @@ AF0EBBEB185941360059E52F /* SBQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueueItem.h; path = include/lldb/API/SBQueueItem.h; sourceTree = ""; }; AF0EBBEF1859419F0059E52F /* SBQueueItem.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBQueueItem.i; sourceTree = ""; }; DD1E0AC9220B660100B815F8 /* SBReproducer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBReproducer.cpp; path = source/API/SBReproducer.cpp; sourceTree = ""; }; + DD238F74221F71DD006FA10A /* SBReproducer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBReproducer.cpp; path = source/API/SBReproducer.cpp; sourceTree = ""; }; DD1E0AD0220BC3D400B815F8 /* SBReproducer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBReproducer.h; path = include/lldb/API/SBReproducer.h; sourceTree = ""; }; + DD238F77221F7243006FA10A /* SBReproducer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBReproducer.h; path = include/lldb/API/SBReproducer.h; sourceTree = ""; }; DD1E0ACB220B660E00B815F8 /* SBReproducerPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBReproducerPrivate.h; path = source/API/SBReproducerPrivate.h; sourceTree = ""; }; 26B8283F142D020F002DBC64 /* SBSection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSection.cpp; path = source/API/SBSection.cpp; sourceTree = ""; }; 26B8283C142D01E9002DBC64 /* SBSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSection.h; path = include/lldb/API/SBSection.h; sourceTree = ""; }; @@ -4316,6 +4320,7 @@ 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */, 26DE205611618FC500A093E2 /* SBBlock.h */, 26DE20601161902600A093E2 /* SBBlock.cpp */, + DD238F77221F7243006FA10A /* SBReproducer.h */, 9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */, 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */, 9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */, @@ -4373,6 +4378,7 @@ 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */, 23DCEA421D1C4C6900A602B4 /* SBMemoryRegionInfo.cpp */,
[Lldb-commits] [lldb] r354639 - Revert "[xcodeproj] Add SBReproducer to LLDB.framework"
Author: jdevlieghere Date: Thu Feb 21 16:03:59 2019 New Revision: 354639 URL: http://llvm.org/viewvc/llvm-project?rev=354639&view=rev Log: Revert "[xcodeproj] Add SBReproducer to LLDB.framework" This was bogus. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=354639&r1=354638&r2=354639&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Feb 21 16:03:59 2019 @@ -824,9 +824,7 @@ AF0EBBE9185940FB0059E52F /* SBQueueItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0EBBE7185940FB0059E52F /* SBQueueItem.cpp */; }; AF0EBBED185941360059E52F /* SBQueueItem.h in Headers */ = {isa = PBXBuildFile; fileRef = AF0EBBEB185941360059E52F /* SBQueueItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; DD1E0ACE220BC3A100B815F8 /* SBReproducer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD1E0AC9220B660100B815F8 /* SBReproducer.cpp */; }; - DD238F75221F71DD006FA10A /* SBReproducer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD238F74221F71DD006FA10A /* SBReproducer.cpp */; }; DD1E0AD1220BC3DC00B815F8 /* SBReproducer.h in Headers */ = {isa = PBXBuildFile; fileRef = DD1E0AD0220BC3D400B815F8 /* SBReproducer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DD238F78221F7243006FA10A /* SBReproducer.h in Headers */ = {isa = PBXBuildFile; fileRef = DD238F77221F7243006FA10A /* SBReproducer.h */; }; 26B82840142D020F002DBC64 /* SBSection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B8283F142D020F002DBC64 /* SBSection.cpp */; }; 26B8283D142D01E9002DBC64 /* SBSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B8283C142D01E9002DBC64 /* SBSection.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26680327116005DC008E1FE4 /* SBSourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831051125FC5800A56CB0 /* SBSourceManager.cpp */; }; @@ -2847,9 +2845,7 @@ AF0EBBEB185941360059E52F /* SBQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueueItem.h; path = include/lldb/API/SBQueueItem.h; sourceTree = ""; }; AF0EBBEF1859419F0059E52F /* SBQueueItem.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBQueueItem.i; sourceTree = ""; }; DD1E0AC9220B660100B815F8 /* SBReproducer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBReproducer.cpp; path = source/API/SBReproducer.cpp; sourceTree = ""; }; - DD238F74221F71DD006FA10A /* SBReproducer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBReproducer.cpp; path = source/API/SBReproducer.cpp; sourceTree = ""; }; DD1E0AD0220BC3D400B815F8 /* SBReproducer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBReproducer.h; path = include/lldb/API/SBReproducer.h; sourceTree = ""; }; - DD238F77221F7243006FA10A /* SBReproducer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBReproducer.h; path = include/lldb/API/SBReproducer.h; sourceTree = ""; }; DD1E0ACB220B660E00B815F8 /* SBReproducerPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBReproducerPrivate.h; path = source/API/SBReproducerPrivate.h; sourceTree = ""; }; 26B8283F142D020F002DBC64 /* SBSection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSection.cpp; path = source/API/SBSection.cpp; sourceTree = ""; }; 26B8283C142D01E9002DBC64 /* SBSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSection.h; path = include/lldb/API/SBSection.h; sourceTree = ""; }; @@ -4320,7 +4316,6 @@ 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */, 26DE205611618FC500A093E2 /* SBBlock.h */, 26DE20601161902600A093E2 /* SBBlock.cpp */, - DD238F77221F7243006FA10A /* SBReproducer.h */, 9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */, 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */, 9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */, @@ -4378,7 +4373,6 @@ 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */, 23DCEA421D1C4C6900A602B4 /* SBMem
[Lldb-commits] [PATCH] D58394: Add --auto-continue to stop-hooks, fix up a few tests
jingham updated this revision to Diff 187893. jingham marked an inline comment as done. jingham added a comment. Is this the right way to do it? I don't know why the other was UNSUPPORTED: linux. The only other XFAIL for linux I could see spelled it -linux-? Repository: rLLDB LLDB CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58394/new/ https://reviews.llvm.org/D58394 Files: include/lldb/Target/Process.h include/lldb/Target/Target.h lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp lit/ExecControl/StopHook/stop-hook-threads.test lit/ExecControl/StopHook/stop-hook.test source/Commands/CommandObjectTarget.cpp source/Target/Process.cpp source/Target/Target.cpp Index: source/Target/Target.cpp === --- source/Target/Target.cpp +++ source/Target/Target.cpp @@ -2554,12 +2554,14 @@ StopHookCollection::iterator pos, end = m_stop_hooks.end(); - // If there aren't any active stop hooks, don't bother either: + // If there aren't any active stop hooks, don't bother either. + // Also see if any of the active hooks want to auto-continue. bool any_active_hooks = false; - for (pos = m_stop_hooks.begin(); pos != end; pos++) { -if ((*pos).second->IsActive()) { + bool auto_continue = false; + for (auto hook : m_stop_hooks) { +if (hook.second->IsActive()) { any_active_hooks = true; - break; + auto_continue |= hook.second->GetAutoContinue(); } } if (!any_active_hooks) @@ -2595,6 +2597,7 @@ bool hooks_ran = false; bool print_hook_header = (m_stop_hooks.size() != 1); bool print_thread_header = (num_exe_ctx != 1); + bool did_restart = false; for (pos = m_stop_hooks.begin(); keep_going && pos != end; pos++) { // result.Clear(); @@ -2639,10 +2642,13 @@ options.SetPrintResults(true); options.SetAddToHistory(false); +// Force Async: +bool old_async = GetDebugger().GetAsyncExecution(); +GetDebugger().SetAsyncExecution(true); GetDebugger().GetCommandInterpreter().HandleCommands( cur_hook_sp->GetCommands(), &exc_ctx_with_reasons[i], options, result); - +GetDebugger().SetAsyncExecution(old_async); // If the command started the target going again, we should bag out of // running the stop hooks. if ((result.GetStatus() == eReturnStatusSuccessContinuingNoResult) || @@ -2651,13 +2657,19 @@ StopHookCollection::iterator tmp = pos; if (++tmp != end) result.AppendMessageWithFormat("\nAborting stop hooks, hook %" PRIu64 - " set the program running.\n", + " set the program running.\n" + " Consider using '-G true' to make " + "stop hooks auto-continue.\n", cur_hook_sp->GetID()); keep_going = false; + did_restart = true; } } } } + // Finally, if auto-continue was requested, do it now: + if (!did_restart && auto_continue) +m_process_sp->PrivateResume(); result.GetImmediateOutputStream()->Flush(); result.GetImmediateErrorStream()->Flush(); @@ -3143,12 +3155,13 @@ //-- Target::StopHook::StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid) : UserID(uid), m_target_sp(target_sp), m_commands(), m_specifier_sp(), - m_thread_spec_up(), m_active(true) {} + m_thread_spec_up() {} Target::StopHook::StopHook(const StopHook &rhs) : UserID(rhs.GetID()), m_target_sp(rhs.m_target_sp), m_commands(rhs.m_commands), m_specifier_sp(rhs.m_specifier_sp), - m_thread_spec_up(), m_active(rhs.m_active) { + m_thread_spec_up(), m_active(rhs.m_active), + m_auto_continue(rhs.m_auto_continue) { if (rhs.m_thread_spec_up) m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up)); } @@ -3175,6 +3188,9 @@ else s->Indent("State: disabled\n"); + if (m_auto_continue) +s->Indent("AutoContinue on\n"); + if (m_specifier_sp) { s->Indent(); s->PutCString("Specifier:\n"); Index: source/Target/Process.cpp === --- source/Target/Process.cpp +++ source/Target/Process.cpp @@ -1615,6 +1615,8 @@ return error; } +static const char *g_resume_sync_name = "lldb.Process.ResumeSynchronous.hijack"; + Status Process::ResumeSynchronous(Stream *stream) { Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_STATE | LIBLLD
[Lldb-commits] [PATCH] D58394: Add --auto-continue to stop-hooks, fix up a few tests
labath added a comment. It seems both `linux` and `system-linux` work. I am not sure what's the difference between the two, but it looks like for other OSs we use the `system-` form, so I'd go with that. Repository: rLLDB LLDB CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58394/new/ https://reviews.llvm.org/D58394 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits