Re: [RFA][patch 1/9] Yet another respin of the patch with initial Python support

Daniel Jacobowitz
2008-08-02T17:38:07Z

On Sat, Jul 26, 2008 at 10:24:49PM +0300, Eli Zaretskii wrote:
> > What would you like explained?
>
> Why it is important to the manual reader to know that there's a module
> called `gdb', and that all methods and classes added by GDB are placed
> in that module. Suppose I didn't know that--what would I be missing
> as result, and what code would I get wrong?

You would not know that you had to 'import gdb' in any new modules you
wrote, that's all. This is obvious to a Python programmer from the
existence of the module.

Tom, the gdb module is automatically imported in executed Python
fragments, right? That may be worth an explicit mention.

On Fri, Aug 01, 2008 at 02:04:19PM -0600, Tom Tromey wrote:
> >>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
>
> [ gdb.show ]
> Daniel> I suggest "get" parallel to "set", then.
>
> I've been thinking about this, and on further reflection I think both
> "show" and "get" are too generic. How about "get_parameter"? I
> picked this because the manual refers to these entities as parameters
> at one point:
>
> @kindex info set
> To display all the settable parameters and their current
> values, you can use @code{show} with no arguments; you may also use

This sounds good.

> [ flush and write ]
> Daniel> Maybe we should move it to a new module gdb._internal then.
> Daniel> Tom, what do you think?
>
> I'm ambivalent about it. I don't see much harm in exposing and
> documenting these primitives. If it is what you want, though, I will
> do it. I suppose the wrapper class ought to go in _internal as well.

I'm happy to leave them where they are and document them.

How about replacing this:

> +Print a string to @value{GDBN}'s paginated standard output stream.
> +Ordinarily your program should not call this function directly; simply
> +print to @code{sys.stdout} as usual.

with:

Print a string to @value{GDBN}'s paginated standard output stream.
Writing to @code{sys.stdout} will automatically call this method.

--
Daniel Jacobowitz
CodeSourcery