[Lldb-commits] [lldb] r370387 - [dotest] Remove deprecated loggin through env variables.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 29 10:19:00 PDT 2019


Author: jdevlieghere
Date: Thu Aug 29 10:19:00 2019
New Revision: 370387

URL: http://llvm.org/viewvc/llvm-project?rev=370387&view=rev
Log:
[dotest] Remove deprecated loggin through env variables.

It used to be possible to enable logging through environment variables
read by dotest. This approach is deprecated, as stated in the dotest
help output. Instead --channel should be used.

Differential revision: https://reviews.llvm.org/D66920

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/dotest.py

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=370387&r1=370386&r2=370387&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Aug 29 10:19:00 2019
@@ -167,20 +167,6 @@ to create reference logs for debugging.
 
 $ ./dotest.py --log-success
 
-Option 2: (DEPRECATED)
-
-The following options can only enable logs from the host lldb process.
-Only categories from the "lldb" or "gdb-remote" channels can be enabled
-They also do not automatically enable logs in locally running debug servers.
-Also, logs from all test case are written into each log file
-
-o LLDB_LOG: if defined, specifies the log file pathname for the 'lldb' subsystem
-  with a default option of 'event process' if LLDB_LOG_OPTION is not defined.
-
-o GDB_REMOTE_LOG: if defined, specifies the log file pathname for the
-  'process.gdb-remote' subsystem with a default option of 'packets' if
-  GDB_REMOTE_LOG_OPTION is not defined.
-
 """)
     sys.exit(0)
 
@@ -766,61 +752,6 @@ def disabledynamics():
         raise Exception('disabling dynamic type support failed')
 
 
-def lldbLoggings():
-    import lldb
-    """Check and do lldb loggings if necessary."""
-
-    # Turn on logging for debugging purposes if ${LLDB_LOG} environment variable is
-    # defined.  Use ${LLDB_LOG} to specify the log file.
-    ci = lldb.DBG.GetCommandInterpreter()
-    res = lldb.SBCommandReturnObject()
-    if ("LLDB_LOG" in os.environ):
-        open(os.environ["LLDB_LOG"], 'w').close()
-        if ("LLDB_LOG_OPTION" in os.environ):
-            lldb_log_option = os.environ["LLDB_LOG_OPTION"]
-        else:
-            lldb_log_option = "event process expr state api"
-        ci.HandleCommand(
-            "log enable -n -f " +
-            os.environ["LLDB_LOG"] +
-            " lldb " +
-            lldb_log_option,
-            res)
-        if not res.Succeeded():
-            raise Exception('log enable failed (check LLDB_LOG env variable)')
-
-    if ("LLDB_LINUX_LOG" in os.environ):
-        open(os.environ["LLDB_LINUX_LOG"], 'w').close()
-        if ("LLDB_LINUX_LOG_OPTION" in os.environ):
-            lldb_log_option = os.environ["LLDB_LINUX_LOG_OPTION"]
-        else:
-            lldb_log_option = "event process expr state api"
-        ci.HandleCommand(
-            "log enable -n -f " +
-            os.environ["LLDB_LINUX_LOG"] +
-            " linux " +
-            lldb_log_option,
-            res)
-        if not res.Succeeded():
-            raise Exception(
-                'log enable failed (check LLDB_LINUX_LOG env variable)')
-
-    # Ditto for gdb-remote logging if ${GDB_REMOTE_LOG} environment variable is defined.
-    # Use ${GDB_REMOTE_LOG} to specify the log file.
-    if ("GDB_REMOTE_LOG" in os.environ):
-        if ("GDB_REMOTE_LOG_OPTION" in os.environ):
-            gdb_remote_log_option = os.environ["GDB_REMOTE_LOG_OPTION"]
-        else:
-            gdb_remote_log_option = "packets process"
-        ci.HandleCommand(
-            "log enable -n -f " + os.environ["GDB_REMOTE_LOG"] + " gdb-remote "
-            + gdb_remote_log_option,
-            res)
-        if not res.Succeeded():
-            raise Exception(
-                'log enable failed (check GDB_REMOTE_LOG env variable)')
-
-
 # ======================================== #
 #                                          #
 # Execution of the test driver starts here #
@@ -1091,9 +1022,6 @@ def run_suite():
     # Now that we have loaded all the test cases, run the whole test suite.
     #
 
-    # Turn on lldb loggings if necessary.
-    lldbLoggings()
-
     # Disable default dynamic types for testing purposes
     disabledynamics()
 




More information about the lldb-commits mailing list