llvm-project/lldb/test/API/commands/command/script_alias/TestCommandScriptAlias.py
eleviant c941bee75d
[lldb] Fix qEcho message handling. (#145675)
This fixes issues found in e066f35c6981c720e3a7e5883efc40c861b3b7, which
was later reverted. The problem was with "k" message which was sent with
sync_on_timeout flag set to true, so lldb was waiting for response,
which is currently not being sent by lldb-server. Not waiting for
response at all seems to be not a solution, because on MAC OS X lldb
waits for response from "k" to gracefully kill inferior.
2025-06-25 13:38:37 +02:00

34 lines
1.1 KiB
Python

"""
Test lldb Python commands.
"""
import lldb
from lldbsuite.test.lldbtest import *
class CommandScriptAliasTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def test_pycmd(self):
self.runCmd("log enable -f /tmp/gdb.log gdb-remote all")
self.runCmd("command script import tcsacmd.py")
self.runCmd("command script add -f tcsacmd.some_command_here attach")
# This is the function to remove the custom commands in order to have a
# clean slate for the next test case.
def cleanup():
self.runCmd("command script delete attach", check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
# We don't want to display the stdout if not in TraceOn() mode.
if not self.TraceOn():
self.HideStdout()
self.expect("attach a", substrs=["Victory is mine"])
self.runCmd("command script delete attach")
# this can't crash but we don't care whether the actual attach works
self.runCmd("attach noprocessexistswiththisname", check=False)