This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[review v3] Load system gdbinit files from a directory
- From: "Simon Marchi (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: Christian Biesinger <cbiesinger at google dot com>, gdb-patches at sourceware dot org
- Cc: Tom de Vries <tdevries at suse dot de>
- Date: Tue, 22 Oct 2019 23:53:21 -0400
- Subject: [review v3] Load system gdbinit files from a directory
- Auto-submitted: auto-generated
- References: <gerrit.1570968845000.If233859ecc21bc6421d589b37cd658a3c7d030f2@gnutoolchain-gerrit.osci.io>
- Reply-to: simon dot marchi at polymtl dot ca, tdevries at suse dot de, cbiesinger at google dot com, gdb-patches at sourceware dot org
Simon Marchi has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/26
......................................................................
Patch Set 3:
(4 comments)
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/26/3/gdb/main.c
File gdb/main.c:
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/26/3/gdb/main.c@265
PS3, Line 265: DIR *dir = nullptr;
gdb_dir_up?
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/26/3/gdb/main.c@268
PS3, Line 268: if (dir != nullptr)
Why not
if (!relocated_gdbinit_dir.empty ()
{
DIR *dir = opendir (...);
if (dir != nullptr)
{
...
}
}
Is it to save an indentation level?
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/26/3/gdb/main.c@277
PS3, Line 277: if (ent->d_name[0] == '.')
I know that's for skipping . and .., but that will skip all files starting with a dot ("hidden files"). I don't think it's documented that these will be skipped, is it?
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/26/3/gdb/main.c@1039
PS3, Line 1039: ret = catch_command_errors (source_script, file.c_str (), 0);
It's weird that ret is set but almost never checked throughout this function...