Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #719

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
9 changes: 8 additions & 1 deletion doc/DOCUMENTATION
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@ Star System deals with the current cameras, and the current lights, and keeping

Units are accessed through a UnitContainer or a UnitCollection depending on the number. These structures keep reference counts and remove any "dead" units from them when accessed. Star system has the complete list of units and cycles through them to accomplish physics, etc.

Included in this directory contains resources for generating documentation/degugging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

degugging ?


For more Details please see the doxygen Documentation.
For more Details please see the
doxygen Documentation- {VS_root}/doc/VS_Doxygen.RDME .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Documentation-" ?
remove the dot

{VS_root}/doc/doxygen - contains script for using Doxygen on vegastrike cpp & python coding, and is where output is located
GDB_python {VS_root}/doc/VS_Gdb_Python.RDME
{VS_root}/doc/gdb - for gdb with python debugging
Valgrind {VS_root}/doc/VS_Valgrind.RDME
{VS_root}/doc/valgrind - parts/scripts for running valgrind
6 changes: 6 additions & 0 deletions doc/VS_Doxygen.RDME
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The basic idea is first to Warn you will require lots of space if you proceed.
The basic steps are in the VSE root directory run "doxygen ./doc/doxygen/VS_doxy.Config" and all the data will be in a subdir under /doc/doxygen. the VS_doxy.config is editable (please make a bakup of the config file first, just in case. Currently it is configured to run on VegaStrike github master >"INPUT" needs to be adjusted for appropriate directoy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the added whitespace at start intended ?
"directory run" remove doubled space


Requires: doxygen, Graphviz, Vegastrike {engine,assets} source packages. Lots of free storage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Requires: doxygen" remove doubled space


TODO: Explain it all ;^s
93 changes: 93 additions & 0 deletions doc/VS_Gdb_Python.RDME
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
In order to properly setup and use gdb with pythonon the "vegastrike-engine", some things need to happen.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "python on" ?


sudo apt-get install gdb python3.7-dbg gdb-doc gdbserver python3-gdbm-dbg python3-tk-dbg

1 gdb and gdb-python (3,x), test python described below
2 debug symbols (ex foo.dbg) for vegastrike build dependancies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependencies

3 vegastrike built with "-O -fno-inline" + debug symbols



########### Important files ###############
$XDG_CONFIG_HOME/gdb/gdbinit (/etc/gdb/gdbinit 0n debian 10)
$HOME/.config/gdb/gdbinit
$HOME/.gdbinit

************
from python
https://devguide.python.org/gdb/

In gdb 7, support for extending gdb with Python was added. When CPython is built you will notice a python* file in the root directory of your checkout. Read the module docstring for details on how to use the file to enhance gdb for easier debugging of a CPython process.

To activate support, you must add the directory containing python-gdb.py to GDB’s “auto-load-safe-path”. Put this in your ~/.gdbinit file:

add-auto-load-safe-path /path/to/checkout
************

So using locate I would :
$ locate *-gdb.py

Which on my debian"buster" reports

:~$ locate *-gdb.py
/usr/share/gdb/auto-load/lib/x86_64-linux-gnu/libpthread-2.28.so-gdb.py
/usr/share/gdb/auto-load/usr/bin/python3.7-dbg-gdb.py
/usr/share/gdb/auto-load/usr/bin/python3.7-gdb.py
/usr/share/gdb/auto-load/usr/bin/python3.7dm-gdb.py
/usr/share/gdb/auto-load/usr/bin/python3.7m-gdb.py
/usr/share/gdb/auto-load/usr/lib/jvm/java-11-openjdk-amd64/jre/lib/server/libjvm.so-gdb.py
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.5800.3-gdb.py
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5800.3-gdb.py
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libisl.so.19.1.0-gdb.py
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libpython3.7dm.so.1.0-gdb.py
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0-gdb.py
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25-gdb.py

As the closest one is "/usr/share/gdb/auto-load/usr/bin/python3.7-gdb.py" I chose this one. I don't know what the rest are yet so I'll leave them alone

!@#@!!@#@!!@#@! END ONE TIME SETUP SECTION !@#@!!@#@!!@#@!

TESTING

If you are doing this for the first time, you may want to verify it works.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra whitespace

This test displays/doesn't display the pid # of gdb via python (you will soon understand)

first in terminal start gdb

~$ gdb
GNU gdb ... blah blah ...

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb)

here at "(gdb)" type "pi"

(gdb) pi

you should see ">>>" whicxh is the gdb-python command prompt.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whicxh

First timer should try the following
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newcomers ?

enter this at ">>>" prompt

>>> import os
>>> print('I am pid ()'.format(os.getpid()))
I am pid ()


If this works then you have a gdb_python <= 2.7 and needs to be changed (unless you are using python <= 2.7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"it needs" maybe ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer support Python 2.7; directions should only be for Python 3 now.


Now try the python 3 version


>>> import os
>>> print('my pid is',os.getpid())
my pid is 27319

now you are ready to run gdb_python on vegastrike=engine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vegastrike-engine ?








Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot of whitespace

32 changes: 32 additions & 0 deletions doc/VS_Valgrind.RDME
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Vegastrike setup base valgrind suite

1 In a user directory a ".valgrindrc" file, Create if not found
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create $HOME/.valgrindrc would be clearer I think...

2 A directory search tool (I used updatedb & locate from locate pkg on debian)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace damage @ beginning, the same is also in the previous line...

3 locate *.supp
For example on my Debian My output looks like this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debian is not yours, remove those "my"s


/usr/lib/valgrind/debian.supp
/usr/lib/valgrind/ncurses.supp
/usr/lib/valgrind/python.supp
/usr/lib/valgrind/python2.supp
/usr/lib/valgrind/python3.supp
/usr/lib/x86_64-linux-gnu/valgrind/aisleriot.supp
/usr/lib/x86_64-linux-gnu/valgrind/default.supp
/usr/share/glib-2.0/valgrind/glib.supp
/usr/share/openmpi/openmpi-valgrind.supp
/usr/share/pmix/pmix-valgrind.supp

If you need to create a ".valgrindrc" the command "locate *.supp > ,/.valgrindrc will get you started
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the command "locate *.supp >> $HOME/.valgrindrc"


4 edit ".valgrindrc" and comment out (with "#") the "python,python2" lines.
On my system python and python .supp files are the same. so not taking chances I comment them out ,Also the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace damage, capitalize at sentence start, which is not after a comma

lines of openmpi-valgrind.supp and pmix/pmix-valgrind.supp are not used in vegastrike last time I checked ,
so they can be commented or given suppression tag as you see fit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace damage, again
what is a suppression tag ?

Also insert "--suppressions=" before all other lines. DON'T FORGET TO SAVE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this may be it...

5 run valgrind simular to "valgrind --tool=callgrind ./vegastrike-engine -d../../Assets-Production"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"simular to" => "like this"

in this example callgrind will be run - many other options

I found there is a "gdb server option" but for now this will be a start
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line


$ ./gprof2dot.py --format=callgrind --output=out.dot /path/to/callgrind.out
$ dot -Tpng out.dot -o graph.png
Loading