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]

Re: [RFC] Make "directories" a variable

On Mon, Oct 5, 2009 at 7:10 PM, Doug Evans <> wrote:
> Hi.
> I needed to be able to reference source_path from python,
> but it's not possible today because it's not a parameter
> (in the python gdb.parameter sense, and the alternative
> of adding a patch to allow capturing the output of "show dir"
> feels like a hack).
> This patch makes it a parameter,
> and I'm looking for early feedback on this approach.
> I like the addition of "set directories mumble", but that's just me,
> and I know better than to be wedded to it. :-)
> An alternative is to making directories a variable without a setter,
> or have "set dir mumble" flag an error and referring the user to
> the "dir" command.
> The way I look at it, "dir" is just a wrapper around "set dir".
> Today "set dir" is "private/protected" (so to speak), and the public
> interface is the "dir" command.
> I don't have a strong opinion on making "set dir" "public", but
> I do think, though, that source_path should be a parameter.
> There's no current entry for "directory search list" in
> enum var_types, but there are at least two variables that
> are directory search lists (directories and libthread-db-search-path).
> Adding enum var_dir_search_list (or some such) is a reasonable way to go.
> I haven't done that yet pending approval of making "directories" a
> parameter.
> Tom suggested in IRC returning a list in python.
> I don't have a strong opinion on that either,
> it's trivial for the user to work with either form.
> doc updates also deferred pending positive feedback.

Heh. add_path is smarter than I thought.
Here is a revised patch (a little bit simpler).

Attachment: gdb-091006-dir-param-2.patch.txt
Description: Text document

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