From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Doug Evans <dje@google.com>, gdb-patches@sourceware.org
Subject: Re: [patch] python: save/restore/fix error state
Date: Tue, 12 Oct 2010 19:55:00 -0000 [thread overview]
Message-ID: <m3eibvi3th.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20101009203945.GA12979@host1.dyn.jankratochvil.net> (Jan Kratochvil's message of "Sat, 9 Oct 2010 22:39:45 +0200")
Jan> - docstring = python_string_to_host_string (ds_obj);
Jan> + {
Jan> + docstring = python_string_to_host_string (ds_obj);
Jan> + if (docstring == NULL)
Jan> + {
Jan> + xfree (cmd_name);
Jan> + xfree (pfx_name);
Jan> + return -1;
It seems to me that inability to convert the docstring shouldn't be a
fatal problem for command registration. We can just fall back to the
no-docstring code.
This occurs a couple of times.
Jan> - self->value.stringval = python_string_to_host_string (value);
Jan> + {
Jan> + self->value.stringval = python_string_to_host_string (value);
Jan> + if (self->value.stringval == NULL)
Jan> + return -1;
Jan> + }
I think this should probably convert to a temporary variable before
assigning to self->value.
The rest looks good to me. Thanks for doing this.
We were recently kicking around the idea of using Cython to write this
layer. It has one nice advantage over doing it by hand: it handles
reference counting and error checking automatically. It isn't clear it
can be made to work for gdb, though :(
Tom
next prev parent reply other threads:[~2010-10-12 19:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-08 19:12 [patch] python(+solib error): save/restore " Jan Kratochvil
2010-10-08 20:08 ` Doug Evans
2010-10-08 20:20 ` Doug Evans
2010-10-08 21:27 ` Tom Tromey
2010-10-08 21:35 ` Doug Evans
2010-10-09 20:40 ` [patch] python: save/restore/fix " Jan Kratochvil
2010-10-12 19:55 ` Tom Tromey [this message]
2010-10-12 21:08 ` Jan Kratochvil
2010-10-12 21:39 ` Tom Tromey
2010-10-13 13:28 ` Jan Kratochvil
2010-10-13 15:38 ` Tom Tromey
2010-10-13 15:58 ` Jan Kratochvil
2010-10-13 18:46 ` Tom Tromey
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=m3eibvi3th.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/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