User:Callahanp

From FlightGear wiki
Jump to navigation Jump to search

This Week

11-Aug-2024 - 17-Aug-2024

19-Aug-2024 -

  • Build & run test_suite/unit_tests/Network/test_httpd.cxx

Reading List:

Start With


Reading Lists

Overviews

Topic Overview Options Progress Notes
vcpkg https://learn.microsoft.com/en-us/vcpkg/
apt https://wiki.debian.org/Apt
cmake https://cmake.org/getting-started/
g++ https://www.gnu.org/software/gcc/
gdb https://www.sourceware.org/gdb/
llvm https://llvm.org
clang https://clang.llvm.org/
lldb https://lldb.llvm.org/
valgrind https://valgrind.org/
lcov https://github.com/linux-test-project/lcov -DENABLE_COVERAGE=1

if (ENABLE_COVERAGE)

 set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
   "set the build type." FORCE)
 include(CodeCoverage.cmake)
 append_coverage_compiler_flags()

endif()

add_executable target_link_libraries( a.exe test_a.cpp CPPUnit::CPPUnit

if (ENABLE_COVERAGE)
  setup_target_for_coverage_lcov(
     NAME coverage
     EXECUTABLE ${cmake_current_binarey_dir}/test_a
     LCOV_ARGS --rc lcov_branch_coverage=1
     GENHTML_ARGS --legend --branch-coveragbe
     DEPENDENCIES test_a)
sanitizers https://github.com/google/sanitizers

https://www.cl.cam.ac.uk/~nk480/C1819/lecture5.pdf

asan https://github.com/google/sanitizers/wiki/AddressSanitizer gdb & clang:

CMAKE_CXX_FLAGS -fsanitize=address CMAKE_EXE_LINKER_FLAGS -fsanitize=address

msan https://github.com/google/sanitizers/wiki/MemorySanitizer
tsan https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
ubsan https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html gdb & clang:

CMAKE_CXX_FLAGS -fsanitize=undefined CMAKE_EXE_LINKER_FLAGS -fsanitize=undefined


Start With


Reading Lists

Overviews

Topic Overview Options Progress Notes
vcpkg https://learn.microsoft.com/en-us/vcpkg/
apt https://wiki.debian.org/Apt
cmake https://cmake.org/getting-started/
g++ https://www.gnu.org/software/gcc/
gdb https://www.sourceware.org/gdb/
llvm https://llvm.org
clang https://clang.llvm.org/
lldb https://lldb.llvm.org/
valgrind https://valgrind.org/
sanitizers https://github.com/google/sanitizers

https://www.cl.cam.ac.uk/~nk480/C1819/lecture5.pdf

asan https://github.com/google/sanitizers/wiki/AddressSanitizer
msan https://github.com/google/sanitizers/wiki/MemorySanitizer
tsan https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
ubsan https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

Start With


Reading Lists

Overviews

Topic Overview Options Progress Notes
vcpkg https://learn.microsoft.com/en-us/vcpkg/
apt https://wiki.debian.org/Apt
cmake https://cmake.org/getting-started/
g++ https://www.gnu.org/software/gcc/
gdb https://www.sourceware.org/gdb/
llvm https://llvm.org
clang https://clang.llvm.org/
lldb https://lldb.llvm.org/
valgrind https://valgrind.org/
sanitizers https://github.com/google/sanitizers

https://www.cl.cam.ac.uk/~nk480/C1819/lecture5.pdf

asan https://github.com/google/sanitizers/wiki/AddressSanitizer
msan https://github.com/google/sanitizers/wiki/MemorySanitizer
tsan https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
ubsan https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

Integration

Topic Download_and_compile.sh dev1
vcpkg
apt
cmake
g++
gdb
llvm
clang
lldb
valgrind
sanitizers
asan
msan
tsan
ubsan

Follow-on Questions

  • Does g++ support each of these sanitizers?
  • What other tools should I research besides gdb, lldb, valgrind, UBSAN, ASAN, TSAN, and MSAN?
  • Are there tools other than sanitizers and debuggers I should know about?
  • Are there obsolete tools I should ignore?
  • Are there books that cover C++ topics beyond writing C++? How about how-to guides? (I'll be searching for these next, but do you happen to know any particularly useful and easy to read?
  • Crash dumps and crash dump tools. I don't know much about them. What good resources on this topic are there for Linux, Windows, and Mac?



Background

I'm about to start going through the list above for myself. It may take a while.

I'm currently involved in a project with about half a million existing lines of C++ code and want to know what tools I need to work in this environment properly. The application has multi-threaded parts.

I can do basic g++, Debug, DebWithRelInfo, and Release builds using cmake or a pre-defined build script and step through code line-by-line with the gdb in VSCode, but want to become familiar with gdb at the command line.

I want to come up to speed with clang and lldb in vscode.

https://stackoverflow.com/questions/63978029/setup-lldb-debugging-with-cpp-extension-in-vscode-linux

Other Thoughts

I need to familiarize myself with other tools available, learn how to enable particular tools in a build, and learn how to use the tool's output.

I want to learn to use tools like UBSAN, ASAN, TSAN, and MSAN effectively and how to switch from g++ to clang when appropriate. I want to learn what tools other than the sanitizers and debuggers above are available.

There's no such thing as free beer! Someone pays for flightgear cloud infrastructure that I personallly benefit from. So I contribute a little at:

https://liberapay.com/t3r

Currently working on:

Git Worktrees with download_and_compile.sh (done & working)

Web Socket Refactor & Fix.

OSM (Open Street Map) Scenery Build (on hold)

Goals (Maybe)

  • Download Scenery from Current Scenery Developers
  • Build Scripts for Scenery Land Class, Elevation, and OSM processing
  • Understand the underlying formats in Flightgear Scenery
  • Understand the processing of Scenery data between tiles in the build process and the running simulator
  • Assist Scenery Developers with technical support.
  • full explanation of the advantages and disadvantages of the worktree approach.

Hackathon-2023-Proposal-Websocket-Property-Subscription-Improvements