[PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory

Eli Zaretskii eliz@gnu.org
Thu Oct 4 17:07:00 GMT 2012

> Date: Thu, 4 Oct 2012 06:49:28 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: dje@google.com, khooyp@cs.umd.edu, jan.kratochvil@redhat.com,
> 	gdb-patches@sourceware.org
> > Why not?  Aren't there specific directories and/or files near the GDB
> > executable in this case?
> I have a feeling that this would open the door allowing attackers
> to setup GDB to execute unwanted code if we make it easy to reproduce
> the same environment and place GDB in a mode where it thinks it is
> inside a build directory.

Well, FWIW, Emacs uses a similar scheme (it tests for a couple of
files in specific directories around itself to decide whether it is
invoked without being installed), and I don't think anyone complained
about circumventions.

> But beyond this technical aspect, I am reluctant to add a mode to GDB
> that would then become useless to 99% of the people once GDB is properly
> installed. I don't think that the convenience it provides is important
> enough to justify it.

The question is: what's the price?  If the price is sufficiently low,
I don't see why you should be reluctant, even if you are right and 99%
of users will find this useless.  (FWIW, I almost always use GDB from
its build directory, I don't even know why.)

More information about the Gdb-patches mailing list