![]() ![]() BRAHMS
Reference Manual » General » Debugging
This documentation is offline - click here to go online
Index | Search: Go online to use Search
| ||
DebuggingThis page provides help with debugging in BRAHMS. Getting maximal informationThe BRAHMS executable understands various options that change (generally, raise) the detail level of the log. These are detailed under Command Line, but the switches You can pass these options via the Matlab Bindings by using the syntax Attaching a system debuggerUse This won't help you much unless you have debugging symbols available. Turn on generation of debugging symbols when you compile your process. If you want to debug BRAHMS itself, you will have to build it with debug symbols in, or obtain a debug build (not available at time of writing). But you won't need a debug build of BRAHMS to debug your component. Charles's ExperienceProblemI am developing a Brahms component in C++ and it is dying in its run or init phase. I want to step through my C++ code with gdb, but as part of the SolutionYou do not need to recompile Brahms itself with debug info. Make sure your component is compiled with OS Shell Prompt
$ export LD_LIBRARY_PATH=/home/charles/SystemML/BRAHMS/bin
$ brahms-execute ~/SystemML/BRAHMS/temp/unnamed-exe.xml
We can also run it through gdb with OS Shell Prompt
$ export LD_LIBRARY_PATH=/home/charles/SystemML/BRAHMS/bin
$ gdb --args brahms-execute ~/SystemML/BRAHMS/temp/unnamed-exe.xml
In gdb, we need to set a breakpoint in our function of interest. This is a little harder than usual because at this point, our module hasn't been loaded (dynamically by BRAHMS) yet, so none of its symbols are known to gdb. Instead, we can query the .so file corresponding to our module, to manually see the symbols for our function, in this case "callPython". Look for a line containing your function, for example: OS Shell Prompt
$ nm /home/charles/SystemML/Namespace/dev/temp/python/brahms/0/libbrahms-dev_temp_python.so.0 | grep callPython
...
000017a0 T _ZN17dev_temp_python_010callPythonEbRSt6vectorI12DOUBLE_ARRAYSaIS1_EES4_
...
The big name on the right is the (mangled) symbol. In gdb, set a breakpoint and then run, using: OS Shell Prompt
gdb> b _ZN17dev_temp_python_010callPythonEbRSt6vectorI12DOUBLE_ARRAYSaIS1_EES4_
gdb> run
and the code breaks as desired. How cool is that? |
||
This is a documentation page for the BRAHMS Modular Execution (Simulation) Framework. For details of licensing and distribution, please click here. To advise of an error or omission, please click here. |