From 1a84e09b959f3946b824002ea111139ca2fcb891 Mon Sep 17 00:00:00 2001 From: Sean LaPlante <1337331+laplante-sean@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:09:55 -0500 Subject: [PATCH 01/16] Modify CI matrix for multi-platform builds Updated CI configuration to remove Windows builds and include Debug build type. --- .github/workflows/cmake-multi-platform.yml | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/cmake-multi-platform.yml diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml new file mode 100644 index 0000000..d1f80ca --- /dev/null +++ b/.github/workflows/cmake-multi-platform.yml @@ -0,0 +1,56 @@ +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +name: CMake on multiple platforms + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + build_type: [Release, Debug] + c_compiler: [gcc, clang] + include: + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-latest + c_compiler: clang + cpp_compiler: clang++ + + steps: + - uses: actions/checkout@v4 + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config ${{ matrix.build_type }} From 9bc4825aa4574f820d552c29f22f01b86c56149c Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Tue, 20 Jan 2026 21:50:11 -0500 Subject: [PATCH 02/16] github actions work --- .github/workflows/ccpp.yml | 58 +++++++++++----------- .github/workflows/cmake-multi-platform.yml | 56 --------------------- .github/workflows/gh-release.yml | 3 +- 3 files changed, 30 insertions(+), 87 deletions(-) delete mode 100644 .github/workflows/cmake-multi-platform.yml diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index ae7bf54..0e372a2 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -7,8 +7,9 @@ on: paths-ignore: ['**.md'] jobs: - Clang_Format: - runs-on: ubuntu-20.04 + # Validate code formatting + quality: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup @@ -27,46 +28,43 @@ jobs: fi shell: bash - Release: - runs-on: ubuntu-20.04 + # Tests all build scenarios + build: + runs-on: ${{ matrix.os }} + + # Test builds for several Ubuntus with both release and debug + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-latest] + build_type: [Release, Debug] + steps: - - uses: actions/checkout@v2 - - name: Setup + - uses: actions/checkout@v4 + + # Install build deps + - name: Install Dependencies run: | sudo apt-get update sudo apt-get install -y cmake libcurl4-gnutls-dev libboost-filesystem-dev ninja-build shell: bash - - name: Validate Release Build + + # Run the build + - name: Validate ${{ matrix.build_type }} Build run: | cd build - cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. - ninja + cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. ninja package shell: bash - - name: Archive debian packages - uses: actions/upload-artifact@v3 - with: - name: libmspdb_release - path: build/*.deb - Debug: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Setup - run: | - sudo apt-get update - sudo apt-get install -y cmake libcurl4-gnutls-dev libboost-filesystem-dev ninja-build - shell: bash - - name: Validate Debug Build + # Test the build + - name: Run tests run: | - cd build - cmake -GNinja -DCMAKE_BUILD_TYPE=Debug .. - ninja - ninja package - shell: bash + echo "TODO! $(pwd)" + + # Upload build .debs - name: Archive debian packages uses: actions/upload-artifact@v3 with: - name: libmspdb_debug + name: libmspdb_${{ matrix.build_type }} path: build/*.deb diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml deleted file mode 100644 index d1f80ca..0000000 --- a/.github/workflows/cmake-multi-platform.yml +++ /dev/null @@ -1,56 +0,0 @@ -# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. -# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml -name: CMake on multiple platforms - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - build_type: [Release, Debug] - c_compiler: [gcc, clang] - include: - - os: ubuntu-latest - c_compiler: gcc - cpp_compiler: g++ - - os: ubuntu-latest - c_compiler: clang - cpp_compiler: clang++ - - steps: - - uses: actions/checkout@v4 - - name: Set reusable strings - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -S ${{ github.workspace }} - - - name: Build - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} - - - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest --build-config ${{ matrix.build_type }} diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index dd39d2c..892163d 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -6,6 +6,7 @@ on: name: Upload Release Asset jobs: + build: name: Upload Release Asset runs-on: ubuntu-20.04 @@ -37,7 +38,7 @@ jobs: draft: false prerelease: false - name: Upload Release Asset - id: upload-release-asset + id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From bed9974e4a57eab794c7d0fc9d48944cca3c7e75 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Tue, 20 Jan 2026 21:52:34 -0500 Subject: [PATCH 03/16] deprecated github action --- .github/workflows/ccpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 0e372a2..0740658 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -11,7 +11,7 @@ jobs: quality: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup run: | sudo apt-get update @@ -64,7 +64,7 @@ jobs: # Upload build .debs - name: Archive debian packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: libmspdb_${{ matrix.build_type }} path: build/*.deb From 36a46e5463dc8d2aa8cd0d64fe860303f71bba91 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Tue, 20 Jan 2026 22:00:56 -0500 Subject: [PATCH 04/16] clang format check fixup --- .github/workflows/ccpp.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 0740658..769e047 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -19,12 +19,14 @@ jobs: shell: bash - name: Validate Source Formatting run: | - find . -name '*.hh' -o -iname '*.cc' | xargs clang-format -i -style=file - if [[ -n $(git diff) ]]; then - echo "You must run make format before submitting a pull request" - echo "" - git diff - exit -1 + mapfile -t source < <(find . -iname "*.cc") + mapfile -t headers < <(find . -iname "*.hh") + code=("${source[@]}" "${headers[@]}") + if ! clang-format -style=file "${code[@]}" -i -Werror --dry-run; then + echo "You must run make format before submitting a pull request" + echo "" + git diff + exit 1 fi shell: bash From 922aa62e8135518d046a95e4d17c77045ea86f68 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Tue, 20 Jan 2026 22:06:56 -0500 Subject: [PATCH 05/16] Getting tests in there too --- .github/workflows/ccpp.yml | 7 ++++++- tests/pdbdump.cc | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 769e047..31733b5 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -62,7 +62,12 @@ jobs: # Test the build - name: Run tests run: | - echo "TODO! $(pwd)" + cd build/tests + ./pdbfetch + ./pdbdump + ./pdbtypes + ./pdbtypetree + ./pdbwrapper # Upload build .debs - name: Archive debian packages diff --git a/tests/pdbdump.cc b/tests/pdbdump.cc index 41d9889..66020e3 100644 --- a/tests/pdbdump.cc +++ b/tests/pdbdump.cc @@ -21,7 +21,7 @@ using namespace mspdb; using namespace std; int main() { - PDB pdb("/home/papes/git/libmspdb/ntkrnlmp.pdb"); + PDB pdb("./pdbstore/win32u.pdb/C0685FE74DEEA4BEC6F9CC52FEAC5D231/win32u.pdb"); cout << "BlockSize: " << pdb.block_size() << '\n'; cout << "NumBlocks: " << pdb.num_blocks() << '\n'; From 153bdf07657676526941c3999d43609f5daecdac Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Tue, 20 Jan 2026 22:12:20 -0500 Subject: [PATCH 06/16] Maybe fix artifact confclit --- .github/workflows/ccpp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 31733b5..1924bae 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -28,6 +28,7 @@ jobs: git diff exit 1 fi + echo "Your source is formatted real good!" shell: bash # Tests all build scenarios @@ -73,5 +74,5 @@ jobs: - name: Archive debian packages uses: actions/upload-artifact@v4 with: - name: libmspdb_${{ matrix.build_type }} + name: libmspdb_${{ matrix.os }}_${{ matrix.build_type }} path: build/*.deb From 282ffbe31c57259faa3258859a2462356b958698 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Tue, 20 Jan 2026 22:52:04 -0500 Subject: [PATCH 07/16] Have the tests use ntdll.pdb --- .github/workflows/ccpp.yml | 2 +- tests/pdbdump.cc | 2 +- tests/pdbfetch.cc | 2 +- tests/pdbtypes.cc | 2 +- tests/pdbtypetree.cc | 2 +- tests/pdbwrapper.cc | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 1924bae..ecedbc6 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-latest] + os: [ubuntu-22.04, ubuntu-24.04, ubuntu-latest] build_type: [Release, Debug] steps: diff --git a/tests/pdbdump.cc b/tests/pdbdump.cc index 66020e3..9490c4d 100644 --- a/tests/pdbdump.cc +++ b/tests/pdbdump.cc @@ -21,7 +21,7 @@ using namespace mspdb; using namespace std; int main() { - PDB pdb("./pdbstore/win32u.pdb/C0685FE74DEEA4BEC6F9CC52FEAC5D231/win32u.pdb"); + PDB pdb("./pdbstore/ntdll.pdb/08A413EE85E91D0377BA33DC3A2641941/ntdll.pdb"); cout << "BlockSize: " << pdb.block_size() << '\n'; cout << "NumBlocks: " << pdb.num_blocks() << '\n'; diff --git a/tests/pdbfetch.cc b/tests/pdbfetch.cc index 148b96b..be17bc3 100644 --- a/tests/pdbfetch.cc +++ b/tests/pdbfetch.cc @@ -21,5 +21,5 @@ using namespace mspdb; int main() { PDBStore store("./pdbstore/"); - auto pdb = store.open_pdb("win32u.pdb", "C0685FE74DEEA4BEC6F9CC52FEAC5D231"); + auto pdb = store.open_pdb("ntdll.pdb", "08A413EE85E91D0377BA33DC3A2641941"); } \ No newline at end of file diff --git a/tests/pdbtypes.cc b/tests/pdbtypes.cc index da566e4..ec6b194 100644 --- a/tests/pdbtypes.cc +++ b/tests/pdbtypes.cc @@ -291,7 +291,7 @@ void TypeContainer::write_member(const LF_MEMBER& lfMember) const { } int main() { - PDB pdb("/home/papes/git/libmspdb/ntkrnlmp.pdb"); + PDB pdb("./pdbstore/ntdll.pdb/08A413EE85E91D0377BA33DC3A2641941/ntdll.pdb"); const auto& tpi = pdb.stream_directory().type_info_stream(); for (const LF_STRUCTURE& lfStruct : tpi.structs()) { diff --git a/tests/pdbtypetree.cc b/tests/pdbtypetree.cc index 61484d4..602fd1c 100644 --- a/tests/pdbtypetree.cc +++ b/tests/pdbtypetree.cc @@ -98,7 +98,7 @@ void recurse(const LF_TYPE& type, const std::string& prefix = "") { } int main() { - PDB pdb("/home/papes/git/libmspdb/ntkrnlmp.pdb"); + PDB pdb("./pdbstore/ntdll.pdb/08A413EE85E91D0377BA33DC3A2641941/ntdll.pdb"); const auto& tpi = pdb.stream_directory().type_info_stream(); for (const LF_CLASS& entry : tpi.classes()) { diff --git a/tests/pdbwrapper.cc b/tests/pdbwrapper.cc index 108480c..9b35cd5 100644 --- a/tests/pdbwrapper.cc +++ b/tests/pdbwrapper.cc @@ -66,7 +66,7 @@ void write_wrapper(const T& lfStruct) { } int main() { - PDB pdb("/Users/papes/git/libmspdb/ntkrnlmp.pdb"); + PDB pdb("./pdbstore/ntdll.pdb/08A413EE85E91D0377BA33DC3A2641941/ntdll.pdb"); const auto& tpi = pdb.stream_directory().type_info_stream(); for (const LF_STRUCTURE& lfStruct : tpi.structs()) { From 8f891f8a605ea7256d5a5f08c6287e34a742257b Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Tue, 20 Jan 2026 23:01:12 -0500 Subject: [PATCH 08/16] The tests produce too much output. Just care about errors anyway --- .github/workflows/ccpp.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index ecedbc6..bd044c3 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -64,11 +64,11 @@ jobs: - name: Run tests run: | cd build/tests - ./pdbfetch - ./pdbdump - ./pdbtypes - ./pdbtypetree - ./pdbwrapper + ./pdbfetch > /dev/null + ./pdbdump > /dev/null + ./pdbtypes > /dev/null + ./pdbtypetree > /dev/null + ./pdbwrapper > /dev/null # Upload build .debs - name: Archive debian packages From d55bc8348ccda1bc35ce2ac2250c446eb55afe43 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Fri, 23 Jan 2026 11:47:56 -0500 Subject: [PATCH 09/16] Fixed inifinite recursion in pdbtypetree test --- tests/pdbtypetree.cc | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/tests/pdbtypetree.cc b/tests/pdbtypetree.cc index 602fd1c..74de9e2 100644 --- a/tests/pdbtypetree.cc +++ b/tests/pdbtypetree.cc @@ -20,39 +20,73 @@ #include #include #include +#include using namespace mspdb; +static std::vector type_stack; + void recurse(const LF_TYPE& type, const std::string& prefix = "") { + if (std::find(type_stack.begin(), type_stack.end(), &type) == type_stack.end()) { + type_stack.push_back(&type); + } else { + std::cout << to_string(type.type()) <<"(stopping here - infinite recursive type)\n"; + return; + } std::cout << to_string(type.type()); switch (type.type()) { case LEAF_TYPE::LF_ARRAY: std::cout << "->"; recurse(static_cast(type).element_type(), prefix); + type_stack.pop_back(); return; case LEAF_TYPE::LF_BITFIELD: std::cout << "->"; recurse(static_cast(type).base_type(), prefix); + type_stack.pop_back(); return; case LEAF_TYPE::LF_MEMBER: std::cout << "->"; recurse(static_cast(type).index(), prefix); + type_stack.pop_back(); return; case LEAF_TYPE::LF_MODIFIER: { const auto& lfModifier = static_cast(type); std::cout << std::hex; std::cout << "(0x" << lfModifier.modifiers() << ")->"; std::cout << std::dec; - recurse(lfModifier.modified_type(), prefix); + + const auto& lfType = lfModifier.modified_type(); + if (std::find(type_stack.begin(), type_stack.end(), &lfType) == type_stack.end()) { + type_stack.push_back(&lfType); + } else { + std::cout << to_string(type.type()) <<"(stopping here - infinite recursive modifier)\n"; + return; + } + + recurse(lfType, prefix); + type_stack.pop_back(); return; } case LEAF_TYPE::LF_POINTER: { const auto& lfPointer = static_cast(type); + std::cout << std::hex; std::cout << "(0x" << lfPointer.size() << ")->"; std::cout << std::dec; - recurse(lfPointer.underlying_type(), prefix); + + // Get the type we're pointing at and make sure we're not about + // to recurse forever + const auto& lfType = lfPointer.underlying_type(); + if (std::find(type_stack.begin(), type_stack.end(), &lfType) == type_stack.end()) { + type_stack.push_back(&lfType); + } else { + std::cout << to_string(type.type()) <<"(stopping here - infinite recursive pointer)\n"; + return; + } + recurse(lfType, prefix); + type_stack.pop_back(); return; } case LEAF_TYPE::LF_PROCEDURE: { @@ -62,6 +96,7 @@ void recurse(const LF_TYPE& type, const std::string& prefix = "") { for (const LF_TYPE& member : lfProc.arg_list()) { std::cout << new_prefix; recurse(member, new_prefix); + type_stack.pop_back(); } return; } @@ -74,6 +109,7 @@ void recurse(const LF_TYPE& type, const std::string& prefix = "") { for (const LF_MEMBER& member : lfStruct.field_list()) { std::cout << new_prefix; recurse(member, new_prefix); + type_stack.pop_back(); } } return; @@ -86,6 +122,7 @@ void recurse(const LF_TYPE& type, const std::string& prefix = "") { for (const LF_MEMBER& member : lfStruct.field_list()) { std::cout << new_prefix; recurse(member, new_prefix); + type_stack.pop_back(); } } return; @@ -107,7 +144,6 @@ int main() { for (const LF_STRUCTURE& entry : tpi.structs()) { recurse(entry); } - for (const LF_UNION& entry : tpi.unions()) { recurse(entry); } From cbab33c7aca93a56e5c73cc8ce7b8c694d5e11c9 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Fri, 23 Jan 2026 12:41:52 -0500 Subject: [PATCH 10/16] clang-format --- tests/pdbtypetree.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pdbtypetree.cc b/tests/pdbtypetree.cc index 74de9e2..973e72d 100644 --- a/tests/pdbtypetree.cc +++ b/tests/pdbtypetree.cc @@ -24,6 +24,8 @@ using namespace mspdb; +// Used to prevent infinity. If the thing we're about to recurse into is already +// in the stack of things we're recursed into, then we don't want to do that. static std::vector type_stack; void recurse(const LF_TYPE& type, const std::string& prefix = "") { @@ -76,8 +78,6 @@ void recurse(const LF_TYPE& type, const std::string& prefix = "") { std::cout << "(0x" << lfPointer.size() << ")->"; std::cout << std::dec; - // Get the type we're pointing at and make sure we're not about - // to recurse forever const auto& lfType = lfPointer.underlying_type(); if (std::find(type_stack.begin(), type_stack.end(), &lfType) == type_stack.end()) { type_stack.push_back(&lfType); From f9a18e039cb9982eba0c98b70b23fd39bb65a1e7 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Fri, 23 Jan 2026 12:52:15 -0500 Subject: [PATCH 11/16] Fix make format to format tests. Clang-format fixes for pdbtypetree --- CMakeLists.txt | 2 +- tests/pdbtypetree.cc | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e15e3cf..19ebb97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ ADD_SUBDIRECTORY(tests) # Format target ADD_CUSTOM_TARGET( format - COMMAND find ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/include -name '*.hh' -o -iname '*.cc' | xargs clang-format -i -style=file + COMMAND find ${PROJECT_SOURCE_DIR}/tests ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/include -name '*.hh' -o -iname '*.cc' | xargs clang-format -i -style=file ) # Install rule for include headers diff --git a/tests/pdbtypetree.cc b/tests/pdbtypetree.cc index 973e72d..66f88da 100644 --- a/tests/pdbtypetree.cc +++ b/tests/pdbtypetree.cc @@ -32,7 +32,7 @@ void recurse(const LF_TYPE& type, const std::string& prefix = "") { if (std::find(type_stack.begin(), type_stack.end(), &type) == type_stack.end()) { type_stack.push_back(&type); } else { - std::cout << to_string(type.type()) <<"(stopping here - infinite recursive type)\n"; + std::cout << to_string(type.type()) << "(stopping here - infinite recursive type)\n"; return; } std::cout << to_string(type.type()); @@ -63,7 +63,8 @@ void recurse(const LF_TYPE& type, const std::string& prefix = "") { if (std::find(type_stack.begin(), type_stack.end(), &lfType) == type_stack.end()) { type_stack.push_back(&lfType); } else { - std::cout << to_string(type.type()) <<"(stopping here - infinite recursive modifier)\n"; + std::cout << to_string(type.type()) + << "(stopping here - infinite recursive modifier)\n"; return; } @@ -82,7 +83,7 @@ void recurse(const LF_TYPE& type, const std::string& prefix = "") { if (std::find(type_stack.begin(), type_stack.end(), &lfType) == type_stack.end()) { type_stack.push_back(&lfType); } else { - std::cout << to_string(type.type()) <<"(stopping here - infinite recursive pointer)\n"; + std::cout << to_string(type.type()) << "(stopping here - infinite recursive pointer)\n"; return; } recurse(lfType, prefix); From 89659805df82db88c7da5e4e162d317fae98001b Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Fri, 23 Jan 2026 13:02:27 -0500 Subject: [PATCH 12/16] handle pdb_exception on get_type in pdbwrapper.cc and add handling for LF_UNION --- tests/pdbwrapper.cc | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/pdbwrapper.cc b/tests/pdbwrapper.cc index 9b35cd5..f1b926f 100644 --- a/tests/pdbwrapper.cc +++ b/tests/pdbwrapper.cc @@ -40,6 +40,8 @@ std::string get_type(const LF_TYPE& lfType) { return get_type(static_cast(lfType).base_type()); case LEAF_TYPE::LF_ARRAY: return get_type(static_cast(lfType).element_type()); + case LEAF_TYPE::LF_UNION: + return static_cast(lfType).name(); default: throw pdb_exception("Unhandled type: " + to_string(lfType.type())); } @@ -51,15 +53,20 @@ void write_wrapper(const T& lfStruct) { std::cout << "public:\n"; for (const LF_MEMBER& member : lfStruct.field_list()) { - std::cout << " virtual " << get_type(member.index()) << " " << member.name() << "() {\n"; - std::cout << std::hex; - switch (member.index().type()) { - default: - std::cout << " return *reinterpret_cast(buffer + 0x" << member.offset() << ");\n"; + try { + auto type = get_type(member.index()); // May throw + std::cout << " virtual " << type << " " << member.name() << "() {\n"; + std::cout << std::hex; + switch (member.index().type()) { + default: + std::cout << " return *reinterpret_cast(buffer + 0x" + << member.offset() << ");\n"; + } + std::cout << std::dec; + std::cout << " };\n"; + } catch (const pdb_exception& e) { + std::cerr << "Skipping member " << member.name() << ": " << e.what() << "\n"; } - std::cout << std::dec; - std::cout << " };\n"; } std::cout << "};\n"; From 92113bf4e259d511bffcbe79c2960219143cc0d2 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Fri, 23 Jan 2026 13:07:07 -0500 Subject: [PATCH 13/16] Added 20.04 and 26.04 --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index bd044c3..5b87a3d 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, ubuntu-24.04, ubuntu-latest] + os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-26.04] build_type: [Release, Debug] steps: From 492ee3a96732808aa276278c2cbb38c97a99a703 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Fri, 23 Jan 2026 13:38:58 -0500 Subject: [PATCH 14/16] some more minor changes. Removed 20.04 and 26.04 which don't have runners yet --- .github/workflows/ccpp.yml | 2 +- .github/workflows/gh-release.yml | 73 ++++++++++++++++++++------------ 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 5b87a3d..639303b 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, ubuntu-26.04] + os: [ubuntu-22.04, ubuntu-24.04] build_type: [Release, Debug] steps: diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index 892163d..7a81efa 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -1,49 +1,68 @@ +name: Create Release + on: push: tags: - 'v*' -name: Upload Release Asset - jobs: - + # Build and publish release assets build: - name: Upload Release Asset - runs-on: ubuntu-20.04 + runs-on: ${{ matrix.os }} + + # Build releases for supported Ubuntu versions + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, ubuntu-24.04] + steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Setup + - uses: actions/checkout@v4 + + # Install build deps + - name: Install Dependencies run: | sudo apt-get update sudo apt-get install -y cmake libcurl4-gnutls-dev libboost-filesystem-dev ninja-build shell: bash - - name: Build Release + + # Run the build + - name: ${{ matrix.os }} Build Release run: | cd build cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. - ninja ninja package - zip --verbose --junk-paths libmspdb.zip ./*.deb - ls -la libmspdb.zip shell: bash - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Upload build .debs + - name: Archive debian release packages + uses: actions/upload-artifact@v4 + with: + name: libmspdb_${{ matrix.os }}_Release + path: build/*.deb + + # Create the release + release: + needs: build + runs-on: ubuntu-latest + steps: + # Download the built debs from the build job + - name: Download Release Artifacts + uses: actions/download-artifact@v4 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false + path: all-debs + pattern: libmspdb_*_Release + merge-multiple: true + + # Create and upload the debs to a new release - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/libmspdb.zip - asset_name: libmspdb.zip - asset_content_type: application/zip + run: | + la -alh ./all-debs + gh release create ${{ github.ref_name }} \ + --title "Release ${{ github.ref_name }}" \ + --draft \ + ./all-debs/*.deb + shell: bash \ No newline at end of file From f4a92be6baf16ca770ac309778e8b73c64b041ca Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Fri, 23 Jan 2026 13:41:02 -0500 Subject: [PATCH 15/16] Only run one build on PRs to main --- .github/workflows/ccpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 639303b..d1fa9d4 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -1,10 +1,10 @@ name: CI Tests on: - push: - paths-ignore: ['**.md'] pull_request: paths-ignore: ['**.md'] + branches: + - main jobs: # Validate code formatting From 4aadf214bb02e5b586f89aa52ea7aa1e3a7eb104 Mon Sep 17 00:00:00 2001 From: Sean LaPlante Date: Fri, 23 Jan 2026 13:43:00 -0500 Subject: [PATCH 16/16] Rename GH yml files --- .github/workflows/{ccpp.yml => ci.yml} | 0 .github/workflows/{gh-release.yml => release.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ccpp.yml => ci.yml} (100%) rename .github/workflows/{gh-release.yml => release.yml} (100%) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ccpp.yml rename to .github/workflows/ci.yml diff --git a/.github/workflows/gh-release.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/gh-release.yml rename to .github/workflows/release.yml