What is the lldb equivalent of gdb’s –args?
Yes, it’s just — instead of –args. From the help: lldb -v [[–] <PROGRAM-ARG-1> [<PROGRAM_ARG-2> …]] Thus: $ lldb — exe –lots –of –flags -a -b -c d e
Yes, it’s just — instead of –args. From the help: lldb -v [[–] <PROGRAM-ARG-1> [<PROGRAM_ARG-2> …]] Thus: $ lldb — exe –lots –of –flags -a -b -c d e
You want to use stepi, aka si. it steps by one machine instruction. (Or ni to step over call instructions.) Check the GDB manual’s section on continuing and stepping, which has an entry for it. Or inside GDB, help / help running will show you that si exists, and help stepi will show you more … Read more
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
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
use delete command with no arguments; it can be abbreviated to del or d.
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
@fd – the RedHat bug had your answer. The mallinfo function has been deprecated, and won’t be updated. A true query stats API is TDB. Today, you have malloc_stats and malloc_info. I can’t find any documentation on either one, but here’s what they give you. Is this close enough to what you need? (gdb) call … Read more
You can use until to make the loop end. You should give it at the end of the loop. This is useful if you do not need to step in to iterate a loop.
Look at this. Use: set follow-fork-mode <mode> Set the debugger response to a program call of fork or vfork. A call to fork or vfork creates a new process. The <mode> argument can be: parent: The original process is debugged after a fork. The child process runs unimpeded. This is the default. child: The new … Read more