[Lldb-commits] [PATCH] D111989: [lldb] Reduce code duplication around inferior building

2021-10-19 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8bac18be0e45: [lldb] Reduce code duplication around inferior 
building (authored by labath).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111989/new/

https://reviews.llvm.org/D111989

Files:
  lldb/docs/testsuite/a-detailed-walkthrough.txt
  lldb/packages/Python/lldbsuite/test/README-TestSuite
  lldb/packages/Python/lldbsuite/test/builders/builder.py
  lldb/packages/Python/lldbsuite/test/builders/darwin.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
  
lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
  lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
  lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py

Index: lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
===
--- lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
+++ lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
@@ -21,7 +21,7 @@
 @no_debug_info_test  # Prevent the genaration of the dwarf version of this test
 def test_add_dsym_mid_execution(self):
 """Test that add-dsym mid-execution loads the symbols at the right place for a slid binary."""
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 exe = self.getBuildArtifact("a.out")
 
 self.target = self.dbg.CreateTarget(exe)
Index: lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
===
--- lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
+++ lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
@@ -54,7 +54,7 @@
 os.path.basename(self.exe))
 self.dsym_for_uuid = self.getBuildArtifact("dsym-for-uuid.sh")
 
-self.buildDefault(dictionary={'MAKE_DSYM': 'YES'})
+self.build(debug_info="dsym")
 self.assertTrue(os.path.exists(self.exe))
 self.assertTrue(os.path.exists(self.dsym))
 
Index: lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
===
--- lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
@@ -77,7 +77,7 @@
 return pwd_symlink
 
 def doBuild(self, pwd_symlink, setting_value):
-self.build(None, None, {'PWD': pwd_symlink})
+self.build(dictionary={'PWD': pwd_symlink})
 
 if setting_value:
 cmd = "settings set %s '%s'" % (_COMP_DIR_SYM_LINK_PROP, setting_value)
Index: lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
===
--- lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
+++ lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
@@ -27,14 +27,14 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 
 # Insert some delay and then call the program generator to produce
 # main.cpp, version 2.
 time.sleep(5)
 self.generate_main_cpp(version=101)
 # Now call make again, but this time don't generate the dSYM.
-self.buildDefault(dictionary={'MAKE_DSYM':'NO'})
+self.build(debug_info="dwarf")
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_error(self.exe_name)
@@ -45,7 +45,7 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_success(self.exe_name)
@@ -56,7 +56,7 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_dSYM_bundle(self.exe_name)
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -162,9 +162,6 @@
 self._verbose_log_handler = None
 TestBase.tearDown(self)
 
-def build(self, *args, **kwargs):
-self.buildDefault(*args, **kwargs)
-
 def getLocalServerLogFile(self):
 

[Lldb-commits] [PATCH] D111989: [lldb] Reduce code duplication around inferior building

2021-10-19 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111989/new/

https://reviews.llvm.org/D111989

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


[Lldb-commits] [PATCH] D111989: [lldb] Reduce code duplication around inferior building

2021-10-18 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 380372.
labath added a comment.

Adjust for TestStandardUnwind removal (the patch fixes it sufficiently to make 
it litter the source tree with build artifacts).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111989/new/

https://reviews.llvm.org/D111989

Files:
  lldb/docs/testsuite/a-detailed-walkthrough.txt
  lldb/packages/Python/lldbsuite/test/README-TestSuite
  lldb/packages/Python/lldbsuite/test/builders/builder.py
  lldb/packages/Python/lldbsuite/test/builders/darwin.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
  
lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
  lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
  lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py

Index: lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
===
--- lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
+++ lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
@@ -21,7 +21,7 @@
 @no_debug_info_test  # Prevent the genaration of the dwarf version of this test
 def test_add_dsym_mid_execution(self):
 """Test that add-dsym mid-execution loads the symbols at the right place for a slid binary."""
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 exe = self.getBuildArtifact("a.out")
 
 self.target = self.dbg.CreateTarget(exe)
Index: lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
===
--- lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
+++ lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
@@ -54,7 +54,7 @@
 os.path.basename(self.exe))
 self.dsym_for_uuid = self.getBuildArtifact("dsym-for-uuid.sh")
 
-self.buildDefault(dictionary={'MAKE_DSYM': 'YES'})
+self.build(debug_info="dsym")
 self.assertTrue(os.path.exists(self.exe))
 self.assertTrue(os.path.exists(self.dsym))
 
Index: lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
===
--- lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
@@ -77,7 +77,7 @@
 return pwd_symlink
 
 def doBuild(self, pwd_symlink, setting_value):
