This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug cli/23135] New: Configuring logging inside a user-defined command does not take effect
- From: "alex at alex-smith dot me dot uk" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 03 May 2018 10:10:06 +0000
- Subject: [Bug cli/23135] New: Configuring logging inside a user-defined command does not take effect
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=23135
Bug ID: 23135
Summary: Configuring logging inside a user-defined command does
not take effect
Product: gdb
Version: 8.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: cli
Assignee: unassigned at sourceware dot org
Reporter: alex@alex-smith.me.uk
Target Milestone: ---
In GDB 8.1, "set logging" commands inside a user-defined command do not take
effect when the user-defined command is executed. For example:
(gdb) define setup-logging
Type commands for definition of "setup-logging".
End with a line saying just "end".
>set logging redirect on
>set logging on foo.txt
>end
(gdb) setup-logging
(gdb) bt
#0 0x00007ffff69c2f4b in raise () from /lib64/libc.so.6
#1 0x00007ffff69ad591 in abort () from /lib64/libc.so.6
#2 0x0000000000401783 in FatalImpl (inFile=0x404d28
"Build/Release/Engine/Runtime/Engine/Source/Engine.cpp", inLine=47,
inFormat=<optimized out>) at
Build/Release/Engine/Runtime/Core/Source/Log.cpp:43
#3 0x0000000000403197 in Engine::Run (this=<optimized out>) at
Build/Release/Engine/Runtime/Engine/Source/Engine.cpp:47
#4 0x00000000004031ba in main (argc=<optimized out>, argv=<optimized out>) at
Build/Release/Engine/Runtime/Engine/Source/Main.cpp:23
(gdb)
The command output is still appearing on stdout and foo.txt is empty.
Performing the "set logging" commands manually behaves as expected (the output
is redirected).
This worked in GDB 8.0 (and many prior versions). This change in behaviour has
broken my custom .gdbinit hooks to implement colour backtraces (they redirect
the output to a file and then invoke a shell command to colourise it).
--
You are receiving this mail because:
You are on the CC list for the bug.