Skip to content

Commit 4fd8a18

Browse files
AutomergerAutomerger
Automerger
authored and
Automerger
committed
Propagating prior merge from 'llvm.org/master'.
apple-llvm-split-commit: 258b993c286871a6d7552c0820f8d99d797b143b apple-llvm-split-dir: compiler-rt/
2 parents bafb444 + a5359b1 commit 4fd8a18

File tree

14 files changed

+188
-229
lines changed

14 files changed

+188
-229
lines changed

compiler-rt/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ if (COMPILER_RT_STANDALONE_BUILD)
8080
endif()
8181

8282
# Find Python interpreter.
83-
set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5)
8483
include(FindPythonInterp)
8584
if(NOT PYTHONINTERP_FOUND)
8685
message(FATAL_ERROR "

compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// RUN: %clang_asan %s -o %t.out -ldl
33
// RUN: ASAN_OPTIONS=verbosity=1 not %t.out %t.so 2>&1 | FileCheck %s
44
//
5-
// CHECK: AddressSanitizer: failed to intercept '__cxa_throw'
5+
// CHECK: {{.*}}AddressSanitizer: failed to intercept '__cxa_{{.*}}throw{{.*}}'
66
//
7-
// dlopen() can not be intercepted on Android
8-
// UNSUPPORTED: android
7+
// REQUIRES: x86-target-arch && !android
8+
99
#ifdef __cplusplus
1010

1111
static void foo(void) {

lld/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
5656
include(HandleLLVMOptions)
5757

5858
if(LLVM_INCLUDE_TESTS)
59-
set(Python_ADDITIONAL_VERSIONS 2.7)
6059
include(FindPythonInterp)
6160
if(NOT PYTHONINTERP_FOUND)
6261
message(FATAL_ERROR

lld/test/ELF/ppc64-dynamic-relocations.s

Lines changed: 0 additions & 50 deletions
This file was deleted.

lldb/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ if(LLDB_INCLUDE_TESTS)
107107
list(APPEND LLDB_TEST_DEPS lldb-server)
108108
endif()
109109

110-
if(TARGET debugserver)
111-
list(APPEND LLDB_TEST_DEPS debugserver)
112-
endif()
113-
114110
if(TARGET lldb-mi)
115111
list(APPEND LLDB_TEST_DEPS lldb-mi)
116112
endif()

lldb/cmake/modules/AddLLDB.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,27 @@ function(lldb_setup_rpaths name)
276276
INSTALL_RPATH "${LIST_INSTALL_RPATH}"
277277
)
278278
endfunction()
279+
280+
function(lldb_find_system_debugserver path)
281+
execute_process(COMMAND xcode-select -p
282+
RESULT_VARIABLE exit_code
283+
OUTPUT_VARIABLE xcode_dev_dir
284+
ERROR_VARIABLE error_msg
285+
OUTPUT_STRIP_TRAILING_WHITESPACE)
286+
if(exit_code)
287+
message(WARNING "`xcode-select -p` failed:\n${error_msg}")
288+
else()
289+
set(subpath "LLDB.framework/Resources/debugserver")
290+
set(path_shared "${xcode_dev_dir}/../SharedFrameworks/${subpath}")
291+
set(path_private "${xcode_dev_dir}/Library/PrivateFrameworks/${subpath}")
292+
293+
if(EXISTS ${path_shared})
294+
set(${path} ${path_shared} PARENT_SCOPE)
295+
elseif(EXISTS ${path_private})
296+
set(${path} ${path_private} PARENT_SCOPE)
297+
else()
298+
message(WARNING "System debugserver requested, but not found. "
299+
"Candidates don't exist: ${path_shared}\n${path_private}")
300+
endif()
301+
endif()
302+
endfunction()

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install a
5050
option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON)
5151
option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF)
5252
option(LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF)
53+
option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF)
5354

5455
if(LLDB_BUILD_FRAMEWORK)
5556
if(NOT APPLE)

lldb/source/Commands/CommandObjectCommands.cpp

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,8 @@ using namespace lldb_private;
3232
// CommandObjectCommandsSource
3333

3434
static constexpr OptionDefinition g_history_options[] = {
35-
// clang-format off
36-
{ LLDB_OPT_SET_1, false, "count", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "How many history commands to print." },
37-
{ LLDB_OPT_SET_1, false, "start-index", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "Index at which to start printing history commands (or end to mean tail mode)." },
38-
{ LLDB_OPT_SET_1, false, "end-index", 'e', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeUnsignedInteger, "Index at which to stop printing history commands." },
39-
{ LLDB_OPT_SET_2, false, "clear", 'C', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeBoolean, "Clears the current command history." },
40-
// clang-format on
35+
#define LLDB_OPTIONS_history
36+
#include "CommandOptions.inc"
4137
};
4238

