Re: [PATCH] Fix compile warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

* Dave Anderson <anderson@xxxxxxxxxx> [2007-01-17 21:10]:
> Bernhard Walle wrote:
> > >
> > > This patch makes me a litte nervous.  I see that gdb 6.5 does this:
> > >
> > >           else if (*augmentation == 'P')
> > >             {
> > >               /* Skip.  Avoid indirection since we throw away the result.  */
> > >               gdb_byte encoding = (*buf++) & ~DW_EH_PE_indirect;
> > >               read_encoded_value (unit, encoding, buf, &bytes_read);
> > >               buf += bytes_read;
> > >               augmentation++;
> > >             }
> > >
> > > Are they equivalent?
> >
> > Of course not. :) After thinking a bit I think the correct fix would
> > be:
> >
> >         buf += size_of_encoded_value(*buf);
> >         buf++;
> >
> > Do you aggree?
> 
> I can't say with any confidence.  I was trying to correlate the difference
> between the way it's done in gdb-6.5 vs 6.1, and got lost doing so...

Yes, but 6.5 basically does:

    gdb_byte tmp = *buf++;
    buf += size_of_encoded_value(tmp);

which should be equivalent to 

    buf += size_of_encoded_value(*buf);
    buf++;

Of course, read_encoded_value() does more than just calling
size_of_encoded_value(), but anyway.

> Just curious -- how do you manage to get crash to run through that
> code path?  (I put an exit() there, but can't seem to get there...)

I didn't. I just wrote a small C program which has the same problem.
(Increasing that pointer in the same operation.)

Probably that code path will be never hit at all. ;) 

BTW: Is it planned to upgrade crash to use GDB 6.6 or some higher
version?


Regards,
  Bernhard

Attachment: pgpmYbS3sUJB9.pgp
Description: PGP signature

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux