This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Fix gdb/15827 (crash w/corrupt DWARF)


Hi Keith,

> ChangeLog
> 2014-03-20  Keith Seitz  <keiths@redhat.com>
> 
> 	PR gdb/15827
> 	* dwarf2read.c (skip_one_die): Check that all relative-offset
> 	sibling DIEs fall within range of the current reader's buffer.
> 	(read_partial_die): Likewise.
>
> testsuite/ChangeLog
> 2014-03-20  Keith Seitz  <keiths@redhat.com>
> 
> 	PR gdb/15827
> 	* gdb.dwarf2/corrupt.c: New file.
> 	* gdb.dwarf2/corrupt.exp: New file.


LGTM! Just one tiny nit...

> +/* Dummy main function.  */
> +
> +int
> +main()

Use "(void)" instead of "()". There was a recent policy clarification
regarding the CS to be using with testcases, and basically we decided
to try to follow the GCS as much as we reasonably could.

> +}
> +
> +# If we get here and gdb hasn't crashed, the tests pass.
> +pass "corrupt DWARF"

That's just me but I usually do a "print 1" test, just to make sure
that even if the testing framework did not detect the GDB process
dying, the "print 1" test definitely will. Not important on most,
if not all platforms, but ISTR some odd platforms where this helped.
That's just a suggestion, you don't have to follow it.

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]