User:Callahanp: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
 
(56 intermediate revisions by 3 users not shown)
Line 1: Line 1:
I am a flight simulation hobbyist currently working on building instruments, gauges, radios and controls for a C172.


== What I'm doing: ==
==Start With==
===[http://wiki.flightgear.org/User:Callahanp/FlightgearWorkingGroups Flightgear Working Groups]===


==== [[https://github.com/c172p-team/c172p C172P Team on Github ]] ====
*[[/cmake.org/getting-started/|https://cmake.org/getting-started/]] -- Build using g++ and clang.
*[[/learn.microsoft.com/en-us/vcpkg/|https://learn.microsoft.com/en-us/vcpkg/]] -- cross-platform C/C++ package manager
*[[https://www.jenkins.io/ -- Automation Server
*[[/www.sourceware.org/gdb/|https://www.sourceware.org/gdb/]] or [[/lldb.llvm.org/|https://lldb.llvm.org/]] -- Debuggers
*[[/github.com/google/sanitizers|https://github.com/google/sanitizers]] -- Read about each of the available sanitizers
*[[/valgrind.org/docs/manual/quick-start.html|https://valgrind.org/docs/manual/quick-start.html]] -- A suite of debugging and profiling tools
*A review of all the options for each tool you want to acquire.


Proposed:


* Subsystem Management Group
== Reading Lists ==
* Property Tree Dwellers
* Vulcanologists
* Plib Janitors
* FDM Dev
* Flightgear Dev Onboarding
* Flightgear Dev Scenery
* Flightgear Dev Core
* Flightgear Dev Aircraft
* Flightgear Dev Airports
* Cockpit Builders


===[http://wiki.flightgear.org/User:Callahanp/Flightgear_and_Simgear_Code Flightgear and Simgear Code]===
=== Overviews ===


Several years ago I began the effort to fully understand the skills needed to contribute to the Flightgear project's codebaseI started to look through various parts of the Flightgear code-base to understand how the parts fit together and how supporting libraries are used in the project.  
{| class="wikitable"
! 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()


This is an ongoing effort hampered by lack of time, my obsolete C++ training obtained in the early 1990's.
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)
|-


==== Tools ====
| 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
|}


[[User:Callahanp/Flightgear_and_Simgear_Code/Tools_for_a_Flightgear_Developer|Tools for a Flightgear Developer]] (see also [[Tools of the Trade]])


==== From Command Line to Holding Short ====
==Start With==


[[User:Callahanp/Flightgear_and_Simgear_Code/From_Command_Line_to_Holding_Short|From Command Line to Holding Short]]. A look at what gets called when you start Flightgear from the command line until you are on the runway. This is a work in progress, somewhat stalled after Eduard Auvergne's initial work on subsystems. It needs a re-vamp to make it current and publishable.
*[[/cmake.org/getting-started/|https://cmake.org/getting-started/]] -- Build using g++ and clang.
*[[/learn.microsoft.com/en-us/vcpkg/|https://learn.microsoft.com/en-us/vcpkg/]] -- cross-platform C/C++ package manager
*[[/www.sourceware.org/gdb/|https://www.sourceware.org/gdb/]] or [[/lldb.llvm.org/|https://lldb.llvm.org/]] -- Debuggers
*[[/github.com/google/sanitizers|https://github.com/google/sanitizers]] -- Read about each of the available sanitizers
*[[/valgrind.org/docs/manual/quick-start.html|https://valgrind.org/docs/manual/quick-start.html]] -- A suite of debugging and profiling tools
*A review of all the options for each tool you want to acquire.


==== Flightgear Application Outline ====


I'm trying to come up with an outline of Flightgear's structure as an application.  
== Reading Lists ==


[http://wiki.flightgear.org/User:Callahanp/Flightgear_Technical_Manual| Flightgear Technical Manual]
=== Overviews ===


First Steps:  
{| class="wikitable"
! 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 ||
|}


===== RTFM =====
==Start With==
* http://wiki.flightgear.org/FlightGear_Manual
* fgdata/doc/img Look at each image in, noting the name of the image and what the image is trying to say
* fgdata/doc/keyboard/map.pdf  Note that key bindings can be specific to an aircraft. Note that the pdf was produced from a .tex file.
* fgdata/Docs/model-combined.eff/README.model-combined.eff  Read and not What's "rembrandt" - Key terms can be pulled from this document
* fgdata/Serial/nmeafaq.txt  Garmin -    Key terms can be pulled from this document.  This document describes a data protocol
* AI_doc.html 
* FGShortRef.html
* http://flightgear.org/Docs/FlightGear-FAQ.html
* fgdata/Docs/fschool_0.0.3.pdf
* fgdata/Docs/index.html
* fgdata/Docs/model-howto.html
* and lots of others  - point is you have to read them all


Once they're read, is there a way to organize them so the result is an overview?
*[[/cmake.org/getting-started/|https://cmake.org/getting-started/]] -- Build using g++ and clang.
*[[/learn.microsoft.com/en-us/vcpkg/|https://learn.microsoft.com/en-us/vcpkg/]] -- cross-platform C/C++ package manager
*[[/www.sourceware.org/gdb/|https://www.sourceware.org/gdb/]] or [[/lldb.llvm.org/|https://lldb.llvm.org/]] -- Debuggers
*[[/github.com/google/sanitizers|https://github.com/google/sanitizers]] -- Read about each of the available sanitizers
*[[/valgrind.org/docs/manual/quick-start.html|https://valgrind.org/docs/manual/quick-start.html]] -- A suite of debugging and profiling tools
*A review of all the options for each tool you want to acquire.


Sure there is. Just write a book: working title: [Flightgear_Technical_Manual|Flightgear Technical Manual]


=====It's Data Driven - So Where's the data? =====
== Reading Lists ==


I've realized that much of the application is data driven, and that data is found in various places. These include files in one or another imaging format .ac files and configuration files of various types including xml files.  Each of these references will involve a path of some kind creating a relationship between material in one file with material in another.  There are path like structures to be found in data structures constructed within the application itself. This happens most notably in the property tree, but also in other independent data structures such as the  structure controlling subsystem initialization, ongoing processing, removal and re-initiialzation. 
=== Overviews ===
To uncover some of these relationships and to locate and characterize the various processes involved, a close look at similar code fragments in a large number of files will enable you to uncover patterns that might otherwise elude you.
The basic technique will be o use an editor such as Atom, capable of doing a recursive global search through a set of files using a series of regular expressions.  Using regular expressions allows us to go from a more general search to one that is more specific.  All the following examples use atom's find in project - regex - case insensitive search.


{| class="wikitable"
! 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 ===


The code fragments to search for To get a list of 
{| class="wikitable"
the include= vs <path> dichotomy is a distinction I'd like to investigate and describe further and the handlers for each of these "types" 
! Topic !! Download_and_compile.sh !! dev1
I thought it might be worth going down the rabbit hole to explore a bit. 
|-
 
| vcpkg ||  ||
Keep in mind I'm looking for important concepts that I don't yet have in my outline.  The key to finding them is recognizing the variety of tags found in xml files.  For the moment, I'm looking for tags and other structural identifiers that refer to materials in other files.  
|-
 
| apt || ||
I'm also adding other concepts driven by data from xml files such as  animation, interpolation and the various types of tags with xml files found in the files for the C172p such as checklists, tutorials, instrument and signals.  examples of these are easy to find in an editor capable of text searching an entire project:
|-
 
| cmake || ||
Try the following in atom and you'll see what I mean 
|-
 
| g++ ||  ||
  cd next/install 
|-
atom . 
| gdb || ||
 
|-
Use the atom FindInProject->Find All with any of the following. Be sure to click on the regex button for the search
| llvm ||  ||
 
|-
* include=
| clang || ||
* <path>
|-
* <path>.*\.xml
| lldb ||  ||
* <path>.*\.png
|-
* <path>.*\.ac
| valgrind ||  ||
 
|-
etc.
| sanitizers || ||
|-
| asan ||  ||
|-
| msan ||  ||
|-
| tsan || ||
|-
| ubsan || ||
   
   
Scanning the results of the search for include= reveals that they're all found in fgdata. 
|}
 
* All include references to .xml files and the references themselves are found in xml files.
* There are 2117 of them in 1274 files.
* AI/Aircraft alone contains about 75% of the includes.  These are for individual liveries.
* Aircraft/c172p gives you a preview of the kind of xml strucures you'll find in any aircraft.  
* Aircraft/Generic contains about 5% of the includes. They include items for specific instruments, the walker, a logo,  
* ATC  contains a few files with xml includes related to ATIS.Compositor contains several xml includes. This one is likely to be important. 
* defaults.xml is likely to be a high level module and therefore important 
* Docs contains a number of README.xxxxx files, likely to be informative. Some have xml includes referenced in them. As I've mentioned, you should read every single one.
* Instruments contains about 5% of the includes. They include items for specific instruments, the walker, a logo,  
* Environment has two files one with filter tags related to xml files describing clouds and the other with tags for cloudLayers and volcanos. 
* Input has xml related to joysticks.  there's also a top level file  fgdata/joystics.xml 
* Materials makes up the remaining 15% of xml. it includes xml data related to runway textures and effects, buildings, geographic region textures and groups of objects.  
 
Scanning for <path> reveals a similar pattern, but <path> is used for more than just .xml files.
 
The total of 5067 <path> instances in 1745 files breaks down this way:
* .ac files with 1868 instances of <path> in  1509 files
* .rgb files with 798 in 108 files.
* .png files with 55 in 14 files
* .jpg 19 in 6 files
* .wav 113 in 9 files 
* .xsl 2 in 1 file 
* .http or .html 3 in 3 files
* .xml  with 2138 in 279 files 
 
The xml paths have a similar distribution pattern to the include= xml references, but further investigation is needed to discern how they are different.
 
Finally, <path> appears in Comments in 6 files, and is mentioned in 6 readme files.
 
<path> appears in one file 43 times with an <fgproperties> tag
 
==== Flightgear and Simgear Directory Descriptions and File Counts ====
 
[[User:Callahanp/Flightgear_and_Simgear_Files |Descriptions and file counts of flightgear/src and simgear/simgear subdirectories]]  What's where, What the heck is it anyway?
 
==== Flightgear/Simgear Code Exploration Project ====
 
see [http://wiki.flightgear.org/User:Callahanp/Flightgear_and_Simgear_Code Flightgear and Simgear Code]
 
==== Why I'm reading code ====
 
I'll be working on the interface between Flightgear and low level hardware in a panel or cockpit.  It is my understanding that others, including core Flightgear developers are also working on this and my efforts will  follow, derive from, depend on and I hope contribute in some small way to their work.  While I could just focus on the property tree and network interfaces, I still want a basic understanding of all areas of flightgear.
 
=== IDEs ===
 
Working on Configurations for Eclipse and QTCreator IDEs
 
 
=== Figuring out how to contribute to FlightGear ===
[http://wiki.flightgear.org/User:Callahanp/Flightgear_and_Simgear_Code/Onboarding Onboarding: Getting up to speed]
 
[[Getting things done in Flightgear]]
 
=== Progress on Cockpit Building ===
 
As of Feb 1, 2018:
 
* I've done only a few prototype circuits
* have been working to develop skills I'll need to produce a realistic cockpit. 
* Developing skills in Fusion 360 to support 3d Printing and 3d machine tools.
* Working on tests for a cluster based on Raspberry Pi Zeros
* Beginning to use a 3d Router
* Milling into thin prisms and hand polishing disks of plexiglass for illuminating dials in Sim Instruments
 
As part of my Cockpit Building efforts, I'm also working on
* [[User:Callahanp/Two Way Communication between a Raspberry Pi and Arduinos]]
* [https://github.com/callahanp/raspberrypi-zero-usb-ssh-internet/wiki  Connecting to a Raspberry Pi Zero via USB Ethernet Including the use of SSH and connection of the zero to the internet ]
* [https://www.raspberrypi.org/forums/viewtopic.php?f=49&t=199994 Creating a cluster with Raspberry Pi Zeros ]
* [[User:Callahanp/Snippets |Snippets]] of text that may or may not be used somewhere
 
=== Contact ===
 
'''[[Special:EmailUser/Callahanp | Email Callahanp through the wiki]]'''
 
I show up occasionally on #flightgear on irc.flightgear.org and am a member of several public forums related to cockpit building.
 
[[User:Callahanp|Callahanp]] ([[User talk:Callahanp|talk]]) 09:45, 11 November 2017 (EST)
 
=== My Skills ===
* Programming in whatever language is available
* Databases
* Making the following list of chips do what they do:
* MCP23XXX Multiplexer
* MAX7219 Serially Interfaced, 8-Digit LED Display Driver
* Designing a few types of circuits that work on a breadboard (see electronics below)
 
===== My Developing Skills -- Beginner =====
* Grokking Flightgear's code base.
* Very basic machining on a lathe or mill - no significant experience
* Electronics - Basics - DC, High & Low speed digital circuits, motor control, emi suppression and mitigation
* Soldering - Learn to deal with small components
* Designing circuits that make it from breadboard to cockpit.
* Getting a cokpit project off the ground
 
* C++ - Updating coding skills from an early version of C++
 
* Avoiding Writing Howtos
 
 
===== My Developing Skills -- Making Good Progress =====
 
* Fusion 360 3dCad
* 3d Router
* Tormach 1100 CNC Mill
 
 
=== My Projects ===
 
==== [[ C172P Cockpit ]] ====
==== [[ Cockpit Inteface for Flightgear ]] ====
==== [[ Flightgear Editable Orthographic Views ]] ====
==== [[ Up to speed coding C++ for Flightgear ]] ====


==Follow-on Questions==


===UFO? You decide...  ===
* 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?


Flightgear of the Future.


There's been recent discussion of what it would take to write Flightgear from scratch today.


I think a better question is how to go about undertaking any major restructuring of Flightgear's codebase to take advantage of modern tools and techniques.  And I think we already have an answer to that.


In fact, there's an excellent example happening right now in the Spring of 2018. It's Edward's work on unit testing and the restructuring of the subsystem manager.  If you're interested in how big changes come about I'd suggest reading everything related to this effort rather closely and following the ongoing discussion over the need to refactor the way flightgear subsystem dependencies are handled.  Look not just for the technical details, but for the way Edward limited the scope of his current activity and for the quality of the interactions between the interested parties. I think its a model for anything major anyone wants to undertake in Flightgear.  In fact this kind of interaction is nothing new in the flightgear project.  Other examples abound. Everything from the adoption of OSG to QT has gone through a similar process.
== Background ==
I'm about to start going through the list above for myself. It may take a while.


Those of us who want to be involved in ''big changes'' need to know this process well. So read the mailing list entries in detail and notice the choices people are making and the reasons why.  The last thing anyone wants is divisive discussion over direction or choices already made. Especially where the root of the discussion is a misunderstanding or refusal to recognize how the project actually works over a period of time.
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.


So now here's my take on what would be a big Flightgear code change - [[Multicore Processing and Clusters]].  The changes in play today lay the groundwork for this.
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.


References:
I want to come up to speed with clang and lldb in vscode.
* [https://sourceforge.net/p/flightgear/mailman/search/?q=If+you+were+to+write+FlightGear+today... If you were to write FlightGear today... ]
* [https://sourceforge.net/p/flightgear/mailman/search/?q=Designs+for+the+subsystem+manager%2Ffactory. Designs for the subsystem manager factory ]
* [https://sourceforge.net/p/flightgear/mailman/search/?q=Code+formatting+for+the+whole+FlightGear+codebase Code formatting for the whole FlighGear codebase ]
* [https://sourceforge.net/p/flightgear/mailman/search/?q=Questions+about+TestSuite Questions about the TestSuite ]
* [https://sourceforge.net/p/flightgear/mailman/search/?q=CppUnit+branches+for+merging%2C+and+an+event+manager+timer+queue+rewri CppUnit branches for merging ]


=== The Howtos ===
[[/stackoverflow.com/questions/63978029/setup-lldb-debugging-with-cpp-extension-in-vscode-linux|https://stackoverflow.com/questions/63978029/setup-lldb-debugging-with-cpp-extension-in-vscode-linux]]


'''-- Oh yeah... those...'''
== Other Thoughts ==


I'm working on these along side building my cockpit.  Some of the early attempts were not that useful.  My current approach is to build and document actual hardware.  I hope this will be more helpful.
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.


Current Projects:
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.
* [[Howto:C172P Panel Project]]
* [[Howto:Build your own Panel or Cockpit]]


See below for the my personal rules about these howtos going forward.  I had to write these because it was becoming a morass and time waster.
There's no such thing as free beer! Someone pays for flightgear cloud infrastructure that I personallly benefit fromSo I contribute a little at:


'''The following is yet another work in progress'''
<nowiki>https://liberapay.com/t3r</nowiki>


Writing Advice to Callahanp from Callahanp  or How to write a Howto.
Currently working on:


Rule 1. Brevity.
Git Worktrees with download_and_compile.sh  (done & working)


Rule 2. Real Hardware & Software.  If I haven't done it yet I'll talk about it on my personal wiki page.  That's where stuff like that belongs.   
Web Socket Refactor & Fix.   


Rule 3. Project Planning, Building Teams, and anything else about developing a hobby project belong elsewhere.  If you want to write about these things, go ahead, but don't do it in a Howto on building something specific like a cockpit.  If you haven't done the project yet you'll get it wrong. Plus, you'll sound like a...
OSM (Open Street Map) Scenery Build (on hold)


Rule 4. Grand visions, Vaporware, Abstract thinking, Advice and other nonsense  don't belong anywhere. 
Goals (Maybe)


Rule 5. Get rid of your darlings. Those witty turns of phrase, that elegant prose, the puns, jokes and asides.  Fun to write maybe but not so fun to read.  They're distractions.  These are things a skillful writer can weave into an uninterrupted smooth train of thought but you're not that good a writer. Don't even try,
*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.


'nuff said.
[[Hackathon Proposal: Property Subscription Improvements|Hackathon-2023-Proposal-Websocket-Property-Subscription-Improvements]]

Latest revision as of 13:59, 6 June 2024

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