Re: [PATCH 4/7] PR gdb/15224 should "set history save on" by default

Pedro Alves
2013-05-09T12:05:35Z

On 05/09/2013 12:12 PM, mbilal wrote:
> On Wednesday, May 08, 2013 10:14 PM pedro Alves wrote:
>
>>> - set INTERNAL_GDBFLAGS "-nw -nx -data-directory $BUILD_DATA_DIRECTORY"
>>> + set INTERNAL_GDBFLAGS "-nw -nx -ex set\\ history\\ save\\ off -data-directory $BUILD_DATA_DIRECTORY"
>
>>spurious space? ------^^
>
> Fixed.

BTW, I think:

set INTERNAL_GDBFLAGS "-nw -nx -ex \"set history save off\" -data-directory $BUILD_DATA_DIRECTORY"

would be easier to read (and write).

>>> +#We are always disable history saving on testsuite
>>> #test set history save
>>> -gdb_test_no_output "set history save" "set history save"
>>> +#gdb_test_no_output "set history save" "set history save"
>>> #test set history size
>
>>I don't understand this. Why disable the test?
>
> We are disabling the history saving on all testsuit, if we run the above
> testsuit then history saving becomes enable that will also writes the history
> command on .gdb_history file. That's why I disabled this test case.

So that's a preexisting bug, that triggers even if GDB's
default isn't changed, right? Let's fix it first, before the default is
changed, in its own patch. Please send it as a new thread (i.e., not in
reply to this thread, in a message that includes a self-contained
description of the rationale for the change, and a concise Subject:.

I suggest perusing these guidelines that although written for the
Linux kernel, can be transcribed to lots of other projects as well:
<http://www.linux-mips.org/wiki/Submitting_Patches>

Instead of disabling the test completely, I suggest re-disabling
history saving immediately afterwards:

gdb_test_no_output "set history save" "set history save"
+gdb_test_no_output "set history save off" "set history save off"

--
Pedro Alves