This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch 0/6] auto-load: intro


this is a reworked patchset posted as:
	[patch] New set auto-load-local-gdbinit + disable it by default

This patchset is also present as:

gdb/doc/ part is poor here, all the commands are now scattered across nodes,
there should be probably some new node about auto-loading in general being
referenced from various places.

	Extending GDB -> Python -> Auto-loading 
	 -> file
added there:	set auto-load python-scripts
added there:	objfile-gdb.rc file
	 -> .debug_gdb_scripts section
	 -> Which flavor to choose?

	Invocation -> Invoking GDB -> Startup
added there:	set auto-load local-gdbinit

	Running -> Threads
added there:	set auto-load libthread-db

New commands of this patchset:
	set            auto-load                off
	         info  auto-load
	set|show|info  auto-load gdb-scripts    on|off
	set|show|info  auto-load python-scripts on|off
	set|show|info  auto-load local-gdbinit  on|off|warn-and-on|warn-and-off
	set|show|info  auto-load libthread-db   on|off
	set|show       auto-load safe-path      <dir1>[:<dir2>...]
	set|show debug auto-load                on|off

Unless Eli suggests a new toplevel node/layout I will try to reshuffle the doc
myself for a new patchset post.

Suggested commandline option "-safe" was not introduced but one can substitute
it (for example in some bash alias) by: -iex "set auto-load off"

JIT currently does not autoload anything, one has to load a JIT reader
manually by "jit-reader-load".  Therefore JIT is off-topic for this patchset.

Besides implemented "{set|show|info} auto-load local-gdbinit" there could be
also implemented "system-gdbinit" and "home-gdbinit".  But those are off-topic
for this security patchset and those two can be easily added in the future.

"-nx" functionality is not affected by this patchset.

The most controversial may be the default './configure; make' somewhere in
$HOME will result in:
	$ ./gdb -q ./gdb
	Reading symbols from /home/user/src/gdb/gdb...done.
	warning: File "/home/user/src/gdb/gdb-gdb.rc" auto-loading has been declined by your `auto-load safe-path' set to "/usr/local".
	warning: File "/home/user/src/gdb/" auto-loading has been declined by your `auto-load safe-path' set to "/usr/local".
	(gdb) _
It is IMO valid this way.  One can workaround it either by
	$ ./gdb -iex 'set auto-load safe-path' -q ./gdb
or by:
	$ ./configure --without-auto-load-safe-path; make
Still I guess it will end up as --without-auto-load-safe-path being default with
distro builds specifying proper: --with-auto-load-safe-path=/usr:/bin:/lib:...
(specifically /home must not be present in --with-auto-load-safe-path )
But this would make custom GDB builds insecure by default which is also not

No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]