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: [patch] Fix gdb crash on some missing ELF debug info


Hi Daniel,

On Fri, 23 Jun 2006 14:39:13 +0200, Daniel Jacobowitz wrote:
...
> The idea is definitely right - thanks!  The patch could be a bit
> better:
> 
> - We really ought to check that it fits within .debug_loc while we're
> here.

OK, fixed (I feel that the DWARF2 processing code is not so foolproof).


> - And I really can't figure out what what you mean by the comment.  Do
> you mean "if we get here, and DW_UNSND (attr) != 0, and we hadn't added
> the next condition, then we'd end up with bogus ->size"?

sorry, it references the code below in dwarf2_symbol_mark_computed().

dwarf2_symbol_mark_computed():
	if (".debug_loc" is missing) {
		assume (dwarf2_per_objfile->loc_size   == 0);
		assume (dwarf2_per_objfile->loc_buffer == NULL);
	}
	assume(DW_UNSND (attr) != 0);
	baton->size = dwarf2_per_objfile->loc_size - DW_UNSND (attr);
	baton->data = dwarf2_per_objfile->loc_buffer + DW_UNSND (attr);
dwarf_expr_frame_base():
	*start = symbaton->data;
	MISSED, *(*start) crashes:
	if (*start == NULL) error ("Could not find the frame base ...");


> You've been submitting a lot of fixes recently; while most of them are
> small, some are big enough to probably require a copyright assignment.
> Have you got one, or shall I send you the forms?

I already signed the copyright assignment to FSF intended for GNU Libtool
but the assignment form looks completely project unspecific to me.
I should be listed there as "Jan Kratochvil", it may be for the e-mail address
<project-libtool@jankratochvil.net>.  Bradley M. Kuhn signed it on 7 Feb 2003.


> - Oh, and no ChangeLog

2006-06-23  Jan Kratochvil  <lace@jankratochvil.net>

	* dwarf2read.c (dwarf2_symbol_mark_computed): Fixed later crash
	on location list reference if the ".debug_loc" section is missing.


Regards,
Jan Kratochvil

Attachment: gdb-cvs20060623-debug_loc-v2.patch
Description: Text document


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