From: Keith Seitz <keiths@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: regression: gdb.objc/basicclass.exp [Re: [RFA] "Error in re-setting breakpoint," c++/12750]
Date: Wed, 01 Jun 2011 22:22:00 -0000 [thread overview]
Message-ID: <4DE6BB98.5070901@redhat.com> (raw)
In-Reply-To: <20110601070737.GA29856@host1.jankratochvil.net>
[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]
On 06/01/2011 12:07 AM, Jan Kratochvil wrote:
> -PASS: gdb.objc/basicclass.exp: resetting breakpoints when rerunning
> -PASS: gdb.objc/basicclass.exp: continue until method breakpoint
> -PASS: gdb.objc/basicclass.exp: print an ivar of self
> -PASS: gdb.objc/basicclass.exp: print self
> -PASS: gdb.objc/basicclass.exp: print contents of self
> +FAIL: gdb.objc/basicclass.exp: resetting breakpoints when rerunning
> +FAIL: gdb.objc/basicclass.exp: continue until method breakpoint (GDB internal error)
> +FAIL: gdb.objc/basicclass.exp: print an ivar of self
> +FAIL: gdb.objc/basicclass.exp: print self
> +FAIL: gdb.objc/basicclass.exp: print contents of self
This is caused by a thinko in objc-lang.c:find_methods. Amongst its many
duties, that function counts the number of ObjC symbols seen in an
objfile, storing this result in the objfile. It is then checked every
time find_methods is called.
However, the loop over the minimal symbols has a few continuations in
it, e.g., to check if the symbol is in the desired block and other
things; if not, it continues the loop with the next minimal symbol.
Unfortunately, that bypasses the incrementing of the objfile's symbol
counter.
The method not being in the desired block does not make it an invalid
ObjC method for the objfile. It must still be counted for the later
assertion.
Before the patch for c++/12750, decode_objc would always get NULL for
file_symtab (so why does it even have that parameter?), and the check
for the block would never occur.
This is all way more verbiage than the simple patch to fix it: increment
the counter before shorting the loop.
Keith
ChangeLog
2011-06-01 Keith Seitz <keiths@redhat.com>
* objc-lang.c (find_methods): Increment objfile_csym earlier.
[-- Attachment #2: objc-regression.patch --]
[-- Type: text/plain, Size: 684 bytes --]
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index dfa5388..592b52e 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -1221,6 +1221,8 @@ find_methods (struct symtab *symtab, char type,
pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc,
¤t_target);
+ objfile_csym++;
+
if (symtab)
if (pc < BLOCK_START (block) || pc >= BLOCK_END (block))
/* Not in the specified symtab. */
@@ -1237,8 +1239,6 @@ find_methods (struct symtab *symtab, char type,
if (parse_method (tmp, &ntype, &nclass,
&ncategory, &nselector) == NULL)
continue;
-
- objfile_csym++;
if ((type != '\0') && (ntype != type))
continue;
next prev parent reply other threads:[~2011-06-01 22:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 18:47 [RFA] "Error in re-setting breakpoint," c++/12750 Keith Seitz
2011-05-31 20:59 ` Tom Tromey
2011-05-31 22:16 ` Keith Seitz
2011-06-01 7:08 ` regression: gdb.objc/basicclass.exp [Re: [RFA] "Error in re-setting breakpoint," c++/12750] Jan Kratochvil
2011-06-01 19:55 ` Keith Seitz
2011-06-01 22:22 ` Keith Seitz [this message]
2011-06-02 9:30 ` regression: gdb.objc/basicclass.exp Jan Kratochvil
2011-06-02 18:47 ` Keith Seitz
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=4DE6BB98.5070901@redhat.com \
--to=keiths@redhat.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