Skip to content

Commit 1b31c8d

Browse files
committed
added breakpoint
1 parent d7b3732 commit 1b31c8d

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@
5252
[submodule "include/err/include/ut/err"]
5353
path = include/err/include/ut/err
5454
url = https://gist.github.com/dk949/7ab26f6405813e246528994e0f560fba
55+
[submodule "include/breakpoint/include/ut/breakpoint"]
56+
path = include/breakpoint/include/ut/breakpoint
57+
url = https://gist.github.com/dk949/e36f1a7ecc9a8aff296ee6e76a06ba68

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ target_link_libraries(MY_TARGET UT::target_name)
5757
* `UT::pack_loops`: loop over variadic template parameters (either values or types)
5858
* `UT::asis`: Provides a more convenient way to work with different kinds of dynamically polymorphic values.
5959
* `UT::static_string`: compile time known string usable as a template parameter
60+
* `UT::breakpoint`: Portable(ish) breakpoint macros
6061
* `UT::mt_queue`: thread safe FIFO queue
6162
* `UT::curry`: create a curried function out of a regular function
6263
* `UT::defer`: a macro to defer execution until the scope ends

include/breakpoint/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cmake_minimum_required(VERSION 3.21)
2+
project(libut LANGUAGES CXX)
3+
4+
add_library(libut_target_breakpoint INTERFACE)
5+
target_sources(libut_target_breakpoint PUBLIC
6+
FILE_SET HEADERS
7+
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include
8+
FILES
9+
${CMAKE_CURRENT_SOURCE_DIR}/include/ut/breakpoint/breakpoint.hpp
10+
)
11+
12+
message(STATUS "libut: adding UT::breakpoint")
13+
add_library(UT::breakpoint ALIAS libut_target_breakpoint)
14+
Submodule breakpoint added at de9250e

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set(cxx_17_files
99
${CMAKE_CURRENT_SOURCE_DIR}/constexpr_hash.cpp
1010
${CMAKE_CURRENT_SOURCE_DIR}/defer.cpp
1111
${CMAKE_CURRENT_SOURCE_DIR}/pack_loops.cpp
12+
${CMAKE_CURRENT_SOURCE_DIR}/breakpoint.cpp
1213
)
1314
set(cxx_20_files
1415
${cxx_17_files}

tests/breakpoint.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <ut/breakpoint/breakpoint.hpp>
2+
3+
[[maybe_unused]]
4+
void dummy() {
5+
// Don't really know how to test this (maybe signal handler?)
6+
// This is just a test that this compiles
7+
UT_BREAKPOINT();
8+
}

0 commit comments

Comments
 (0)