From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Christian Biesinger <cbiesinger@google.com>
Cc: Christian Biesinger via gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/3] Refactor get_init_files to use std::string
Date: Wed, 21 Aug 2019 17:34:00 -0000 [thread overview]
Message-ID: <87h86ajud6.fsf@redhat.com> (raw)
In-Reply-To: <CAPTJ0XF1T0xLFYXJgUjxG2cpzbcqjTH7jyHjZxKLD3iUxtZ1FQ@mail.gmail.com> (Christian Biesinger's message of "Wed, 21 Aug 2019 12:28:42 -0500")
On Wednesday, August 21 2019, Christian Biesinger wrote:
>> > - char *relocated_sysgdbinit;
>> > + std::string relocated_sysgdbinit;
>> >
>> > /* If SYSTEM_GDBINIT lives in data-directory, and data-directory
>> > has been provided, search for SYSTEM_GDBINIT there. */
>> > @@ -226,28 +225,30 @@ get_init_files (const char **system_gdbinit,
>> > {
>> > /* Append the part of SYSTEM_GDBINIT that follows GDB_DATADIR
>> > to gdb_datadir. */
>> > - char *tmp_sys_gdbinit = xstrdup (&SYSTEM_GDBINIT[datadir_len]);
>> > - char *p;
>> >
>> > - for (p = tmp_sys_gdbinit; IS_DIR_SEPARATOR (*p); ++p)
>> > + size_t start = datadir_len;
>> > + for (; IS_DIR_SEPARATOR (SYSTEM_GDBINIT[start]); ++start)
>> > continue;
>>
>> This seems wrong; you're starting the iteration from
>> 'SYSTEM_GDBINIT[start]', but 'start' is 'datadir_len'.
>
> The previous version first initialized tmp_sys_gdbinit to start from
> &SYSTEM_GDBINIT[datadir_len], so I think my change is correct (and
> simpler)?
Ah, right, now I see the '&SYSTEM_GDBINIT[datadir_len]' there. That
looks fine, then.
Thanks!
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
next prev parent reply other threads:[~2019-08-21 17:34 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 22:17 [PATCH 0/3] [RFC] Load gdbinit files from a directory Christian Biesinger via gdb-patches
2019-08-20 22:18 ` [PATCH 3/3] Load system " Christian Biesinger via gdb-patches
2019-08-21 17:32 ` Sergio Durigan Junior
2019-08-26 0:25 ` Christian Biesinger via gdb-patches
2019-08-26 0:33 ` [PATCH 3/3 v2] " Christian Biesinger via gdb-patches
2019-08-26 7:22 ` Eli Zaretskii
2019-09-12 22:12 ` Christian Biesinger via gdb-patches
2019-09-24 16:30 ` [PATCH 3/3 v3] " Christian Biesinger via gdb-patches
2019-10-03 18:42 ` Christian Biesinger via gdb-patches
2019-10-13 1:19 ` Christian Biesinger via gdb-patches
2019-08-21 18:15 ` [PATCH 3/3] " Sergio Durigan Junior
2019-08-21 18:46 ` Christian Biesinger via gdb-patches
2019-08-20 22:18 ` [PATCH 1/3] Refactor get_init_files to use std::string Christian Biesinger via gdb-patches
2019-08-21 17:13 ` Sergio Durigan Junior
2019-08-21 17:29 ` Christian Biesinger via gdb-patches
2019-08-21 17:31 ` [PATCH 1/3 v2] " Christian Biesinger via gdb-patches
2019-08-21 17:34 ` Sergio Durigan Junior [this message]
2019-08-20 22:18 ` [PATCH 2/3] Factor out the code to do the datadir-relocation for gdbinit Christian Biesinger via gdb-patches
2019-08-21 17:19 ` Sergio Durigan Junior
2019-08-21 17:44 ` Christian Biesinger via gdb-patches
2019-08-21 17:44 ` [PATCH 2/3 v2] " Christian Biesinger via gdb-patches
2019-08-21 17:47 ` [PATCH 2/3] " Sergio Durigan Junior
2019-08-21 18:08 ` Christian Biesinger via gdb-patches
2019-08-21 18:10 ` Sergio Durigan Junior
2019-08-21 18:13 ` [PATCH 0/3] [RFC] Load gdbinit files from a directory Pedro Alves
2019-08-21 18:33 ` Christian Biesinger via gdb-patches
2019-08-21 18:54 ` Sergio Durigan Junior
2019-08-25 22:24 ` Christian Biesinger via gdb-patches
2019-08-26 13:31 ` Pedro Alves
2019-09-12 22:14 ` Christian Biesinger via gdb-patches
2019-09-09 18:08 [PATCH 0/3] Refactor some path methods in main.c to use std::string Christian Biesinger via gdb-patches
2019-09-09 18:08 ` [PATCH 1/3] Refactor get_init_files " Christian Biesinger via gdb-patches
2019-09-10 15:02 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h86ajud6.fsf@redhat.com \
--to=sergiodj@redhat.com \
--cc=cbiesinger@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox