[gdb] Don't init history in batch mode
commit1b2c120daf9e2d935453f9051bbeafbac7f9f14d
authorTom de Vries <tdevries@suse.de>
Tue, 20 Feb 2024 14:49:33 +0000 (20 15:49 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 20 Feb 2024 14:49:33 +0000 (20 15:49 +0100)
treec9d6fed6cdf7719117accb2cf1d42b614d2a5d26
parent9012a09f4f33fa38596c85f5c7fb442548f5e55c
[gdb] Don't init history in batch mode

I noticed in captured_main_1 that init_history is called just before bailing
out if batch_flag is true.

The history is used only in an interactive session, so there's no need to
initialize it in batch mode.

Fix this by moving init_history to after the batch mode check.

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/main.c