Tags

,

  • hexdump -C <file_name>. Displays ASCII value of the file. Very useful to debug errors while you are interested in a string value.
  • Always enable a single breakpoint in a multithreaded application under GDB. This helps your execution flow stick to one single thread of execution (provided the breakpoint is unique).
  • To access elements of an array, typecast the pointer with an equivalent array size. The other way of accessing is using @num_of_elements. gdb) (char[1024]) *ptr
  • gdb) set print pretty (useful to understand nested structure)
Advertisements