How to highlight and color gdb output during interactive debugging?

.gdbinit You can tweak your ~/.gdbinit to have colors. You can use mammon’s .gdbinit which is available here: https://github.com/gdbinit/gdbinit You can tweak it as much as you want too. I found this thanks to this SO answer. Here’s the kind of output that you can obtain: A GitHub repository is also available: https://github.com/gdbinit/Gdbinit On a … Read more

How do I remove a single breakpoint with GDB?

You can list breakpoints with: info break This will list all breakpoints. Then a breakpoint can be deleted by its corresponding number: del 3 For example: (gdb) info b Num Type Disp Enb Address What 3 breakpoint keep y 0x004018c3 in timeCorrect at my3.c:215 4 breakpoint keep y 0x004295b0 in avi_write_packet atlibavformat/avienc.c:513 (gdb) del 3 … Read more

Step out of current function with GDB

You can use the finish command. finish: Continue running until just after function in the selected stack frame returns. Print the returned value (if any). This command can be abbreviated as fin. (See 5.2 Continuing and Stepping.)

Core dump file analysis [duplicate]

You just need a binary (with debugging symbols included) that is identical to the one that generated the core dump file. Then you can run gdb path/to/the/binary path/to/the/core/dump/file to debug it. When it starts up, you can use bt (for backtrace) to get a stack trace from the time of the crash. In the backtrace, … Read more

How do I run a program with commandline arguments using GDB within a Bash script?

You can run gdb with –args parameter: gdb –args executablename arg1 arg2 arg3 If you are doing this often (e.g. when running GDB from a script), you might want to consider the following arguments to automate things further. First, you can place your GDB commands (such as ‘run’) in a text file and provide the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)