Debian – gdb set overwrite logging on should overwrite gdb.txt correct

debiandebugginggdb

I was looking at Logging Output and had been trying this particular command –

set logging overwrite on

AFAI understood it, that command is supposed to overwrite the contents of gdb.txt but it does not. Is there a bug there or I haven't understood the meaning/syntax properly.

I am running –

[$] gdb --version                                                                                                                  
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".

This is on Debian testing.

Looking at : Bugs in package gdb (version 7.12-6) in unstable

does not tell me much but then I'm no gdb expert or even an intermediate user. If somebody knows a bug which references the above behaviour please share that or if I'm lacking in understanding, please share that as well.

Update –

The exact commands are –

$ gdb qbittorrent 
(gdb) set logging overwrite on 
(gdb) set pagination 0
(gdb) run

when the application hanged/crashed via –

QXcbConnection: XCB error: 3 (BadWindow), sequence: 16699, resource id: 14227177, major code: 40 (TranslateCoords), minor code: 0
pure virtual method called
terminate called without an active exception

Thread 1 "qbittorrent" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. 

I did the requisite –

(gdb) bt
(gdb) bt full
(gdb) thread apply all bt

Now I was expecting that with theoverwrite on command gdb will overwrite the contents of gdb.txt from the current session as well as overwrie the time-stamp of the file, neither happened. Luckily, I hadn't closed the session so was able to copy the debug session contents to the maintainer and upstream so they could take a close look at what happened.

I am curious/not understanding as to why it didn't do the changes or am I understanding it wrong.

Best Answer

You missed the actual logging (set logging on):

(gdb) set logging overwrite on
(gdb) set logging on
Related Question