>>26
gdb is primarily a source code debugger, 'disas' may not work correctly if you don't have debug information or source available
Disassembling won't work if there's no source code!?!? WTF? Is that sentence supposed to make any sense? Disassembling should
always work, even if there *isn't* source code!! I do 75% or more of my debugging without source. Only a truly fuck-brained GNUdiot would screw up something so fundamentally simple. FYI the source code was available, since what I was trying to debug is a part of a system written in Asm that we developed.
This display and output of gdb can be completely customized, you can pipe it to external text processing programs and get back whatever format you want.
The same old argument that "you can change it to suit your needs"? What's next, "you can recompile gdb"? No. I
don't want to waste time fucking around with configuring gdb on a client's server, I want to just ssh in and have a working debugger with sane defaults.
There's also the TUI where you can get a "gui like" view
All that did was show a rather crude approximation to something usable, which then promptly scrolled out the top of the terminal window after a few more commands...
If I'm using gdb, 99.9% of the time it's to try to reproduce a bug on a client's machine that resists local bugfinding attempts. The last thing you want when you have to do that, is software that requires excessively verbose commands (emacs syndrome?) and acts like a retarded kid who thinks he knows better than you.
Here's an alternative, better scenario to the one in OP:
- g
*** SIGSEGV ***
RAX=0000000000000000 RBX=0000000000000000 RCX=0000000000000000 RDX=0000000000000000
RSP=FFFFFFFFFFFFFFEE RBP=0000000000000900 RSI=0000000000000000 RDI=0000000000000000
R08=0000000000000000 R09=0000000000000000 R10=0000000000000000 R11=0000000000000000
R12=0000000000000000 R13=0000000000000000 R14=0000000000000000 R15=0000000000000000
DS=1903 ES=1903 SS=1903 CS=1903 RIP=0000000001973FB0 PM NV UP EI PL NZ NA PO NC
1903:0000000001973FB0 F0 LOCK
1903:0000000001973FB1 3E DS:
1903:0000000001973FB2 81 84 8E 78 56 34 12 89 AB CD EF ADD DWORD PTR [ESI+ECX*4+12345678],EFCDAB89
DS:0000000012345678=????????
(some_function + 0000000000003E96)
- u rip
1903:0000000001973FB0 F0 LOCK
1903:0000000001973FB1 3E DS:
1903:0000000001973FB2 81 84 8E 78 56 34 12 89 AB CD EF ADD DWORD PTR [ESI+ECX*4+12345678],EFCDAB89
1903:0000000001973FBD 48 01 C0 ADD RAX, RAX
1903:0000000001973FC0 48 01 C0 ADD RAX, RAX
1903:0000000001973FC3 48 01 C0 ADD RAX, RAX
1903:0000000001973FC6 48 01 C0 ADD RAX, RAX
1903:0000000001973FC9 48 01 C0 ADD RAX, RAX
-
Less verbose commands, automatically printing out the machine state upon an exception [this should be automatically done even when NOT running in a debugger, like what Windows does (or used to? fuck Win8...)], disassembly that gives a sane amount of instructions by default, consistent syntax, and of course, no stupid $ or % prefixes or backwards operand order.