work

Docker and Apptainer Using Git Asciinema Jekyll

c++

Assertions Debugging Profiling

general

Vacation Checklist


Debugging C++




Library dependencies


Using lldb (MacOS)


Using gdb (Linux)

gdb my_executable
break my_function_name
break 'hipo_output::writeHeader(outputContainer*, std::map<std::string, double>, gBank)'
break hipo_output.cc:<line_number>
break GOptions::getVerbosityFor if tag.size() == 0
run arg1 arg2 ...
step     # Step into the next line (enter function)
next     # Step over the next line (skip into function)
finish   # Step out of the current function
backtrace       # Show call stack
info locals     # Show local variables
info args       # Show function arguments
print var       # Print value of variable
print *ptr      # Dereference a pointer
list            # Show source around current line





  1. For simpler lldb options run arg1 arg2 also works, but process launch is more flexible.