User:Callahanp: Difference between revisions

Jump to navigation Jump to search
Line 6: Line 6:
Recently I began the effort to fully understand the skills needed to contribute to the Flightgear project's codebase.  I know c++ from a course in the early 90's.  I'm looking at Kdevelop and QTquick as development tools.
Recently I began the effort to fully understand the skills needed to contribute to the Flightgear project's codebase.  I know c++ from a course in the early 90's.  I'm looking at Kdevelop and QTquick as development tools.


===== Flighgear Codebase =====
===== Flightgear Codebase =====


My area of interest is in Flightgear's code includes:
My area of interest is in Flightgear's code includes:
Line 19: Line 19:


I'm beginning 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.  I'd like to learn how aircraft data and graphics are integrated into the working program, and how, why and where Nasal scripting is used.
I'm beginning 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.  I'd like to learn how aircraft data and graphics are integrated into the working program, and how, why and where Nasal scripting is used.
I've installed [https://gdbgui.com/ gdbgui] and [https://atom.io/ atom] for basic code exploration.
Later I'll try QtQuick and QtCreator
Starting with git clones produced by download_and_compile.sh and the run script it produces, I now have a script which echo's the complete flightgear command line invocation and if desired, starts gdbgui with the generated command.
cmd = "/home/pac1/fg/next/install/flightgear/bin/fgfs \
  --fg-root=/home/pac1/fg/next/install/flightgear/bin/../fgdata/ \
  --log-level=2 \
  --fg-scenery=/home/pac1/fg/next/install/flightgear/bin/../fgdata/Scenery \
  --fg-aircraft=/home/pac1/fg/next/install/flightgear/bin/../fgdata/Aircraft \
  --fg-aircraft=~/.fgfs/Aircraft/org.flightgear.fgaddon/Aircraft \
  --httpd=5401 --telnet=5400 --airport=KSFO"
  gdbgui "$cmd"
I start by stepping through the bootstrap and other initialization routines until flightgear is running.
the gdb run command gets things going in gdbgui. Just type "r"
I'm going to record a list of functions called, in the order they are called in with descriptions where appropriate.
to get information about where these functions are located, I'll use the atom's project search or the step into feature of gdbgui.
If the call is along the main line of execution, it will be in Bold Face.  Paths start with directories under flightgear/src, except for /simgear which is under /simgear.  Yes there is a simgear/simgear in the path.  There's proably a reason why its not simgear/src
====bootstrap.cxx====
{| class="wikitable"
|-
! Full Text of Call !! Called Function Location or Include File !! Notes
|-
| '''command line''' || in bootstrap.cxx <br>'''main(argc, argv)''' || bootstrap.cxx contains the main function.  main.cxx does not.
|-
| detectSIMD() || bootstrap.cxx || returns true if the cpu supports sse2.
|-
| gethostname(_hostname, 256) || unistd.h glibc || returns the hostname of your computer
|-
| signal(SIGPIPE, SIG_IGN) || signal.h || directs SIGPIPE to the SIG_IGN signal handler - Portability: use sigaction() instead
|-
|  signal(SIGSEGV, segfault_handler) || signal.h  || Flightgear formats the message with a backtrace and exits with std:abort()
|-
|  segfault_handler (int signo) || bootstrap.cxx  ||
|-
|  '''initFPE'''(flightgear::Options::checkForArg(argc, argv, "enable-fpe")) || main/options.cxx<br>  bootstrap.cxx || checks the command line arguments for the enable-fpe option. Calls InitFPE with the result. <br> see bootstrap.cxx for more details
|-
|  signal(SIGFPE, handleFPE) || signal.h<br/> bootstrap.cxx || We handle Floating Point Exceptions
|-
| setlocale(LC_ALL, "") <br/> setlocale(LC_NUMERIC, "C") <br/> setlocale(LC_COLLATE, "C") ||  ||
|-
| return fgUninstall() || fg_init.cxx || Command line options are checked to determine if uninstall should be called.
|-
| sglog() || /simgear/debug/logstream.cxx || This initializes the log. see logstream.cxx for details
|-
| std::set_terminate(fg_terminate); || <exception> <br> bootstrap.cxx || sets the standard template library terminate routine<br>
|-
| atexit(fgExitCleanup) || stdlib.h<br> bootstrap.cxx || registers the given function to be called at normal process termination, either via exit(3) or via return from the program's main().  Functions so registered are called in the reverse order of their registration; no arguments are passed
|-
|  fgviewerMain(argc, argv) || flightgear/Viewer/fgviewer.cxx  || see viewer topics for details.  This is called in bootstrap.cxx if the command line arguments include --viewer
|-
| '''fgMainInit(argc, argv)''' || Main/main.cxx || Starts to initialize flightgear.  This is called in bootstrap.cxx if command line arguments do ''not'' contain --viewer
|-
| catch block || various || termination for most or all errors. Read the end of bootstrap.cxx for more information
|-
|  flightgear::shutdownQtApp() || bootstrap<br/> Qt ||  Done separately from atexit. see bootstrap.cxx for more information
|-
| crInstall(&info)<br>crUninstall() || [http://crashrpt.sourceforge.net CrashRpt.h] || #if defined(HAVE_CRASHRPT). This only happens on windows.
|}
====Main/main.cxx====


===== Progress on Cockpit Building =====
===== Progress on Cockpit Building =====
980

edits

Navigation menu