[patch] New set auto-load-local-gdbinit + disable it by default

Jan Kratochvil jan.kratochvil@redhat.com
Tue Jan 17 17:55:00 GMT 2012


On Tue, 17 Jan 2012 18:26:49 +0100, Doug Evans wrote:
> I, OTOH, like the (top-gdb) prompt.

I think you and me can very easily do whatever we like with GDB.  I care more
about both newbie users of GDB and also about newcomers to GDB development.


> One could argue the converse too ... Having to manually request
> whatever goodies the developers find useful adds a needless burden.
> Why can't gdb just auto-adjust itself for debugging the program at
> hand?

Because it is then different than normal GDB.

It is difficult to argue myself but IMO in a survey between GDB newbies they
find easier if GDB behaves always the same than if it behaves differently
according to which program you load into it.


> There is the path that gdb searches for libthread_db, maybe you meant
> to refer to that;

Yes, I meant this part.


> one can change it before choosing the file to debug.   You seem to
> suggest that -nx was "good enough" before.  If that was good enough
> before (and that's a big "if"), why is changing the search path first
> not also "good enough".

Now instead of just -nx one has to use also "set auto-load-scripts off",
use -ex "file X" and -ex "core-file Y" instead of just X and Y to get that
"set auto-load-scripts off" executed first,
use beforehand -ex "set libthread-db-search-path /foo", OK, that may be enough
if I did not miss anything else.

I admit I did not know about "set auto-load-scripts off" myself until
recently.


> As for Python auto-loading, if -nx was good enough before (and if one
> *really* wanted to run gdb in a security hardened environment one
> would use a secured VM or some such anyway ...), then why isn't
> turning off auto-loading of Python scripts ahead of time also good
> enough?

Yes, it is, it is just too complicated, similiar to the extra VM.  I plan to
just merge the paragraph above into some user-accessible command-line option
"-safe".  I am just not sure how to load pretty printers from system libraries
which are safe but which do not get loaded after "set auto-load-scripts off".


Thanks,
Jan



More information about the Gdb-patches mailing list