regression: gdb.objc/basicclass.exp [Re: [RFA] "Error in re-setting breakpoint," c++/12750]

Keith Seitz keiths@redhat.com
Wed Jun 1 22:22:00 GMT 2011


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.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: objc-regression.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20110601/3da454ea/attachment.ksh>


More information about the Gdb-patches mailing list