This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: PATCH: minor cleanup to dwarf2read.c



On Tue, 3 Jul 2001, Jim Blandy wrote:

> 2001-07-03  Jim Blandy  <jimb@redhat.com>
> 
> 	* dwarf2read.c (dwarf2_build_psymtabs_hard): Remove extraneous
> 	code in loop condition.  This seemed to be trying to round
> 	info_ptr up to the next four-byte boundary, but that's not what it
> 	actually did.  If we discover the problem the old code was really
> 	trying to address, we can fix it properly.

IMHO, ChangeLog is never a proper place to put such comments.  Should
the problem surface in the future, how do we expect someone to find
this piece of info?

I suggest to put this text as a comment in the source, together with a
copy of the old code, in case someone will actually need to fix this.

Btw, doesn't "cvs diff" and the ChangeLog entries tell enough about
the reason for the original code?  If not, perhaps the person who did
that change ("cvs annotate" should reveal that) could shed some light
on this.  Since the change you did is clearly incompatible with the
old code, I'm uneasy about making this change just because we don't
know why the old code was there.  Someone might have labored very hard
on it.

> *** gdb/dwarf2read.c	2001/07/02 17:43:07	1.26
> --- gdb/dwarf2read.c	2001/07/03 22:27:17
> ***************
> *** 980,987 ****
>     obstack_init (&dwarf2_tmp_obstack);
>     back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
>   
> !   while ((unsigned int) (info_ptr - dwarf_info_buffer)
> ! 	 + ((info_ptr - dwarf_info_buffer) % 4) < dwarf_info_size)
>       {
>         struct comp_unit_head cu_header;
>         beg_of_comp_unit = info_ptr;
> --- 980,986 ----
>     obstack_init (&dwarf2_tmp_obstack);
>     back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
>   
> !   while (info_ptr < dwarf_info_buffer + dwarf_info_size)
>       {
>         struct comp_unit_head cu_header;
>         beg_of_comp_unit = info_ptr;
> 


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