Adding gdb to MinGW
In a command prompt I browsed to C:\MinGW\bin and ran: mingw-get.exe install gdb That fixed it for me. Not sure if it matters but I have C:\MinGW\bin in my path (guess I probably didn’t need to browse to C:\MinGW\bin).
In a command prompt I browsed to C:\MinGW\bin and ran: mingw-get.exe install gdb That fixed it for me. Not sure if it matters but I have C:\MinGW\bin in my path (guess I probably didn’t need to browse to C:\MinGW\bin).
You need the /t switch which works with both p and x: (gdb) p /t 0x0000000000400398 $1 = 10000000000001110011000 See help x for more info on the FMT (format) switches.
The exact line to write in your ~/.lldbinit file is settings set target.x86-disassembly-flavor intel In the future, you will also be able to tweak how immediate values are displayed with the new settings: target.use-hex-immediates and target.hex-immediates-style.
(gdb) p &a if you need the address of variable a. A variable might be cached in a register though, in which case GDB would tell you address requested for identifier “a” which is in register $xxx. Sidenote: do not use gets, see here.
I know there is already a fine answer for this, but I prefer not using an additional file. Here is another answer: gdb attach $(pidof process_name) -ex cont
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
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
use delete command with no arguments; it can be abbreviated to del or d.
“Inferior” is a general term to mean “something that you are using gdb to debug” — generally a process or perhaps a kernel running on an emulator or on some other piece of hardware connected on a serial line. The term “Inferior debugger” comes up when you are using gdb to debug gdb. That is, … Read more
I’ll bet that xmms2d is using sigwait() to handle signals, which breaks gdb’s ability to catch CTRL-C. See https://bugzilla.kernel.org/show_bug.cgi?id=9039 I got an idea for a workaround by reading Continue to debug after failed assertion on Linux? — when I’m ready to break in gdb, I run “kill -TRAP <pid>” from another terminal window.