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: [RFA][python] Add program space support


On Wed, Apr 7, 2010 at 10:52 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Wed, ?7 Apr 2010 10:32:22 -0700 (PDT)
>> From: dje@google.com (Doug Evans)
>>
>> This patch adds basic support for program spaces to python.
>
> Thanks. ?A few comments to the patch for the manual:
>
>> ? ? ? doc/
>> ? ? ? * gdb.texinfo (Python API): Add progspaces section.
>> ? ? ? (Selecting Pretty-Printers): Progspace pretty-printers are
>> ? ? ? searched too.
>
> This lacks an entry for the new section you added.

Fixed.

>> +@node Progspaces In Python
>> +@subsubsection Progspaces In Python
>
> It is okay to use shorthands in node names, but for the section name
> I'd prefer to use "Program Spaces", the full name. ?There's no
> requirement for the two to be identical.

Fixed.

>> +A program space, or ``progspace'', represents a symbolic view
> ? ? ? ? ? ? ? ? ? ? ? ^^^^^^^^^^^^^
> Please use @dfn{progspace} here, it is specifically designed for
> introducing new terminology. ?It produces the same quoted string in
> Info as ``..'', but looks prettier in the printed version.

Fixed.

>> +A program space, or ``progspace'', represents a symbolic view
>> +of an address space.
>
> An @xref here to where program spaces are described would be useful.

There is no existing section describing program spaces and I wouldn't
know what to say beyond what I've already written.
Suggestions?  We *could* leave it as is for now.

>> +@findex gdb.current_progspace
>> +@defun current_progspace
>> +This function returns the program space of the currently selected inferior.
>
> Is this a function or a method? ?If the latter, we have @defmethod to
> DTRT.

Function.

> Okay with those changes.
>
> Thanks.

Here is the revised patch.

gdb-patches: I will check this in tomorrow if there are no further objections.

2010-04-08  Doug Evans  <dje@google.com>

        * NEWS: Add entry for python program space support.
        * Makefile.in (SUBDIR_PYTHON_OBS): Add py-progspace.o.
        (SUBDIR_PYTHON_SRCS): Add py-progspace.c.
        (py-progspace.o): New rule.
        * python/py-prettyprint.c (find_pretty_printer_from_objfiles): New
        function.
        (find_pretty_printer_from_progspace): New function.
        (find_pretty_printer_from_gdb): New function.
        (find_pretty_printer): Rewrite.
        * python/py-progspace.c: New file.
        * python/python-internal.h (program_space): Add forward decl.
        (pspace_to_pspace_object, pspy_get_printers): Declare.
        (gdbpy_initialize_pspace): Declare.
        * python/python.c: #include "progspace.h".
        (gdbpy_get_current_progspace, gdbpy_progspaces): New functions.
        (_initialize_python): Call gdbpy_initialize_pspace.
        (GdbMethods): Add current_progspace, progspaces.

        doc/
        * gdb.texinfo (Python API): Add progspaces section.
        (Selecting Pretty-Printers): Progspace pretty-printers are
        searched too.
        (Progspaces In Python): New section.

        testsuite/
        * gdb.python/py-progspace.c: New file.
        * gdb.python/py-progspace.exp: New file.

Attachment: gdb-100408-python-progspace-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]