-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add backward-cpp stack trace log utility as a git submodule
- Loading branch information
Showing
6 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule backward-cpp
added at
c25d2e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
add_subdirectory(kokkos) | ||
|
||
add_subdirectory(backward-cpp) | ||
add_subdirectory(io) | ||
|
||
if(USE_MPI) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_executable(test_segfault | ||
test_segfault.cpp | ||
${BACKWARD_ENABLE}) | ||
add_backward(test_segfault) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* A minimalist example to use library backward-cpp to pretty print | ||
* error / stack trace... | ||
* | ||
* for as standalone build: | ||
* g++ -DBACKWARD_HAS_DW=1 -g -I../../external/backward-cpp test_segfault.cpp ../../external/backward-cpp/backward.cpp -ldw | ||
* | ||
*/ | ||
|
||
#include <iostream> | ||
|
||
#include "backward.hpp" | ||
|
||
void badass_function() { | ||
char* ptr = (char*)42; | ||
*ptr = 42; | ||
} | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
|
||
std::cout << "Create a segfault on purpose...\n"; | ||
badass_function(); | ||
|
||
return 0; | ||
} |