Most of the cases were where a C++ file was being compiled with the C substitution. There were a few cases of the opposite though. LLDB seems to be the only real culprit in the LLVM codebase for these mismatches. Rest of the LLVM presumably sticks at least language-specific options in the common substitutions making the mistakes immediately apparent. I found these by using Clang frontend configuration files containing language-specific options for both C and C++ (e.g. `-std=c2y` and `-std=c++26`).
54 lines
988 B
Plaintext
54 lines
988 B
Plaintext
# UNSUPPORTED: system-windows
|
|
|
|
# Test the plugin.cplusplus.display.function-name-format setting
|
|
# when interoperating multiple languages.
|
|
|
|
# RUN: split-file %s %t
|
|
# RUN: %clang_host -x c -c -g %t/lib.c -o %t.clib.o
|
|
# RUN: %clangxx_host -c -g %t/lib.cpp -o %t.cxxlib.o
|
|
# RUN: %clang_host %t/main.m %t.cxxlib.o %t.clib.o -o %t.out
|
|
# RUN: %lldb -x -b -s %t/commands.input %t.out -o exit 2>&1 | FileCheck %s
|
|
|
|
#--- lib.c
|
|
|
|
void foo();
|
|
|
|
void func() {
|
|
foo();
|
|
}
|
|
|
|
#--- lib.cpp
|
|
|
|
namespace ns {
|
|
struct Foo {
|
|
void method() {}
|
|
};
|
|
}
|
|
|
|
extern "C" {
|
|
void foo() {
|
|
ns::Foo{}.method();
|
|
}
|
|
}
|
|
|
|
#--- main.m
|
|
|
|
void func();
|
|
|
|
int main() {
|
|
func();
|
|
}
|
|
|
|
#--- commands.input
|
|
settings set plugin.cplusplus.display.function-name-format "this affects C++ only"
|
|
settings set -f frame-format "custom-frame '${function.name-with-args}'\n"
|
|
break set -n method
|
|
|
|
run
|
|
bt
|
|
|
|
# CHECK: custom-frame 'this affects C++ only'
|
|
# CHECK: custom-frame 'this affects C++ only'
|
|
# CHECK: custom-frame 'func'
|
|
# CHECK: custom-frame 'main'
|