Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Khoo Yit Phang <khooyp@cs.umd.edu>,
	Jan Kratochvil <jan.kratochvil@redhat.com>,
		GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory
Date: Thu, 04 Oct 2012 00:50:00 -0000	[thread overview]
Message-ID: <CADPb22TcGqvuxKo5_t8zuwNiJyUL4Yp38zA0OXcX_Dbv9bmyNQ@mail.gmail.com> (raw)
In-Reply-To: <20121004000840.GI3028@adacore.com>

On Wed, Oct 3, 2012 at 5:08 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> > Does anyone have any objection to this approach in principle?
>>
>> I'm not entirely comfortable with this yet, but I might be persuaded.
>
> I have to admit that I have been having second thoughts as well,
> trying to figure out all the implications of this change.
>
>> Alternative: Is there a robust enough test to determine gdb is being
>> run from its build directory?
>
> I don't see a robust way to determine that we are bing run from
> the build directory. I kind of see this approach as riskier than
> the first one.
>
> I've been mulling over the following two options:
>
>   1. Go with the idea of installing the data-directory inside the build
>      directory". But this assumes that the data-directory is relocatable,
>      and that it is a subdirectory of the prefix. If that's not the case,
>      then I think "make all" could end up installing the data-directory
>      at the configured location, outside the build directory. It seems
>      like an innocent thing, but in the end, I think it's bad - almost
>      sneaky.  I'd probably be the first one to curse if that happened
>      to me.

I think(!) this "can't happen" (if I understand the patch correctly),
the installed directory will always be a subdir of $(top_builddir)/..
It may be a useless subdirectory of $(top_builddir)/.., but at least
it's in the build tree. :-)
[Again, assuming I understand the patch correctly.]

>   2. Accept the new situation, and configure with a --prefix somewhere
>      in the build directory. I can do an install the first time, and
>      then as needed based on what changes have been made since the
>      last install...

Not sure I understand, but for reference sake,
Our builds always do a "make install" into a staging area, though we
configure --prefix=/usr.

i.e. make install DESTDIR=$build/foo
[puts the entire gdb install tree in $build/foo/usr]

And, given gdb's relocatability, it "just works" (we configure with
values for --with-gdb-datadir and --with-system-gdbinit that are
relocatable).

One still can't run gdb from the build directory (without explicitly
passing --data-directory=foo), one needs to run gdb from the staging
area, but it lets us test without having to do a "make install" into
$prefix (e.g. /usr).
[Which isn't to say we don't also test the gdb installed in $prefix.]

> It's a pain in the neck, but I think I have slowly been coming to
> the conclusion that it is probably best for me, and the others who
> were relying on this undocumented feature, to learn to live with
> the new requirement. At least we tried...

I'd be ok with a short option that said "I'm running from the build
directory, deal with it." :-)
E..g,
bash$ ./gdb -b
[alas -b is taken, but I hope you get the idea]