-self.build(None, None, {'PWD': pwd_symlink})
+self.build(dictionary={'PWD': pwd_symlink})
 
 if setting_value:
 cmd = "settings set %s '%s'" % (_COMP_DIR_SYM_LINK_PROP, setting_value)
Index: lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
===
--- lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
+++ lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
@@ -27,14 +27,14 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 
 # Insert some delay and then call the program generator to produce
 # main.cpp, version 2.
 time.sleep(5)
 self.generate_main_cpp(version=101)
 # Now call make again, but this time don't generate the dSYM.
-self.buildDefault(dictionary={'MAKE_DSYM':'NO'})
+self.build(debug_info="dwarf")
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_error(self.exe_name)
@@ -45,7 +45,7 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_success(self.exe_name)
@@ -56,7 +56,7 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_dSYM_bundle(self.exe_name)
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -162,9 +162,6 @@
 self._verbose_log_handler = None
 TestBase.tearDown(self)
 
-def build(self, *args, **kwargs):
-self.buildDefault(*args, **kwargs)
-
 def 

[Lldb-commits] [PATCH] D111989: [lldb] Reduce code duplication around inferior building

2021-10-18 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: teemperor, JDevlieghere.
labath requested review of this revision.
Herald added a project: LLDB.

We had two sets of build methods, whose bodies were largely
identical. This makes any kind of modification in their vicinity
repetitive and error-prone.

Replace each set with a single method taking an optional debug_info
parameter.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111989

Files:
  lldb/docs/testsuite/a-detailed-walkthrough.txt
  lldb/packages/Python/lldbsuite/test/README-TestSuite
  lldb/packages/Python/lldbsuite/test/builders/builder.py
  lldb/packages/Python/lldbsuite/test/builders/darwin.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
  
lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
  lldb/test/API/functionalities/unwind/standard/TestStandardUnwind.py
  lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
  lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py

Index: lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
===
--- lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
+++ lldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
@@ -21,7 +21,7 @@
 @no_debug_info_test  # Prevent the genaration of the dwarf version of this test
 def test_add_dsym_mid_execution(self):
 """Test that add-dsym mid-execution loads the symbols at the right place for a slid binary."""
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 exe = self.getBuildArtifact("a.out")
 
 self.target = self.dbg.CreateTarget(exe)
Index: lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
===
--- lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
+++ lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
@@ -54,7 +54,7 @@
 os.path.basename(self.exe))
 self.dsym_for_uuid = self.getBuildArtifact("dsym-for-uuid.sh")
 
-self.buildDefault(dictionary={'MAKE_DSYM': 'YES'})
+self.build(debug_info="dsym")
 self.assertTrue(os.path.exists(self.exe))
 self.assertTrue(os.path.exists(self.dsym))
 
Index: lldb/test/API/functionalities/unwind/standard/TestStandardUnwind.py
===
--- lldb/test/API/functionalities/unwind/standard/TestStandardUnwind.py
+++ lldb/test/API/functionalities/unwind/standard/TestStandardUnwind.py
@@ -156,7 +156,7 @@
 # It makes the test suit more robust when testing on several different architecture
 # avoid the hassle of skipping tests manually.
 try:
-self.buildDwarf(dictionary=d)
+self.build(dictionary=d)
 self.setTearDownCleanup(d)
 except:
 if self.TraceOn():
Index: lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
===
--- lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ lldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
@@ -77,7 +77,7 @@
 return pwd_symlink
 
 def doBuild(self, pwd_symlink, setting_value):
-self.build(None, None, {'PWD': pwd_symlink})
+self.build(dictionary={'PWD': pwd_symlink})
 
 if setting_value:
 cmd = "settings set %s '%s'" % (_COMP_DIR_SYM_LINK_PROP, setting_value)
Index: lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
===
--- lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
+++ lldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
@@ -27,14 +27,14 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 
 # Insert some delay and then call the program generator to produce
 # main.cpp, version 2.
 time.sleep(5)
 self.generate_main_cpp(version=101)
 # Now call make again, but this time don't generate the dSYM.
-self.buildDefault(dictionary={'MAKE_DSYM':'NO'})
+self.build(debug_info="dwarf")
 
 self.exe_name = 'a.out'
 self.do_add_dsym_with_error(self.exe_name)
@@ -45,7 +45,7 @@
 
 # Call the program generator to produce main.cpp, version 1.
 self.generate_main_cpp(version=1)
-self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+self.build(debug_info="dsym")
 
 self.exe_name = 'a.out'