Skip to content

Commit 0803241

Browse files
[lldb] Enable TestFrameFormatNameWithArgs in case of cross compilation
TestFrameFormatNameWithArgs.test is enabled only in case of native compilation but is applicable in case of cross compilation too. So, provision support for enabling it in case of both, native and cross compilation. Reviewed By: Michael137 Differential Revision: https://reviews.llvm.org/D140839
1 parent 7a6b4e9 commit 0803241

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# UNSUPPORTED: system-windows
2-
# RUN: %clangxx_host -g -O0 %S/Inputs/names.cpp -std=c++17 -o %t.out
2+
# RUN: %build %S/Inputs/names.cpp --std c++17 -o %t.out
33
# RUN: %lldb -b -s %s %t.out | FileCheck %s
44
settings set -f frame-format "frame ${function.name-with-args}\n"
55
break set -n foo

lldb/test/Shell/helper/build.py

+14
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@
110110
nargs='+',
111111
help='Source file(s) to compile / object file(s) to link')
112112

113+
parser.add_argument('--std',
114+
metavar='std',
115+
dest='std',
116+
required=False,
117+
help='Specify the C/C++ standard.')
118+
113119

114120
args = parser.parse_args(args=sys.argv[1:])
115121

@@ -231,6 +237,7 @@ def __init__(self, toolchain_type, args, obj_ext):
231237
self.verbose = args.verbose
232238
self.obj_ext = obj_ext
233239
self.lib_paths = args.libs_dir
240+
self.std = args.std
234241

235242
def _exe_file_name(self):
236243
assert self.mode != 'compile'
@@ -581,6 +588,9 @@ def _get_compilation_command(self, source, obj):
581588
args.append('--')
582589
args.append(source)
583590

591+
if self.std:
592+
args.append('/std:' + self.std)
593+
584594
return ('compiling', [source], obj,
585595
self.compile_env,
586596
args)
@@ -652,6 +662,9 @@ def _get_compilation_command(self, source, obj):
652662
if sys.platform == 'darwin':
653663
args.extend(['-isysroot', self.apple_sdk])
654664

665+
if self.std:
666+
args.append('-std={0}'.format(self.std))
667+
655668
return ('compiling', [source], obj, None, args)
656669

657670
def _get_link_command(self):
@@ -789,6 +802,7 @@ def fix_arguments(args):
789802
print(' Verbose: ' + str(args.verbose))
790803
print(' Dryrun: ' + str(args.dry))
791804
print(' Inputs: ' + format_text(args.inputs, 0, 10))
805+
print(' C/C++ Standard: ' + str(args.std))
792806
print('Script Environment:')
793807
print_environment(os.environ)
794808

0 commit comments

Comments
 (0)