how can I put a breakpoint on “something is printed to the terminal” in gdb?

Use a conditional breakpoint that checks the first parameter. On 64-bit x86 systems the condition would be: (gdb) b write if 1==$rdi On 32-bit systems, it is more complex because the parameter is on the stack, meaning that you need to cast $esp to an int * and index the fd parameter. The stack at … Read more

Is there any way to set a breakpoint in gdb that is conditional on the call stack?

Update: There is now a better answer to this question: use GDB _is_caller convenience function. The need you describe comes up quite often, usually in the context of some_utility_fn being called a lot, but you only are interested in the call which comes from some_other_fn. You could probably script this entire interaction using the new … Read more

Debugging with gdb on a program with no optimization but still there is no symbol in the current context for local variables

As noted in the release notes for GCC 4.8 (i.e. current trunk): DWARF4 is now the default when generating DWARF debug information. When -g is used on a platform that uses DWARF debugging information, GCC will now default to -gdwarf-4 -fno-debug-types-section. GDB 7.5, Valgrind 3.8.0 and elfutils 0.154 debug information consumers support DWARF4 by default. … Read more

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