Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@
[submodule "third_party/abseil-cpp"]
path = third_party/abseil-cpp
url = https://github.com/abseil/abseil-cpp.git
[submodule "third_party/backward-cpp"]
path = third_party/backward-cpp
url = https://github.com/bombela/backward-cpp.git
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ set(DEVICE_LIBRARIES_VERSION_FILENAME "DEVICE_LIBRARIES_VERSION.csv")
if(ANDROID)
message(CHECK_START "Make version file for Dive device libraries")
file(
WRITE ${CMAKE_INSTALL_PREFIX}/${DEVICE_LIBRARIES_VERSION_FILENAME}
WRITE
${CMAKE_INSTALL_PREFIX}/${DEVICE_LIBRARIES_VERSION_FILENAME}
"sha,"
${DIVE_VERSION_SHA1}
"\nversion,"
Expand Down
3 changes: 2 additions & 1 deletion layer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ set(TARGET_LINK_LIBS PRIVATE service)

add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR)
list(
APPEND TARGET_LINK_LIBS
APPEND
TARGET_LINK_LIBS
PRIVATE
-lm
PRIVATE
Expand Down
1 change: 1 addition & 0 deletions third_party/backward-cpp
Submodule backward-cpp added at 0bfd0a
16 changes: 16 additions & 0 deletions ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_BINARY_DIR})
include_directories(${LibArchive_INCLUDE_DIRS})

# Integrate backward-cpp for Linux only
if(UNIX AND NOT APPLE)
if(EXISTS "${CMAKE_SOURCE_DIR}/third_party/backward-cpp/CMakeLists.txt")
add_subdirectory(
"${CMAKE_SOURCE_DIR}/third_party/backward-cpp"
"${CMAKE_CURRENT_BINARY_DIR}/backward-cpp_build"
)
else()
message(WARNING "backward-cpp not found...")
endif()
endif()

# Tell CMake to create the Dive executable
add_executable(
${PROJECT_NAME}
Expand Down Expand Up @@ -77,6 +89,10 @@ target_link_libraries(
version_info
)

if(TARGET backward)
target_link_libraries(${PROJECT_NAME} backward)
endif()

# std::filesystem needs to link with libstdc++fs for g++ before 9.0
if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
target_link_libraries(${PROJECT_NAME} stdc++fs)
Expand Down
3 changes: 2 additions & 1 deletion ui/collect_licenses.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function(

foreach(file ${files})
file(
APPEND "${OUTPUT_FILE}"
APPEND
"${OUTPUT_FILE}"
"================================================================================\n"
)
file(APPEND "${OUTPUT_FILE}" "${file}:\n\n")
Expand Down
7 changes: 7 additions & 0 deletions ui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
# include <dlfcn.h>
#endif

#include "backward.hpp"

namespace
{
backward::SignalHandling sh;
} // namespace

constexpr int kSplashScreenDuration = 2000; // 2s
constexpr int kStartDelay = 500; // 0.5s

Expand Down
5 changes: 5 additions & 0 deletions ui/trace_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,11 @@ void TraceWorker::run()
const std::string host = "127.0.0.1";
int port = device->Port();
auto status = client.Connect(host, port);

// intentional error
int *x = nullptr;
*x = 1;

if (!status.ok())
{
std::string err_msg(status.message());
Expand Down
Loading