From: Doug Evans <dje@google.com>
To: gdb-patches@sourceware.org
Subject: Why do functions objfpy_new and pspy_new exist?
Date: Wed, 24 Sep 2014 21:38:00 -0000 [thread overview]
Message-ID: <yjt2fvfgr95t.fsf@ruffy.mtv.corp.google.com> (raw)
Hi.
Normally, python wrappers of gdb objects are created with a
foo_to_foo_object function.
E.g., objfile_to_objfile_object and pspace_to_pspace_object.
So why do objfpy_new and pspy_new exist?
[defined in py-objfile.c and py-progspace.c respectively]
IOW, when would one ever usefully do something with
foo_objfile = gdb.Objfile()
or
foo_pspace = gdb.Progspace()
?
This question applies to pretty much every gdb object that can be
wrapped by Python. I can imagine maybe a few objects where it would
be useful to create non-gdb-wrapped python objects of some type.
But I'd expect such cases to be rare.
Am I missing something?
I ask because we've got some duplicated code, two copies of the
gdb.Objfile and gdb.Progspace constructors
(objfpy_new + objfile_to_objfile_object,
and pspy_new + pspace_to_pspace_object),
and I think some cleanup is in order.
next reply other threads:[~2014-09-24 21:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 21:38 Doug Evans [this message]
2014-09-25 10:09 ` Phil Muldoon
2014-09-25 15:18 ` Paul_Koning
2014-09-25 21:29 ` Phil Muldoon
2014-09-25 22:07 ` Doug Evans
2014-10-01 18:10 ` Phil Muldoon
2014-10-02 22:11 ` Stan Shebs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yjt2fvfgr95t.fsf@ruffy.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox