From: Daniel Jacobowitz <drow@false.org>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Fix breakpoint condition that use member variables.
Date: Tue, 01 Apr 2008 14:10:00 -0000 [thread overview]
Message-ID: <20080401135952.GB12753@caradoc.them.org> (raw)
In-Reply-To: <200803221240.16230.vladimir@codesourcery.com>
Eli's raised a valid concern, but I think it's unrelated to this
change, so I will review this patch independently of it.
On Sat, Mar 22, 2008 at 12:40:15PM +0300, Vladimir Prus wrote:
> - /* If this is non-NULL, lookup_symbol will do the 'field_of_this'
> - check, using this function to find the value of this. */
> + /* If this is non-NULL, specifies the name that of the implicit
> + local variable that refers to the current object instance. */
Drop "that" in the first line.
> diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
> index 6b51fd5..400338e 100644
> --- a/gdb/m2-lang.c
> +++ b/gdb/m2-lang.c
> @@ -375,7 +375,7 @@ const struct language_defn m2_language_defn =
> m2_val_print, /* Print a value using appropriate syntax */
> c_value_print, /* Print a top-level value */
> NULL, /* Language specific skip_trampoline */
> - value_of_this, /* value_of_this */
> + "this", /* name_of_this */
> basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
> basic_lookup_transparent_type,/* lookup_transparent_type */
> NULL, /* Language specific symbol demangler */
This can be NULL.
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index ddd2310..7d9b4ea 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c
> @@ -1198,17 +1198,34 @@ lookup_symbol_aux (const char *name, const char
> *linkage_name,
>
> langdef = language_def (language);
>
> - if (langdef->la_value_of_this != NULL
> - && is_a_field_of_this != NULL)
> + if (langdef->la_name_of_this != NULL && is_a_field_of_this != NULL
> + && block != NULL && !dict_empty (BLOCK_DICT (block)))
> {
> - struct value *v = langdef->la_value_of_this (0);
> -
> - if (v && check_field (v, name))
> + struct symbol *sym = lookup_block_symbol (block,
> langdef->la_name_of_this,
> + NULL, VAR_DOMAIN);
value_of_local always gets the function block. This might have an
inner block that does not correspond to the function. I think you
need to find the enclosing function before checking dict_empty or
calling lookup_block_symbol. You could use block_function to get
the symbol and then SYMBOL_BLOCK_VALUE to get the containing
block, or just walk up BLOCK_SUPERBLOCK looking for BLOCK_FUNCTION.
> @@ -2773,10 +2739,7 @@ value_of_local (const char *name, int complain)
> struct value *
> value_of_this (int complain)
> {
> - if (current_language->la_language == language_objc)
> - return value_of_local ("self", complain);
> - else
> - return value_of_local ("this", complain);
> + return value_of_local (current_language->la_name_of_this, complain);
> }
>
> /* Create a slice (sub-string, sub-array) of ARRAY, that is LENGTH
Is this going to crash if we get here for a language where it is NULL?
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-04-01 14:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-22 9:40 Vladimir Prus
2008-03-22 12:07 ` Eli Zaretskii
2008-03-22 12:36 ` Vladimir Prus
2008-03-22 12:56 ` Eli Zaretskii
2008-03-22 13:20 ` Vladimir Prus
2008-03-22 14:49 ` Daniel Jacobowitz
2008-03-22 17:14 ` Eli Zaretskii
2008-03-24 18:05 ` Michael Snyder
2008-03-24 20:18 ` Eli Zaretskii
2008-03-24 21:04 ` Michael Snyder
2008-04-01 14:10 ` Daniel Jacobowitz [this message]
2008-04-03 12:51 ` Vladimir Prus
2008-04-03 13:33 ` Daniel Jacobowitz
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=20080401135952.GB12753@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=vladimir@codesourcery.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