Compare commits
No commits in common. "main" and "v0.8.2" have entirely different histories.
46
.github/workflows/ci.yml
vendored
46
.github/workflows/ci.yml
vendored
@ -25,26 +25,6 @@ jobs:
|
|||||||
- name: build and test
|
- name: build and test
|
||||||
run: |
|
run: |
|
||||||
python3 ci/test-all-configs.py --${{matrix.compiler}} --default-config
|
python3 ci/test-all-configs.py --${{matrix.compiler}} --default-config
|
||||||
test-linux-arm:
|
|
||||||
runs-on: ubuntu-22.04-arm
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
compiler: [gcc, clang]
|
|
||||||
shared: [--shared, ""]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt install gcc-10 g++-10 libgcc-10-dev libunwind8-dev
|
|
||||||
pip3 install colorama
|
|
||||||
- name: libdwarf
|
|
||||||
run: |
|
|
||||||
cd ..
|
|
||||||
cpptrace/ci/setup-prerequisites.sh
|
|
||||||
- name: build and test
|
|
||||||
run: |
|
|
||||||
python3 ci/test-all-configs.py --${{matrix.compiler}} --default-config
|
|
||||||
test-macos:
|
test-macos:
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
strategy:
|
strategy:
|
||||||
@ -582,32 +562,6 @@ jobs:
|
|||||||
- name: test opt
|
- name: test opt
|
||||||
run: |
|
run: |
|
||||||
bazel test //... -c opt
|
bazel test //... -c opt
|
||||||
unittest-linux-arm:
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
compiler: [g++-10, clang++-18]
|
|
||||||
stdlib: [libstdc++, libc++]
|
|
||||||
dwarf_version: [4, 5]
|
|
||||||
split_dwarf: [OFF, ON]
|
|
||||||
exclude:
|
|
||||||
- compiler: g++-10
|
|
||||||
stdlib: libc++
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt install gcc-10 g++-10 libgcc-10-dev ninja-build libc++-dev
|
|
||||||
cd ..
|
|
||||||
cpptrace/ci/setup-prerequisites-unittest.sh
|
|
||||||
- name: build and test
|
|
||||||
run: |
|
|
||||||
python3 ci/unittest.py \
|
|
||||||
--slice=compiler:${{matrix.compiler}} \
|
|
||||||
--slice=stdlib:${{matrix.stdlib}} \
|
|
||||||
--slice=dwarf_version:${{matrix.dwarf_version}} \
|
|
||||||
--slice=split_dwarf:${{matrix.split_dwarf}}
|
|
||||||
unittest-macos:
|
unittest-macos:
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@ -208,19 +208,18 @@ namespace cpptrace {
|
|||||||
const auto yellow = color ? YELLOW : "";
|
const auto yellow = color ? YELLOW : "";
|
||||||
const auto blue = color ? BLUE : "";
|
const auto blue = color ? BLUE : "";
|
||||||
if(frame.is_inline) {
|
if(frame.is_inline) {
|
||||||
microfmt::print(stream, "{<{}} ", 2 * sizeof(frame_ptr) + 2, "(inlined)");
|
microfmt::print(stream, "{<{}}", 2 * sizeof(frame_ptr) + 2, "(inlined)");
|
||||||
} else if(options.addresses != address_mode::none) {
|
} else {
|
||||||
auto address = options.addresses == address_mode::raw ? frame.raw_address : frame.object_address;
|
auto address = options.addresses == address_mode::raw ? frame.raw_address : frame.object_address;
|
||||||
microfmt::print(stream, "{}0x{>{}:0h}{} ", blue, 2 * sizeof(frame_ptr), address, reset);
|
microfmt::print(stream, "{}0x{>{}:0h}{}", blue, 2 * sizeof(frame_ptr), address, reset);
|
||||||
}
|
}
|
||||||
if(!frame.symbol.empty()) {
|
if(!frame.symbol.empty()) {
|
||||||
microfmt::print(stream, "in {}{}{}", yellow, frame.symbol, reset);
|
microfmt::print(stream, " in {}{}{}", yellow, frame.symbol, reset);
|
||||||
}
|
}
|
||||||
if(!frame.filename.empty()) {
|
if(!frame.filename.empty()) {
|
||||||
microfmt::print(
|
microfmt::print(
|
||||||
stream,
|
stream,
|
||||||
"{}at {}{}{}",
|
" at {}{}{}",
|
||||||
frame.symbol.empty() ? "" : " ",
|
|
||||||
green,
|
green,
|
||||||
options.paths == path_mode::full ? frame.filename : detail::basename(frame.filename, true),
|
options.paths == path_mode::full ? frame.filename : detail::basename(frame.filename, true),
|
||||||
reset
|
reset
|
||||||
|
|||||||
@ -96,21 +96,6 @@ TEST(FormatterTest, ObjectAddresses) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FormatterTest, NoAddresses) {
|
|
||||||
auto formatter = cpptrace::formatter{}
|
|
||||||
.addresses(cpptrace::formatter::address_mode::none);
|
|
||||||
auto res = split(formatter.format(make_test_stacktrace()), "\n");
|
|
||||||
EXPECT_THAT(
|
|
||||||
res,
|
|
||||||
ElementsAre(
|
|
||||||
"Stack trace (most recent call first):",
|
|
||||||
"#0 in foo() at foo.cpp:20:30",
|
|
||||||
"#1 in bar() at bar.cpp:30:40",
|
|
||||||
"#2 in main at foo.cpp:40:25"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(FormatterTest, PathShortening) {
|
TEST(FormatterTest, PathShortening) {
|
||||||
cpptrace::stacktrace trace;
|
cpptrace::stacktrace trace;
|
||||||
trace.frames.push_back({0x1, 0x1001, {20}, {30}, "/home/foo/foo.cpp", "foo()", false});
|
trace.frames.push_back({0x1, 0x1001, {20}, {30}, "/home/foo/foo.cpp", "foo()", false});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user