4339
class CommandObjectCommandsHistory : public CommandObjectParsed {
@@ -189,11 +185,8 @@ class CommandObjectCommandsHistory : public CommandObjectParsed {
189185
// CommandObjectCommandsSource
190186

191187
static constexpr OptionDefinition g_source_options[] = {
192-
// clang-format off
193-
{ LLDB_OPT_SET_ALL, false, "stop-on-error", 'e', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true, stop executing commands on error." },
194-
{ LLDB_OPT_SET_ALL, false, "stop-on-continue", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true, stop executing commands on continue." },
195-
{ LLDB_OPT_SET_ALL, false, "silent-run", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true don't echo commands while executing." },
196-
// clang-format on
188+
#define LLDB_OPTIONS_source
189+
#include "CommandOptions.inc"
197190
};
198191

199192
class CommandObjectCommandsSource : public CommandObjectParsed {
@@ -344,10 +337,8 @@ class CommandObjectCommandsSource : public CommandObjectParsed {
344337
// CommandObjectCommandsAlias
345338

346339
static constexpr OptionDefinition g_alias_options[] = {
347-
// clang-format off
348-
{ LLDB_OPT_SET_ALL, false, "help", 'h', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeHelpText, "Help text for this command" },
349-
{ LLDB_OPT_SET_ALL, false, "long-help", 'H', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeHelpText, "Long help text for this command" },
350-
// clang-format on
340+
#define LLDB_OPTIONS_alias
341+
#include "CommandOptions.inc"
351342
};
352343

353344
static const char *g_python_command_instructions =
@@ -912,10 +903,8 @@ class CommandObjectCommandsDelete : public CommandObjectParsed {
912903
// CommandObjectCommandsAddRegex
913904

914905
static constexpr OptionDefinition g_regex_options[] = {
915-
// clang-format off
916-
{ LLDB_OPT_SET_1, false, "help" , 'h', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeNone, "The help text to display for this command." },
917-
{ LLDB_OPT_SET_1, false, "syntax", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeNone, "A syntax string showing the typical usage syntax." },
918-
// clang-format on
906+
#define LLDB_OPTIONS_regex
907+
#include "CommandOptions.inc"
919908
};
920909

921910
#pragma mark CommandObjectCommandsAddRegex
@@ -1387,9 +1376,8 @@ class CommandObjectScriptingObject : public CommandObjectRaw {
13871376
// CommandObjectCommandsScriptImport
13881377

13891378
static constexpr OptionDefinition g_script_import_options[] = {
1390-
// clang-format off
1391-
{ LLDB_OPT_SET_1, false, "allow-reload", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Allow the script to be loaded even if it was already loaded before. This argument exists for backwards compatibility, but reloading is always allowed, whether you specify it or not." },
1392-
// clang-format on
1379+
#define LLDB_OPTIONS_script_import
1380+
#include "CommandOptions.inc"
13931381
};
13941382

13951383
class CommandObjectCommandsScriptImport : public CommandObjectParsed {
@@ -1521,12 +1509,8 @@ static constexpr OptionEnumValues ScriptSynchroType() {
15211509
}
15221510

15231511
static constexpr OptionDefinition g_script_add_options[] = {
1524-
// clang-format off
1525-
{ LLDB_OPT_SET_1, false, "function", 'f', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePythonFunction, "Name of the Python function to bind to this command name." },
1526-
{ LLDB_OPT_SET_2, false, "class", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePythonClass, "Name of the Python class to bind to this command name." },
1527-
{ LLDB_OPT_SET_1, false, "help" , 'h', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeHelpText, "The help text to display for this command." },
1528-
{ LLDB_OPT_SET_ALL, false, "synchronicity", 's', OptionParser::eRequiredArgument, nullptr, ScriptSynchroType(), 0, eArgTypeScriptedCommandSynchronicity, "Set the synchronicity of this command's executions with regard to LLDB event system." },
1529-
// clang-format on
1512+
#define LLDB_OPTIONS_script_add
1513+
#include "CommandOptions.inc"
15301514
};
15311515

15321516
class CommandObjectCommandsScriptAdd : public CommandObjectParsed,

lldb/source/Commands/Options.td

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,63 @@ let Command = "breakpoint list" in {
5252
"provided, which prime new targets.">;
5353
}
5454

55+
let Command = "history" in {
56+
def history_count : Option<"count", "c">, Group<1>, Arg<"UnsignedInteger">,
57+
Desc<"How many history commands to print.">;
58+
def history_start_index : Option<"start-index", "s">, Group<1>,
59+
Arg<"UnsignedInteger">, Desc<"Index at which to start printing history "
60+
"commands (or end to mean tail mode).">;
61+
def history_end_index : Option<"end-index", "e">, Group<1>,
62+
Arg<"UnsignedInteger">,
63+
Desc<"Index at which to stop printing history commands.">;
64+
def history_clear : Option<"clear", "C">, Group<2>,
65+
Desc<"Clears the current command history.">;
66+
}
67+
68+
let Command = "source" in {
69+
def source_stop_on_error : Option<"stop-on-error", "e">, Arg<"Boolean">,
70+
Desc<"If true, stop executing commands on error.">;
71+
def source_stop_on_continue : Option<"stop-on-continue", "c">, Arg<"Boolean">,
72+
Desc<"If true, stop executing commands on continue.">;
73+
def source_silent_run : Option<"silent-run", "s">, Arg<"Boolean">,
74+
Desc<"If true don't echo commands while executing.">;
75+
}
76+
77+
let Command = "alias" in {
78+
def alias_help : Option<"help", "h">, Arg<"HelpText">,
79+
Desc<"Help text for this command">;
80+
def alias_long_help : Option<"long-help", "H">, Arg<"HelpText">,
81+
Desc<"Long help text for this command">;
82+
}
83+
84+
let Command = "regex" in {
85+
def regex_help : Option<"help", "h">, Group<1>, Arg<"None">,
86+
Desc<"The help text to display for this command.">;
87+
def regex_syntax : Option<"syntax", "s">, Group<1>, Arg<"None">,
88+
Desc<"A syntax string showing the typical usage syntax.">;
89+
}
90+
91+
let Command = "script import" in {
92+
def script_import_allow_reload : Option<"allow-reload", "r">, Group<1>,
93+
Desc<"Allow the script to be loaded even if it was already loaded before. "
94+
"This argument exists for backwards compatibility, but reloading is always "
95+
"allowed, whether you specify it or not.">;
96+
}
97+
98+
let Command = "script add" in {
99+
def script_add_function : Option<"function", "f">, Group<1>,
100+
Arg<"PythonFunction">,
101+
Desc<"Name of the Python function to bind to this command name.">;
102+
def script_add_class : Option<"class", "c">, Group<2>, Arg<"PythonClass">,
103+
Desc<"Name of the Python class to bind to this command name.">;
104+
def script_add_help : Option<"help", "h">, Group<1>, Arg<"HelpText">,
105+
Desc<"The help text to display for this command.">;
106+
def script_add_synchronicity : Option<"synchronicity", "s">,
107+
EnumArg<"ScriptedCommandSynchronicity", "ScriptSynchroType()">,
108+
Desc<"Set the synchronicity of this command's executions with regard to "
109+
"LLDB event system.">;
110+
}
111+
55112
let Command = "thread backtrace" in {
56113
def thread_backtrace_count : Option<"count", "c">, Group<1>, Arg<"Count">,
57114
Desc<"How many frames to display (-1 for all)">;

lldb/test/CMakeLists.txt

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
7474
endif()
7575
endif()
7676

77-
if(LLDB_CODESIGN_IDENTITY_USED)
78-
list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${LLDB_CODESIGN_IDENTITY_USED}")
79-
endif()
80-
81-
if(LLDB_BUILD_FRAMEWORK)
82-
get_target_property(framework_target_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
83-
list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_target_dir}/LLDB.framework)
84-
endif()
85-
8677
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin")
8778
list(APPEND LLDB_TEST_COMMON_ARGS
8879
--env ARCHIVER=${CMAKE_AR} --env OBJCOPY=${CMAKE_OBJCOPY})
@@ -94,12 +85,28 @@ if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "")
9485
endif()
9586
endif()
9687

97-
if(CMAKE_HOST_APPLE AND DEBUGSERVER_PATH)
98-
list(APPEND LLDB_TEST_COMMON_ARGS --server ${DEBUGSERVER_PATH})
99-
endif()
88+
if(CMAKE_HOST_APPLE)
89+
if(LLDB_BUILD_FRAMEWORK)
90+
get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
91+
list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework)
92+
endif()
93+
94+
# Use the same identity for testing
95+
get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY)
96+
if(code_sign_identity_used)
97+
list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${code_sign_identity_used}")
98+
endif()
10099

101-
if(SKIP_TEST_DEBUGSERVER)
102-
list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver)
100+
if(LLDB_USE_SYSTEM_DEBUGSERVER)
101+
lldb_find_system_debugserver(system_debugserver_path)
102+
message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}")
103+
list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver)
104+
else()
105+
set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver)
106+
message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}")
107+
list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path})
108+
add_dependencies(lldb-test-deps debugserver)
109+
endif()
103110
endif()
104111

105112
set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})

0 commit comments

Comments
 (0)