GDB 8.1 Released
sourceware.org
sourceware.org
TUI really is one of the best features to really get into gdb. visually stepping through the disassembly really makes debugging more appealing, I really wish they dont abandon this aspect of gdb
https://www.youtube.com/watch?v=PorfLSr3DDI
It really did change my opinion of gdb in just 15 min.
ptype already existed, but did not print out offsets. This is incredibly useful, and something Windbg does with dt. Pwndbg does this in GDB by adding new commands.
But I needed a C++ patch on osx with cc/clang. Apparently they added cxx files with the .c extension: gdb/probe.c:63
- const any_static_probe_ops any_static_probe_ops;
+ any_static_probe_ops any_static_probe_ops;The function can do something like put a request into a mailbox buffer, and then check for a reply in the inbox buffer. When there is no debugger, there is never any reply.
When the debugger stops the show with the breakpoint, it processes the request and prepares a reply, flipping some "reply present" flag; when the program is resumed then, it gets the reply.
It would be good not have any of that damned Python monkey business involved in this.
please, GDB internals are open source, you can do all of that in plain C :D That's what I did initially, to give GDB the ability to distinguish user-level threads (see libthread_db).
Having a high-level language / interface to GDB is a great again of time !
Imagine malware that could react differently when a debugger is attached.
I think you’re missing the point as to why programs would do this. Usually it’s to protect some sort of DRM scheme through obscurity.
Here's [1] the tip of the iceberg on this issue.
[1] antukh.com/blog/2015/01/19/malware-techniques-cheat-sheet/
Edit - Other commenters beet me to this point :-P
There are bugs that won't reproduce when you debug via JTAG; so what.
Simply pausing on a breakpoint can make a bug irreproducible.
Programs can infer that they are being debugged via timings, and various side channels.
that has been the case for a long time: simply timing some instructions is generally enough to tell you that you're running under a debugger. It's also helpful for copy protection.
Programs behave differently under a debugger anyway; "bugs disappearing under a debugger" already happens now.
It's just a question of the risk/reward.
"This debugger feature increases the scope of situations when a bug disappears under the debugger": that's a risk.
"This debugger feature gives me a better overall debugging experience most of the time": benefit
The Microsoft environment has something like this: OutputDebugString. Very useful.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...
Also IsDebuggerPresent: https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...
and other things.
The debugging experience on Windows 20+ years ago was was ahead of debugging on GNU/Linux today, I'm afraid, so this stuff is above criticism from the "M$ SuX" angle.
And I don't really know what IsDebuggerPresent gets you.
You're really focusing on features, rather than use cases.
Never mind that though, we can take some other descriptor, like 3, and bind it to, say /dev/null.
What are the gdb commands to have whatever is going to file descriptor 3 be shown inside gdb?
I really do not care how it's implemented. However, "tightly integrated" is better than "flimsy hack"; "consumes breakpoints" is better than "doesn't consume breakpoints".
What's your use case for this that makes stderr unsuitable?
If, say, a compiler puts out "hello.c: syntax error" on its standard error stream, that is not a debugging diagnostic regarding that compiler's internals; it's about "hello.c".
stderr is not an instrumentation tool which goes away when we're not debugging the program.
https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.ht...
In your program you would probably need to link in some code to implement the protocol, like the GDB remote stub:
https://sourceware.org/gdb/onlinedocs/gdb/Remote-Stub.html
Qemu and Valgrind both implement their own gdb stubs.
For ARM targets, there is a similar feature named "semihosting":
http://www.keil.com/support/man/docs/armcc/armcc_pge13587870...
It sounds promising. A particularly interesting area is events:
https://sourceware.org/gdb/onlinedocs/gdb/Notification-Packe...
The program could generate custom notifications.
From this [0] helpful StackOverflow post:
> If you need to transfer data and you want to be sure the data didn't get corrupted, the TCP checksum alone is certainly not enough for this task. I would even dare to say that a CRC checksum is not enough for this task, since a CRC32 may not detect an error where more than 32 bits in a row are affected (these errors can "cancel out" each other). The minimum checksum you'd need for ensuring flawless data transfer is the MD5 value of the data.
[0] https://stackoverflow.com/questions/3830206/can-a-tcp-checks...
I had nothing interesting to say about the new GDB release, but the checksum used surprised me. Hence the question.