public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/16113] New: gdb.Value needs a way to reference a superclass sub-object
@ 2013-11-01 18:26 tromey at redhat dot com
2013-12-12 23:26 ` [Bug python/16113] " cvs-commit at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2013-11-01 18:26 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16113
Bug ID: 16113
Summary: gdb.Value needs a way to reference a superclass
sub-object
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: tromey at redhat dot com
Right now if you have a gdb.Value whose type is some class,
and the class has a superclass, then there is no good way
to refer to the phony "field" that gdb creates to represent
the superclass.
That is, for an ordinary field you can use value["fieldname"] --
but the superclass field doesn't have a regular name.
We should extend valpy_getitem to also accept a gdb.Field
as an index. This way a program could use the Type API to
find the superclass field, and then pass this to the [] operation
to extract the desired sub-object.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/16113] gdb.Value needs a way to reference a superclass sub-object
2013-11-01 18:26 [Bug python/16113] New: gdb.Value needs a way to reference a superclass sub-object tromey at redhat dot com
@ 2013-12-12 23:26 ` cvs-commit at gcc dot gnu.org
2013-12-13 19:25 ` tromey at redhat dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-12-12 23:26 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=16113
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via a16b0e220dfc49ed814e779d45faab84e31a4e42 (commit)
from ec0d6081a0144a61dfc79a10aaf2b96e29286180 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a16b0e220dfc49ed814e779d45faab84e31a4e42
commit a16b0e220dfc49ed814e779d45faab84e31a4e42
Author: Siva Chandra <sivachandra@chromium.org>
Date: Thu Dec 12 15:18:27 2013 -0800
2013-12-12 Siva Chandra Reddy <sivachandra@google.com>
PR python/16113
* NEWS (Python Scripting): Add entry for the new feature and the
new attribute of gdb.Field objects.
* python/py-type.c (gdbpy_is_field): New function
(convert_field): Add 'parent_type' attribute to gdb.Field
objects.
* python/py-value.c (valpy_getitem): Allow subscript value to be
a gdb.Field object.
(value_has_field): New function
(get_field_flag): New function
* python/python-internal.h (gdbpy_is_field): Add declaration.
testsuite/
* gdb.python/py-value-cc.cc: Improve test case.
* gdb.python/py-value-cc.exp: Add new tests to test usage of
gdb.Field objects as subscripts on gdb.Value objects.
doc/
* gdb.texinfo (Values From Inferior): Add a note about using
gdb.Field objects as subscripts on gdb.Value objects.
(Types In Python): Add description about the new attribute
"parent_type" of gdb.Field objects.
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 14 ++++
gdb/NEWS | 2 +
gdb/doc/ChangeLog | 8 ++
gdb/doc/gdb.texinfo | 16 ++++-
gdb/python/py-type.c | 15 ++++
gdb/python/py-value.c | 126 +++++++++++++++++++++++++++++-
gdb/python/python-internal.h | 1 +
gdb/testsuite/ChangeLog | 7 ++
gdb/testsuite/gdb.python/py-value-cc.cc | 30 +++++++
gdb/testsuite/gdb.python/py-value-cc.exp | 35 ++++++++
10 files changed, 251 insertions(+), 3 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/16113] gdb.Value needs a way to reference a superclass sub-object
2013-11-01 18:26 [Bug python/16113] New: gdb.Value needs a way to reference a superclass sub-object tromey at redhat dot com
2013-12-12 23:26 ` [Bug python/16113] " cvs-commit at gcc dot gnu.org
@ 2013-12-13 19:25 ` tromey at redhat dot com
2013-12-27 6:38 ` tromey at redhat dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2013-12-13 19:25 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16113
Tom Tromey <tromey at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |7.7
--- Comment #2 from Tom Tromey <tromey at redhat dot com> ---
Fixed
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/16113] gdb.Value needs a way to reference a superclass sub-object
2013-11-01 18:26 [Bug python/16113] New: gdb.Value needs a way to reference a superclass sub-object tromey at redhat dot com
2013-12-12 23:26 ` [Bug python/16113] " cvs-commit at gcc dot gnu.org
2013-12-13 19:25 ` tromey at redhat dot com
@ 2013-12-27 6:38 ` tromey at redhat dot com
2014-01-14 1:44 ` cvs-commit at gcc dot gnu.org
2014-01-15 13:12 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: tromey at redhat dot com @ 2013-12-27 6:38 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16113
Tom Tromey <tromey at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andre.poenitz at digia dot com
--- Comment #3 from Tom Tromey <tromey at redhat dot com> ---
*** Bug 15464 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/16113] gdb.Value needs a way to reference a superclass sub-object
2013-11-01 18:26 [Bug python/16113] New: gdb.Value needs a way to reference a superclass sub-object tromey at redhat dot com
` (2 preceding siblings ...)
2013-12-27 6:38 ` tromey at redhat dot com
@ 2014-01-14 1:44 ` cvs-commit at gcc dot gnu.org
2014-01-15 13:12 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-01-14 1:44 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=16113
--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via b5b08fb4ffa53ec088f8ad865bee0fd6edb2906f (commit)
from 13aaf454542c1028a033ac836d7a0d47c63a7029 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b5b08fb4ffa53ec088f8ad865bee0fd6edb2906f
commit b5b08fb4ffa53ec088f8ad865bee0fd6edb2906f
Author: Siva Chandra <sivachandra@chromium.org>
Date: Fri Dec 27 12:20:59 2013 -0800
Use bitpos and type to lookup a gdb.Field object when its name is 'None'.
PR python/15464
PR python/16113
* valops.c (value_struct_elt_bitpos): New function
* py-type.c (convert_field): Set 'name' attribute of a gdb.Field
object to 'None' if the field name is an empty string ("").
* python/py-value.c (valpy_getitem): Use 'bitpos' and 'type'
attribute to look for a field when 'name' is 'None'.
(get_field_type): New function
testsuite/
* gdb.python/py-type.c: Enhance test case.
* gdb.python/py-value-cc.cc: Likewise
* gdb.python/py-type.exp: Add new tests.
* gdb.python/py-value-cc.exp: Likewise
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 11 ++++
gdb/python/py-type.c | 15 ++++--
gdb/python/py-value.c | 80 ++++++++++++++++++++++++-----
gdb/testsuite/ChangeLog | 9 +++
gdb/testsuite/gdb.python/py-type.c | 9 +++
gdb/testsuite/gdb.python/py-type.exp | 9 +++
gdb/testsuite/gdb.python/py-value-cc.cc | 23 +++++++++
gdb/testsuite/gdb.python/py-value-cc.exp | 20 +++++++
gdb/valops.c | 45 +++++++++++++++++
gdb/value.h | 5 ++
10 files changed, 208 insertions(+), 18 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug python/16113] gdb.Value needs a way to reference a superclass sub-object
2013-11-01 18:26 [Bug python/16113] New: gdb.Value needs a way to reference a superclass sub-object tromey at redhat dot com
` (3 preceding siblings ...)
2014-01-14 1:44 ` cvs-commit at gcc dot gnu.org
@ 2014-01-15 13:12 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-01-15 13:12 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=16113
--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, gdb-7.7-branch has been updated
via 74e03f4a7024cf058b68999761f39df7e0606237 (commit)
via 9316c9e157cd0e61380a65d26259ad6dec1907d4 (commit)
via 2afbe22710d4c747cb5bec639cd1c2a699c17068 (commit)
from f96d41e073bde8b376982228758e2d708777936d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=74e03f4a7024cf058b68999761f39df7e0606237
commit 74e03f4a7024cf058b68999761f39df7e0606237
Author: Joel Brobecker <brobecker@adacore.com>
Date: Wed Jan 15 16:40:22 2014 +0400
Fix small style violation in py-value.c:get_field_type
gdb/ChangeLog:
* python/py-value.c (get_field_type): Remove unnecessary curly
braces for single-statement if block.
Tested on x86_64-linux.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9316c9e157cd0e61380a65d26259ad6dec1907d4
commit 9316c9e157cd0e61380a65d26259ad6dec1907d4
Author: Joel Brobecker <brobecker@adacore.com>
Date: Wed Jan 15 16:28:08 2014 +0400
Add missing empty line after declarations in "if" block (py-type.c).
This patch fixes a small coding-style violation...
gdb/ChangeLog:
* python/py-type.c (convert_field): Add missing empty line
after declarations.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2afbe22710d4c747cb5bec639cd1c2a699c17068
commit 2afbe22710d4c747cb5bec639cd1c2a699c17068
Author: Siva Chandra <sivachandra@chromium.org>
Date: Fri Dec 27 12:20:59 2013 -0800
Use bitpos and type to lookup a gdb.Field object when its name is 'None'.
PR python/15464
PR python/16113
* valops.c (value_struct_elt_bitpos): New function
* py-type.c (convert_field): Set 'name' attribute of a gdb.Field
object to 'None' if the field name is an empty string ("").
* python/py-value.c (valpy_getitem): Use 'bitpos' and 'type'
attribute to look for a field when 'name' is 'None'.
(get_field_type): New function
testsuite/
* gdb.python/py-type.c: Enhance test case.
* gdb.python/py-value-cc.cc: Likewise
* gdb.python/py-type.exp: Add new tests.
* gdb.python/py-value-cc.exp: Likewise
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 21 ++++++++
gdb/python/py-type.c | 16 +++++--
gdb/python/py-value.c | 78 ++++++++++++++++++++++++-----
gdb/testsuite/ChangeLog | 9 ++++
gdb/testsuite/gdb.python/py-type.c | 9 ++++
gdb/testsuite/gdb.python/py-type.exp | 9 ++++
gdb/testsuite/gdb.python/py-value-cc.cc | 23 +++++++++
gdb/testsuite/gdb.python/py-value-cc.exp | 20 ++++++++
gdb/valops.c | 45 +++++++++++++++++
gdb/value.h | 5 ++
10 files changed, 217 insertions(+), 18 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-01-15 13:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-01 18:26 [Bug python/16113] New: gdb.Value needs a way to reference a superclass sub-object tromey at redhat dot com
2013-12-12 23:26 ` [Bug python/16113] " cvs-commit at gcc dot gnu.org
2013-12-13 19:25 ` tromey at redhat dot com
2013-12-27 6:38 ` tromey at redhat dot com
2014-01-14 1:44 ` cvs-commit at gcc dot gnu.org
2014-01-15 13:12 ` cvs-commit at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).