It's typed often enough that I can see myself getting use to it,
instead of forever avoiding "./gdb
--data-directory=$(pwd)/data-directory" because it's just too much to
type (even "make install DESTDIR=/foo" is too much to type after doing
"make" each and every time).
OTOH, one can always alias it: alias bgdb="./gdb --data-directory=foo"
(but that doesn't help debugging ./gdb in emacs).

Another wild idea is to rename the gdb in the build directory as xgdb
(akin to xgcc).  One could key off that to know gdb is being run from
the build directory.

btw, Is there a use-case of yours that I'm missing?


  reply	other threads:[~2012-10-04  0:50 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 20:33 [PATCH] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary Khoo Yit Phang
2012-09-19 13:01 ` Jan Kratochvil
2012-09-19 19:53   ` [PATCH 1/2]: Refactor relocate_path to also check if the relocated file/directory exists Khoo Yit Phang
2012-09-21 18:27     ` Jan Kratochvil
2012-09-21 18:36       ` Eli Zaretskii
2012-09-21 18:46         ` Jan Kratochvil
2012-09-21 18:59           ` Eli Zaretskii
2012-09-21 19:09           ` Andreas Schwab
2012-09-22 16:07             ` Khoo Yit Phang
2012-09-25  6:59               ` Jan Kratochvil
2012-09-19 19:56   ` [PATCH 2/2] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary Khoo Yit Phang
2012-09-21 18:31     ` Jan Kratochvil
2012-09-21 19:05       ` Khoo Yit Phang
2012-09-22 11:08         ` Jan Kratochvil
2012-09-22 15:50           ` Khoo Yit Phang
2012-09-24  7:30             ` Joel Brobecker
2012-09-24 13:14               ` Khoo Yit Phang
2012-09-24 14:24                 ` Eli Zaretskii
2012-09-24 14:37                   ` Khoo Yit Phang
2012-09-24 14:51                     ` Eli Zaretskii
2012-09-24 15:00                       ` Khoo Yit Phang
2012-09-24 15:27                         ` Khoo Yit Phang
2012-09-24 15:49                           ` Eli Zaretskii
2012-09-24 14:59                 ` Joel Brobecker
2012-09-24 15:08                   ` Khoo Yit Phang
2012-09-24 15:09                   ` Eli Zaretskii
2012-09-24 15:12                   ` Khoo Yit Phang
2012-09-24 15:27                     ` Joel Brobecker
2012-09-24 16:10                       ` Khoo Yit Phang
2012-09-24 16:45                         ` Khoo Yit Phang
2012-09-24 17:04                           ` Joel Brobecker
2012-09-24 19:19                             ` [PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory Khoo Yit Phang
2012-09-27  9:17                               ` Joel Brobecker
2012-09-27 14:57                                 ` Khoo Yit Phang
2012-10-03 21:31                                 ` Doug Evans
2012-10-04  0:09                                   ` Joel Brobecker
2012-10-04  0:50                                     ` Doug Evans [this message]
2012-10-04  1:34                                       ` Joel Brobecker
2012-10-04  3:41                                         ` Khoo Yit Phang
2012-10-04 13:39                                           ` Joel Brobecker
2012-10-04 14:26                                           ` Doug Evans
2012-10-04 14:25                                         ` Doug Evans
2012-10-04 14:51                                           ` Joel Brobecker
2012-10-04 15:07                                             ` Doug Evans
2012-10-04 15:28                                               ` Joel Brobecker
2012-10-06 19:02                                               ` Khoo Yit Phang
2012-10-06 19:25                                                 ` Eli Zaretskii
2012-10-06 19:36                                                   ` Khoo Yit Phang
2012-10-06 20:07                                                     ` Eli Zaretskii
2012-10-06 20:12                                                       ` Khoo Yit Phang
2012-10-06 20:29                                                         ` Eli Zaretskii
2012-10-06 20:32                                                           ` Khoo Yit Phang
2012-10-06 21:00                                                             ` Eli Zaretskii
2012-10-08 16:33                                                 ` Doug Evans
2012-10-08 20:13                                                   ` Khoo Yit Phang
2012-10-08 20:24                                                     ` Doug Evans
2012-10-09  5:48                                                   ` Joel Brobecker
2012-10-09 16:49                                                     ` Eli Zaretskii
2012-10-04  3:43                                     ` Eli Zaretskii
2012-10-04 13:49                                       ` Joel Brobecker
2012-10-04 14:48                                         ` Doug Evans
2012-10-04 15:23                                           ` Doug Evans
2012-10-04 17:07                                         ` Eli Zaretskii
2012-09-24 18:12                           ` [PATCH 2/2] Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary Eli Zaretskii
2012-09-24 20:49                             ` Joel Brobecker
2012-09-24 21:08                               ` Eli Zaretskii
2012-09-24 21:37                                 ` Joel Brobecker
2012-09-25  6:29                                   ` Eli Zaretskii
2012-09-25  6:35                                     ` Joel Brobecker
2012-09-25  6:50                                       ` Eli Zaretskii
2012-09-25  7:02                                         ` Joel Brobecker
2012-09-24 18:11                         ` Eli Zaretskii

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=CADPb22TcGqvuxKo5_t8zuwNiJyUL4Yp38zA0OXcX_Dbv9bmyNQ@mail.gmail.com \
    --to=dje@google.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=khooyp@cs.umd.edu \
    /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