diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2011-03-10 12:29:08 +0000 |
---|---|---|
committer | Phil Muldoon <pmuldoon@redhat.com> | 2011-03-10 12:29:08 +0000 |
commit | ecec24e64a26014ab55b1796c4027026b0b5659c (patch) | |
tree | 7712f689eb503f8e805662c5666cba7b976d2c30 /gdb/doc | |
parent | 6d6c6b1f5589004c390d66c18647656d87c9ae22 (diff) | |
download | gdb-ecec24e64a26014ab55b1796c4027026b0b5659c.zip gdb-ecec24e64a26014ab55b1796c4027026b0b5659c.tar.gz gdb-ecec24e64a26014ab55b1796c4027026b0b5659c.tar.bz2 |
2011-03-10 Phil Muldoon <pmuldoon@redhat.com>
* python/py-param.c (add_setshow_generic): Add set/show callback
parameters. Register Python object context.
(get_show_value): New function.
(get_set_value): New function.
(call_doc_function): New function.
(get_doc_string): Move behind get_show_value/get_set_value.
2011-03-10 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Parameters In Python): Document get_set_string and
get_show_string methods.
2011-03-10 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-parameter.exp: Update tests to the new Python
parameter API. Add "no documentation" test. Add deprecated API
backward compatibility test.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index d5d29a7..8edb4b7 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2011-03-10 Phil Muldoon <pmuldoon@redhat.com> + + * gdb.texinfo (Parameters In Python): Document get_set_string and + get_show_string methods. + 2011-02-28 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Tracepoint Conditions): Fix missing parenthesis. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index a5eaa72..4c07af9 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -22418,6 +22418,22 @@ parameter. It can be read and assigned to just as any other attribute. @value{GDBN} does validation when assignments are made. @end defivar +There are two methods that should be implemented in any +@code{Parameter} class. These are: + +@defop Operation {parameter} get_set_string self +@value{GDBN} will call this method when a @var{parameter}'s value has +been changed via the @code{set} API (for example, @kbd{set foo off}). +The @code{value} attribute has already been populated with the new +value and may be used in output. This method must return a string. +@end defop + +@defop Operation {parameter} get_show_string self svalue +@value{GDBN} will call this method when a @var{parameter}'s +@code{show} API has been invoked (for example, @kbd{show foo}). The +argument @code{svalue} receives the string representation of the +current value. This method must return a string. +@end defop When a new parameter is defined, its type must be specified. The available types are represented by constants defined in the @code{gdb} |