[Lldb-commits] [lldb] r355413 - [lldb] Disable some of TestJITLoaderGDB.py tests on Windows

2019-10-04 Thread Yury Delendik via lldb-commits
Author: yurydelendik
Date: Tue Mar  5 09:09:26 2019
New Revision: 355413

URL: http://llvm.org/viewvc/llvm-project?rev=355413&view=rev
Log:
[lldb] Disable some of TestJITLoaderGDB.py tests on Windows

The test expect sample executable code be built, but fails on Windows.

Review comment https://reviews.llvm.org/D57689#1418597

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D57689

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py?rev=355413&r1=355412&r2=355413&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
 Tue Mar  5 09:09:26 2019
@@ -58,6 +58,7 @@ class JITLoaderGDBTestCase(TestBase):
 self.expect("settings show plugin.jit-loader.gdb.enable",
 substrs=["plugin.jit-loader.gdb.enable (enum) = default"])
 
+@skipIfWindows # This test fails on Windows during C code build
 def test_jit_int_on(self):
 """Tests interface with 'enable' settings 'on'"""
 self.build()
@@ -87,6 +88,7 @@ class JITLoaderGDBTestCase(TestBase):
 self.assertIn(
 "SetJITBreakpoint setting JIT breakpoint", logcontent)
 
+@skipIfWindows # This test fails on Windows during C code build
 def test_jit_int_off(self):
 """Tests interface with 'enable' settings 'off'"""
 self.build()


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


[Lldb-commits] [lldb] r355402 - Adds property to force enabling of GDB JIT loader for MacOS

2019-10-04 Thread Yury Delendik via lldb-commits
Author: yurydelendik
Date: Tue Mar  5 06:23:53 2019
New Revision: 355402

URL: http://llvm.org/viewvc/llvm-project?rev=355402&view=rev
Log:
Adds property to force enabling of GDB JIT loader for MacOS

Summary:
Based on 
https://gist.github.com/thlorenz/30bf0a3f67b1d97b2945#patching-and-rebuilding

The functionality was disabled at 
https://github.com/llvm/llvm-project/commit/521c2278abb16f0148cef1bd061cadb01ef43192

Reviewers: jingham

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D57689

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.c

lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.mk
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile?rev=355402&r1=355401&r2=355402&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile
 Tue Mar  5 06:23:53 2019
@@ -2,4 +2,12 @@ LEVEL = ../../make
 
 C_SOURCES := main.c
 
+all: a.out simple
+
 include $(LEVEL)/Makefile.rules
+
+simple:
+   $(MAKE) VPATH=$(VPATH) -f $(SRCDIR)/simple.mk
+
+clean::
+   $(MAKE) -f $(SRCDIR)/simple.mk clean
\ No newline at end of file

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py?rev=355402&r1=355401&r2=355402&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
 Tue Mar  5 06:23:53 2019
@@ -10,6 +10,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 import re
 
+file_index = 0
 
 class JITLoaderGDBTestCase(TestBase):
 
@@ -38,3 +39,80 @@ class JITLoaderGDBTestCase(TestBase):
 
 self.assertEqual(process.GetState(), lldb.eStateExited)
 self.assertEqual(process.GetExitStatus(), 0)
+
+def gen_log_file(self):
+global file_index
+++file_index
+logfile = os.path.join(
+self.getBuildDir(),
+"jitintgdb-" + self.getArchitecture() + "-" +
+str(file_index) + ".txt")
+
+def cleanup():
+if os.path.exists(logfile):
+os.unlink(logfile)
+self.addTearDownHook(cleanup)
+return logfile
+
+def test_jit_int_default(self):
+self.expect("settings show plugin.jit-loader.gdb.enable",
+substrs=["plugin.jit-loader.gdb.enable (enum) = default"])
+
+def test_jit_int_on(self):
+"""Tests interface with 'enable' settings 'on'"""
+self.build()
+exe = self.getBuildArtifact("simple")
+
+logfile = self.gen_log_file()
+self.runCmd("log enable -f %s lldb jit" % (logfile))
+self.runCmd("settings set plugin.jit-loader.gdb.enable on")
+def cleanup():
+self.runCmd("log disable lldb")
+self.runCmd("settings set plugin.jit-loader.gdb.enable default")
+self.addTearDownHook(cleanup)
+
+# launch the process
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target, VALID_TARGET)
+process = target.LaunchSimple(
+None, None, self.get_process_working_directory())
+self.assertTrue(process, PROCESS_IS_VALID)
+
+self.assertEqual(process.GetState(), lldb.eStateExited)
+self.assertEqual(process.GetExitStatus(), 0)
+
+logcontent = ""
+if os.path.exists(logfile):
+logcontent = open(logfile).read()
+self.assertIn(
+"SetJITBreakpoint setting JIT breakpoint", logcontent)
+
+def test_jit_int_off(self):
+"""Tests interface with 'enable' settings 'off'"""
+self.build()
+exe = self.getBuildArtifact("simple")
+
+logfile = self.gen_log_file()
+self.runCmd("log enable -f %s lldb jit" % (logfile))
+self.runCmd("settings set plugin.jit-loader.gdb.enable off")
+def cleanup():
+self.runCmd("log disable lldb")
+self.runCmd("settings set plugin.jit-loader.gdb.enable default")
+self.addTearDownHook(cleanup)
+
+# launch the process
+