#### gdb shit http://yusufonlinux.blogspot.com/2010/11/debugging-core-using-gdb.html https://en.wikibooks.org/wiki/Linux_Applications_Debugging_Techniques/Core_files * compile with -g for c++ applications * start-up gdb program = run program in gdb to get more output if immediate crash gdb program core = start gdb with program and its core (more information) check threads for possible match with core.pid/lwp * running gdb ## basic information gathering bt (full) = print stack (optional full info) frame n = select n frame in stack where full = get more information on frame; use with thread apply all info frame = get register, args, local info from frame info variables = get all variables and memory locations from core info locals = get all local variables info functions func? = get all functions and memory locations from core info symbol MEM = get more information from calling SO? info shared = get list of shared objects in core info proc = get process information (if using core, will give pid) info scope (funcname,source line,*address) = prints all variables local to scope defined info registers = get all registers info threads = less verbose thread details whatis = get type disassemble = get all assembly instructions ## break/check points b function_name, line_number = run program and stop at break c = continue execution from breakpoint c n = countinue n times d/delete b n|c n = delete breakpoint/checkpoint number clear ln|function_name = delete breakpoint set on specific line numer or function_name disable/enable = disable/enable breakpoints instead of delete info = get break/check point information step = execute next line run = execute program w/ optional args ## printing print can be used for displaying pointer information - print *dump_ptr->blah print /format (x (int), d(decimal), u(unsigned decimal), o(octal), t(binary int), a(address), c(char), f(float)) ## setting set var/variable v=n = set a variable v's value to n ## examining threads thread n = select thread number n (normal commands work here) thread apply all cmd = run cmd on all threads (use with bt) ## lock stuff print mutex print locks_mutex print locks ## viewing source code list + = gets source code from selected frame; useful to get variables for printing ### using x/ (examine memory) format = s(null string), i (machine instruction), x (hex) = x/3sh (examine 3 half words of null string memory) x/ MEM = get information from memory location x/nfu MEM = get more inforamtion concerning stack (ASCII) n = number, f = format, u = unit (requires bytes, halfwords(2 bytes), words(4 bytes), giantwords(8 bytes)) x/16i $pc = get all instructions #### organize * printing vectors print vector = print entire vector print vector.size() = get list of elements in vector print *(vector._M_impl._M_start|finish) = print first|last element print *(vector._M_impl._M_start)@N = print N elements from start