This is the mail archive of the gdb-patches@sourceware.org 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]

Re: [patch#2 2/6] set auto-load * main part


On Fri, 30 Mar 2012 09:19:02 +0200, Eli Zaretskii wrote:
> > +    add_prefix_cmd ("auto-load", class_info, info_auto_load_cmd, _("\
> > +Print current status of auto-loaded files\n\
> > +Print whether various files like Python scripts or .gdbinit files have been\n\
> > +found and/or loaded"),
> 
> "Print" or "display"? or maybe "show"?

Cannot properly differentiate.

> The latter 2 is more accurate, but if we generally use "print" elsewhere,
> I'm fine with that, for consistency.

Yes, ^Print is used thoroughly the GDB commands helps.


> > +@node Auto-loading
> > +@section Automatically loading associated files
> 
> "@cindex auto-loading" would be good here.

Done.  Therefore also changed now:
	@node Python Auto-loading
	@subsection Python Auto-loading
	@cindex auto-loading, Python
	->
	@cindex Python auto-loading, Python


> In general, it is frequently a good idea to have a @cindex entry at the
> beginning of each node whose wording is the name of the node or the section.

Therefore added or adjusted these @cindex-es:

@node Auto-loading
@section Automatically loading associated files
@cindex auto-loading

@node Current Directory Init File
@subsection Automatically loading current directory init file
@cindex auto-loading current directory init file

@node libthread_db.so.1 file
@subsection Automatically loading thread debugging library
@cindex auto-loading libthread_db.so.1

@node objfile-gdb.gdb file
@subsection The @file{@var{objfile}-gdb.gdb} file
@cindex auto-loading @file{@var{objfile}-gdb.gdb}

@node Python Auto-loading
@subsection Python Auto-loading
@cindex Python auto-loading, Python

@node Auto-loading safe path
@subsection Security restriction for auto-loading
@cindex auto-loading safe-path

@node Auto-loading verbose mode
@subsection Displaying files tried for auto-load
@cindex auto-loading verbose mode

For:
@cindex print list of auto-loaded canned sequences of commands scripts.
removed the dot
@cindex print list of auto-loaded canned sequences of commands scripts
(although the dot it is present at some other existing places)


> > +As @value{GDBN} reads some of the files automatically, without being explicitly
> > +told so by the user, it may bring some unexpected @value{GDBN} behavior or even
> > +security risks if some files come from untrusted sources.
> 
> That begs the question: if this is so bad, why do you give us this
> risky feature?

This is always about convenience vs. security.  See all the .exe funny
programs people run from e-mail attachments - because it is convenient.

I am probably biased as I was always disabling all the GDB auto-loadings and
explicitly loading what I wanted, even when security was not a concern.
Personally I find the auto-loading inconvenient in general, it may bias the
documentation I wrote.


> >                 You should use also the @ref{-nx} option to forbid
> > +reading very every auto-loaded file.
> 
> I don't understand the "should" part.  Did you mean "could"?

Yes, used "could".


> Also, there's a typo ("very every").

FYI it was not a typo, probably just my Engrish.


> I suggest "... to prevent @value{GDBN} from reading any auto-loaded files"
> instead.

I think the meaning is not right now.

There are three categories of files:

1. /etc/gdbinit (system gdbinit) and ~/.gdbinit:
   They can be disabled only by -nx.
2. Current directory .gdbinit
   They can be disabled either by -nx or by 'set auto-load local-gdbinit no'.
3. Files like objfile-gdb.py or libthread_db.so.1
   These can be disabled only by 'set auto-load no' (or more specific variants).

There exists currently no 'set auto-load system-gdbinit'
or 'set auto-load home-gdbinit' so the option -nx still needs to be used in
some cases.

Using -nx will not disable for example the objfile-gdb.py loading.

The current paragraph

# Be aware that system init file (@pxref{System-wide configuration})
# and init files from your home directory (@pxref{Home Directory Init File})
# still get read still get read (as they come from generally trusted
# directories).  You could use also the @ref{-nx} option to prevent @value{GDBN}
# from reading any auto-loaded files instead.

IMO says that -nx will disable even objfile-gdb.py, libthread_db.so.1 etc.
auto-loading.  Or at least it is ambiguous in such way.


> > +@smallexample
> > +(gdb) info auto-load
> > +gdb-scripts:  Loaded  Script                                                                 
> > +Yes     /home/user/gdb/gdb-gdb.rc                         
> 
> This is a strange layout, and I'm quite sure it will look wrong in
> Info (as the trailing whitespace won't do what you think).  Can you
> show how this display is supposed to look like on the screen?

The trailing spaces are fixed now.  (Trailing spaces appear in GDB output in
general but that is really outside of the scope of this patchset.)

The table header was not properly aligned for "info auto-load" while it was
right for the specific commands like "info auto-load gdb-scripts".  The code is
no longer much nice (introduced there #define INFO_AUTO_LOAD hack) but I agree
the layout looks much better now.

Fixed therefore also the doc:

@smallexample
(gdb) info auto-load
gdb-scripts:  
Loaded  Script
Yes     /home/user/gdb/gdb-gdb.gdb
libthread-db:  No auto-loaded libthread-db.
local-gdbinit:  Local .gdbinit file "/home/user/gdb/.gdbinit" has been loaded.
python-scripts:  
Loaded  Script
Yes     /home/user/gdb/gdb-gdb.py
@end smallexample


> > +@multitable {@xref{dotdebug_gdb_scripts section}.} {See @ref{set auto-load python-scripts}}
> > +@item @xref{objfile-gdb.py file}.
> > +@tab See @ref{set auto-load python-scripts}.
> 
> Does this table with 2 cross-references on each line look good in the
> Info manual?

IMO it looks great:

*Note objfile-gdb.py file::.            See *note set auto-load python-scripts::.
*Note objfile-gdb.gdb file::.           See *note set auto-load gdb-scripts::.
*Note dotdebug_gdb_scripts section::.   See *note set auto-load python-scripts::.
*Note Current Directory Init File::.    See *note set auto-load local-gdbinit::.
*Note libthread_db.so.1 file::.         See *note set auto-load libthread-db::.

That "Note" and "note" are excessive there but I could not get rid of them.
I wanted to have there something like @menu but @menu is very special and
I cannot have arbitrary number of @menus inside the @node, moreover to
reference arbitrary @nodes in the document.  So I found @multitable to be the
most close to @menu one can get.

It looks even slightly better in PDF.


> > +@menu
> > +* Current Directory Init File::  @samp{set/show/info auto-load local-gdbinit}
> > +* libthread_db.so.1 file::       @samp{set/show/info auto-load libthread-db}
> > +* objfile-gdb.rc file::          @samp{set/show/info auto-load gdb-script}
> > +@xref{Python Auto-loading}.
> 
> Do the node names with periods work well in the stand-alone Info
> reader?  I think the Texinfo manual discourages the use of periods in
> node names, because the stand-alone reader cannot cope with them.  But
> if it can, I'm fine with this.

Yes they work OK.  Only the leading dot did not work which is fixed now.


> The last sentence seems to be a copy/paste from another place...
+
> And likewise the text in this @table (although the @item text was
> edited correctly).

Thanks for cathing it, wrote this new section content now.



Thanks,
Jan


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