[Lldb-commits] [lldb] r322167 - [dotest] Remove crashinfo hook
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 10 02:18:47 PST 2018
Author: labath
Date: Wed Jan 10 02:18:47 2018
New Revision: 322167
URL: http://llvm.org/viewvc/llvm-project?rev=322167&view=rev
Log:
[dotest] Remove crashinfo hook
Summary:
This used to be important when all tests were run in a single process,
but that has no longer been the case for a while. Furthermore, this hook fails
to build on new mac versions for several people, and it's not clear
whether fixing it is worth the effort.
Reviewers: jingham, clayborg, davide
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D41871
Removed:
lldb/trunk/packages/Python/lldbsuite/test/crashinfo.c
Modified:
lldb/trunk/.gitignore
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/test_result.py
Modified: lldb/trunk/.gitignore
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/.gitignore?rev=322167&r1=322166&r2=322167&view=diff
==============================================================================
--- lldb/trunk/.gitignore (original)
+++ lldb/trunk/.gitignore Wed Jan 10 02:18:47 2018
@@ -37,8 +37,6 @@ ninja/
*xcuserdata
test/20*
__pycache__/
-*.lock
-*.so
clang-module-cache
@@ -53,7 +51,3 @@ tags
# Ignore test trace directories.
20??-??-??-??_??_??/
-# Ignore crashlog support files.
-crashinfo.lock
-crashinfo.so
-
Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=322167&r1=322166&r2=322167&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Wed Jan 10 02:18:47 2018
@@ -24,40 +24,6 @@ import unittest2
import lldbsuite
-def __setCrashInfoHook_Mac(text):
- from . import crashinfo
- crashinfo.setCrashReporterDescription(text)
-
-
-def setupCrashInfoHook():
- if platform.system() == "Darwin":
- from . import lock
- test_dir = os.environ['LLDB_TEST']
- if not test_dir or not os.path.exists(test_dir):
- return
- dylib_lock = os.path.join(test_dir, "crashinfo.lock")
- dylib_src = os.path.join(test_dir, "crashinfo.c")
- dylib_dst = os.path.join(test_dir, "crashinfo.so")
- try:
- compile_lock = lock.Lock(dylib_lock)
- compile_lock.acquire()
- if not os.path.isfile(dylib_dst) or os.path.getmtime(
- dylib_dst) < os.path.getmtime(dylib_src):
- # we need to compile
- cmd = "SDKROOT= xcrun clang %s -o %s -framework Python -Xlinker -dylib" % (
- dylib_src, dylib_dst)
- if subprocess.call(
- cmd, shell=True) != 0 or not os.path.isfile(dylib_dst):
- raise Exception('command failed: "{}"'.format(cmd))
- finally:
- compile_lock.release()
- del compile_lock
-
- setCrashInfoHook = __setCrashInfoHook_Mac
-
- else:
- pass
-
# The test suite.
suite = unittest2.TestSuite()
Removed: lldb/trunk/packages/Python/lldbsuite/test/crashinfo.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/crashinfo.c?rev=322166&view=auto
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/crashinfo.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/crashinfo.c (removed)
@@ -1,64 +0,0 @@
-/******************************************************************************
- The LLVM Compiler Infrastructure
-
- This file is distributed under the University of Illinois Open Source
- License. See LICENSE.TXT for details.
- ******************************************************************************
-
-* This C file vends a simple interface to set the Application Specific Info
-* on Mac OS X through Python. To use, compile as a dylib, import crashinfo
-* and call crashinfo.setCrashReporterDescription("hello world")
-* The testCrashReporterDescription() API is simply there to let you test that this
-* is doing what it is intended to do without having to actually cons up a crash
-******************************************************************************/
-
-#include <Python/Python.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-void *__crashreporter_info__ = NULL;
-
-asm(".desc ___crashreporter_info__, 0x10");
-
-static PyObject* setCrashReporterDescription(PyObject* self, PyObject* string)
-{
- if (__crashreporter_info__)
- {
- free(__crashreporter_info__);
- __crashreporter_info__ = NULL;
- }
-
- if (string && PyString_Check(string))
- {
- Py_ssize_t size = PyString_Size(string);
- char* data = PyString_AsString(string);
- if (size > 0 && data)
- {
- ++size; // Include the NULL terminateor in allocation and memcpy()
- __crashreporter_info__ = malloc(size);
- memcpy(__crashreporter_info__, data, size);
- return Py_True;
- }
- }
- return Py_False;
-}
-
-static PyObject* testCrashReporterDescription(PyObject*self, PyObject* arg)
-{
- int* ptr = 0;
- *ptr = 1;
- return Py_None;
-}
-
-static PyMethodDef crashinfo_methods[] = {
- {"setCrashReporterDescription", setCrashReporterDescription, METH_O},
- {"testCrashReporterDescription", testCrashReporterDescription, METH_O},
- {NULL, NULL}
-};
-
-void initcrashinfo()
-{
- (void) Py_InitModule("crashinfo", crashinfo_methods);
-}
-
Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=322167&r1=322166&r2=322167&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Jan 10 02:18:47 2018
@@ -1117,7 +1117,6 @@ def run_suite():
signal.signal(signal.SIGINT, signal.SIG_IGN)
setupSysPath()
- configuration.setupCrashInfoHook()
#
# If '-l' is specified, do not skip the long running tests.
Modified: lldb/trunk/packages/Python/lldbsuite/test/test_result.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_result.py?rev=322167&r1=322166&r2=322167&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/test_result.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/test_result.py Wed Jan 10 02:18:47 2018
@@ -171,9 +171,6 @@ class LLDBTestResult(unittest2.TextTestR
(str(test), inspect.getfile(
test.__class__)))
self.counter += 1
- # if self.counter == 4:
- # import crashinfo
- # crashinfo.testCrashReporterDescription(None)
test.test_number = self.counter
if self.showAll:
self.stream.write(self.fmt % self.counter)
More information about the lldb-commits
mailing list