Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
Cc: Christian Biesinger <cbiesinger@google.com>
Subject: Re: [PATCH] Add block['var'] accessor
Date: Fri, 02 Aug 2019 13:36:00 -0000	[thread overview]
Message-ID: <87y30bit95.fsf@tromey.com> (raw)
In-Reply-To: <20190801223420.234581-1-cbiesinger@google.com> (Christian	Biesinger via gdb-patches's message of "Thu, 1 Aug 2019 17:34:20	-0500")

>>>>> "Christian" == Christian Biesinger via gdb-patches <gdb-patches@sourceware.org> writes:

Christian> 2019-08-01  Christian Biesinger  <cbiesinger@google.com>

Christian> 	* NEWS: Mention dictionary access on blocks.
Christian> 	* python/py-block.c (blpy_getitem): New function.
Christian>   (block_object_as_mapping): New struct.
Christian>   (block_object_type): Use new struct for tp_as_mapping field.

Thank you for the patch.

Christian> +  struct symbol *sym = block_lookup_symbol (
Christian> +    block, name.get(), symbol_name_match_type::FULL, VAR_DOMAIN);

What about looking up things in other domains?  I wonder if it's
possible to, say, have a local type that can be found by iteration over
the block but not by dictionary access.  If so, that seems confusing.

Christian> +  if (!sym) {
Christian> +    PyErr_SetObject (PyExc_KeyError, key);
Christian> +    return nullptr;
Christian> +  }

The formatting here is incorrect.  The call to block_lookup_symbol looks
weird (gdb doesn't generally use trailing parens like that), and the
brace after the "if" is misplaced.

Tom


  parent reply	other threads:[~2019-08-02 13:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 22:34 Christian Biesinger via gdb-patches
2019-08-02  7:01 ` Eli Zaretskii
2019-08-02 13:36 ` Tom Tromey [this message]
2019-08-02 23:11   ` [PATCH v2] " Christian Biesinger via gdb-patches
2019-08-05 17:34     ` Tom Tromey
2019-08-05 18:08       ` Christian Biesinger via gdb-patches
2019-08-05 18:17   ` [PATCH] " Simon Marchi
2019-08-05 18:20     ` Christian Biesinger via gdb-patches
2019-08-05 18:28       ` Simon Marchi
2019-08-05 18:30         ` Christian Biesinger via gdb-patches

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=87y30bit95.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=cbiesinger@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