CI and dwarf work (#30)
This commit is contained in:
parent
5080fb33d7
commit
95ee2a815c
76
.github/workflows/performance-tests.yml
vendored
76
.github/workflows/performance-tests.yml
vendored
@ -18,13 +18,13 @@ jobs:
|
|||||||
"-DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF=On -DCPPTRACE_BUILD_SPEEDTEST_DWARF5=On"
|
"-DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF=On -DCPPTRACE_BUILD_SPEEDTEST_DWARF5=On"
|
||||||
]
|
]
|
||||||
exclude:
|
exclude:
|
||||||
# TODO: Maybe a bug in dwarf5_ranges. b _dwarf_error_string
|
## TODO: Maybe a bug in dwarf5_ranges. b _dwarf_error_string
|
||||||
# DW_DLE_RNGLISTS_ERROR: rnglists table index of 2052 too large for table of 5 entries.
|
## DW_DLE_RNGLISTS_ERROR: rnglists table index of 2052 too large for table of 5 entries.
|
||||||
- config: "-DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF=On -DCPPTRACE_BUILD_SPEEDTEST_DWARF5=On"
|
#- config: "-DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF=On -DCPPTRACE_BUILD_SPEEDTEST_DWARF5=On"
|
||||||
compiler: clang++-14
|
# compiler: clang++-14
|
||||||
# TODO: Currently slow. Need to investigate why.
|
## TODO: Currently slow. Need to investigate why.
|
||||||
- config: "-DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF=On -DCPPTRACE_BUILD_SPEEDTEST_DWARF4=On"
|
#- config: "-DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF=On -DCPPTRACE_BUILD_SPEEDTEST_DWARF4=On"
|
||||||
compiler: clang++-14
|
# compiler: clang++-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: dependencies
|
- name: dependencies
|
||||||
@ -45,34 +45,34 @@ jobs:
|
|||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
./speedtest | python3 ../ci/speedtest.py ${{matrix.compiler}} ${{matrix.config}}
|
./speedtest | python3 ../ci/speedtest.py ${{matrix.compiler}} ${{matrix.config}}
|
||||||
# TODO: For some reason this is slow on github's runner
|
|
||||||
#performancetest-windows:
|
performancetest-windows:
|
||||||
# runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
# strategy:
|
strategy:
|
||||||
# fail-fast: false
|
fail-fast: false
|
||||||
# matrix:
|
matrix:
|
||||||
# compiler: [cl, clang++]
|
compiler: [cl, clang++]
|
||||||
# target: [Debug]
|
target: [Debug]
|
||||||
# std: [11, 20]
|
std: [11, 20]
|
||||||
# config: [
|
config: [
|
||||||
# "-DCPPTRACE_GET_SYMBOLS_WITH_DBGHELP=On"
|
"-DCPPTRACE_GET_SYMBOLS_WITH_DBGHELP=On"
|
||||||
# ]
|
]
|
||||||
# steps:
|
steps:
|
||||||
# - uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
# - name: Enable Developer Command Prompt
|
- name: Enable Developer Command Prompt
|
||||||
# uses: ilammy/msvc-dev-cmd@v1.10.0
|
uses: ilammy/msvc-dev-cmd@v1.10.0
|
||||||
# - name: build and speedtest
|
- name: build and speedtest
|
||||||
# run: |
|
run: |
|
||||||
# mkdir -p build
|
mkdir -p build
|
||||||
# cd build
|
cd build
|
||||||
# cmake .. `
|
cmake .. `
|
||||||
# -DCMAKE_BUILD_TYPE=Debug `
|
-DCMAKE_BUILD_TYPE=Debug `
|
||||||
# -DCMAKE_CXX_COMPILER=${{matrix.compiler}} `
|
-DCMAKE_CXX_COMPILER=${{matrix.compiler}} `
|
||||||
# -DCMAKE_CXX_STANDARD=${{matrix.std}} `
|
-DCMAKE_CXX_STANDARD=${{matrix.std}} `
|
||||||
# ${{matrix.config}} `
|
${{matrix.config}} `
|
||||||
# -DCPPTRACE_BUILD_SPEEDTEST=On
|
-DCPPTRACE_BUILD_SPEEDTEST=On
|
||||||
# msbuild .\cpptrace.sln
|
msbuild .\cpptrace.sln
|
||||||
# - name: test
|
- name: test
|
||||||
# working-directory: build
|
working-directory: build
|
||||||
# run: |
|
run: |
|
||||||
# .\${{matrix.target}}\speedtest.exe | python3 ../ci/speedtest.py ${{matrix.config}}
|
.\${{matrix.target}}\speedtest.exe | python3 ../ci/speedtest.py ${{matrix.config}}
|
||||||
|
|||||||
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
- name: build and test
|
- name: build and test
|
||||||
run: |
|
run: |
|
||||||
pip3 install colorama
|
pip3 install colorama
|
||||||
#python3 ci/test-all-configs.py
|
python3 ci/test-all-configs.py
|
||||||
test-macos:
|
test-macos:
|
||||||
runs-on: macos-13
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
@ -24,7 +24,7 @@ jobs:
|
|||||||
- name: build and test
|
- name: build and test
|
||||||
run: |
|
run: |
|
||||||
pip3 install colorama
|
pip3 install colorama
|
||||||
#python3 ci/test-all-configs.py
|
python3 ci/test-all-configs.py
|
||||||
test-windows-msvc:
|
test-windows-msvc:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
@ -34,7 +34,7 @@ jobs:
|
|||||||
- name: build and test
|
- name: build and test
|
||||||
run: |
|
run: |
|
||||||
pip3 install colorama
|
pip3 install colorama
|
||||||
#python3 ci/test-all-configs.py --msvc-only
|
python3 ci/test-all-configs.py --msvc-only
|
||||||
test-windows-clang:
|
test-windows-clang:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
@ -44,7 +44,7 @@ jobs:
|
|||||||
- name: build and test
|
- name: build and test
|
||||||
run: |
|
run: |
|
||||||
pip3 install colorama
|
pip3 install colorama
|
||||||
#python3 ci/test-all-configs.py --clang-only
|
python3 ci/test-all-configs.py --clang-only
|
||||||
test-windows-mingw:
|
test-windows-mingw:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
@ -54,4 +54,4 @@ jobs:
|
|||||||
- name: build and test
|
- name: build and test
|
||||||
run: |
|
run: |
|
||||||
pip3 install colorama
|
pip3 install colorama
|
||||||
#python3 ci/test-all-configs.py --mingw-only
|
python3 ci/test-all-configs.py --mingw-only
|
||||||
|
|||||||
@ -307,6 +307,7 @@ def main():
|
|||||||
"CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE",
|
"CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE",
|
||||||
"CPPTRACE_GET_SYMBOLS_WITH_LIBDL",
|
"CPPTRACE_GET_SYMBOLS_WITH_LIBDL",
|
||||||
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
|
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
|
||||||
|
"CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
|
||||||
#"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
|
#"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
|
||||||
],
|
],
|
||||||
"demangle": [
|
"demangle": [
|
||||||
@ -338,6 +339,7 @@ def main():
|
|||||||
#"CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE",
|
#"CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE",
|
||||||
"CPPTRACE_GET_SYMBOLS_WITH_LIBDL",
|
"CPPTRACE_GET_SYMBOLS_WITH_LIBDL",
|
||||||
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
|
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
|
||||||
|
"CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
|
||||||
#"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
|
#"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
|
||||||
],
|
],
|
||||||
"demangle": [
|
"demangle": [
|
||||||
@ -390,6 +392,7 @@ def main():
|
|||||||
"symbols": [
|
"symbols": [
|
||||||
"CPPTRACE_GET_SYMBOLS_WITH_DBGHELP",
|
"CPPTRACE_GET_SYMBOLS_WITH_DBGHELP",
|
||||||
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
|
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
|
||||||
|
"CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
|
||||||
#"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
|
#"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
|
||||||
],
|
],
|
||||||
"demangle": [
|
"demangle": [
|
||||||
@ -418,6 +421,14 @@ def main():
|
|||||||
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
|
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
|
||||||
"compiler": "clang++"
|
"compiler": "clang++"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
|
||||||
|
"compiler": "cl"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
|
||||||
|
"compiler": "clang++"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_DBGHELP",
|
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_DBGHELP",
|
||||||
"compiler": "g++"
|
"compiler": "g++"
|
||||||
|
|||||||
@ -455,7 +455,7 @@ namespace cpptrace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string resolve_type(Dwarf_Debug dbg, const die_object& die, std::string build = "");
|
/*std::string resolve_type(Dwarf_Debug dbg, const die_object& die, std::string build = "");
|
||||||
|
|
||||||
std::string get_array_extents(Dwarf_Debug dbg, const die_object& die) {
|
std::string get_array_extents(Dwarf_Debug dbg, const die_object& die) {
|
||||||
assert(die.get_tag() == DW_TAG_array_type);
|
assert(die.get_tag() == DW_TAG_array_type);
|
||||||
@ -608,7 +608,7 @@ namespace cpptrace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {"<unknown>", "<unknown>"};
|
return {"<unknown>", "<unknown>"};
|
||||||
}
|
}*/
|
||||||
|
|
||||||
bool is_mangled_name(const std::string& name) {
|
bool is_mangled_name(const std::string& name) {
|
||||||
return name.find("_Z") || name.find("?h@@");
|
return name.find("_Z") || name.find("?h@@");
|
||||||
@ -635,8 +635,28 @@ namespace cpptrace {
|
|||||||
if(!linkage_name.empty()) {
|
if(!linkage_name.empty()) {
|
||||||
frame.symbol = linkage_name;
|
frame.symbol = linkage_name;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// TODO: temporary
|
||||||
|
ret = dwarf_attr(die.get(), DW_AT_name, &attr, nullptr);
|
||||||
|
if(ret == DW_DLV_OK) {
|
||||||
|
char* raw_linkage_name;
|
||||||
|
std::string linkage_name;
|
||||||
|
if(dwarf_formstring(attr, &raw_linkage_name, nullptr) == DW_DLV_OK) {
|
||||||
|
linkage_name = raw_linkage_name;
|
||||||
|
if(dump_dwarf) {
|
||||||
|
fprintf(stderr, "name: %s\n", raw_linkage_name);
|
||||||
}
|
}
|
||||||
std::string name = die.get_name();
|
dwarf_dealloc(dbg, raw_linkage_name, DW_DLA_STRING);
|
||||||
|
}
|
||||||
|
dwarf_dealloc(dbg, attr, DW_DLA_ATTR);
|
||||||
|
if(!linkage_name.empty()) {
|
||||||
|
frame.symbol = linkage_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// TODO: Handle namespaces
|
||||||
|
// TODO: Disabled for now
|
||||||
|
/*std::string name = die.get_name();
|
||||||
std::vector<std::string> params;
|
std::vector<std::string> params;
|
||||||
auto child = die.get_child();
|
auto child = die.get_child();
|
||||||
if(child) {
|
if(child) {
|
||||||
@ -653,7 +673,7 @@ namespace cpptrace {
|
|||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "no child %s\n", name.c_str());
|
fprintf(stderr, "no child %s\n", name.c_str());
|
||||||
}
|
}
|
||||||
frame.symbol = name + "(" + join(params, ", ") + ")";
|
frame.symbol = name + "(" + join(params, ", ") + ")";*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void retrieve_symbol(Dwarf_Debug dbg, const die_object& die, Dwarf_Addr pc, Dwarf_Half dwversion, stacktrace_frame& frame) {
|
void retrieve_symbol(Dwarf_Debug dbg, const die_object& die, Dwarf_Addr pc, Dwarf_Half dwversion, stacktrace_frame& frame) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user