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 5/8] DWARF-5 basic functionality


On Fri, 17 Feb 2017 12:41:22 +0100, Pedro Alves wrote:
> > +ULONGEST gdb_read_unsigned_leb128 (bfd *, const gdb_byte *, unsigned int *);
> 
> Not needed anymore.

Yes, dropped.


> > +#include "libbfd.h"
> 
> We've determined this is an internal bfd header.
> Do we need this?

No, a mistake, dropped.


> > +/* Expected enum dwarf_unit_type for read_comp_unit_head.  */
> > +enum class RCUH_Kind { COMPILE, TYPE };
> 
> RCUH_Kind -> rcuh_kind.  We only use uppercase type names
> in template type parameter names.

Done.


> > -/* Call CALLBACK from DW_AT_ranges attribute value OFFSET.
> > +/* Call CALLBACK from DW_AT_ranges attribute value OFFSET
> > +   reading .debug_rnglists.
> > +   Return 1 if the attributes are present and valid, otherwise, return 0.  */
> > +
> > +static int
> > +dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
> 
> bool/true/false?

It is just a variant of dwarf2_ranges_process which still does use int from
the C days of GDB.  Its return value is also passed as a return value of
dwarf2_ranges_process.  Using bool here would need to refactor
dwarf2_ranges_process first.  And then one can rather refactor it all to
a virtual class and after more refactoring to a different debugger.

So I have kept it as it was.  Otherwise specify which level of refactorization
do you wish.


> > +			 std::function<void (CORE_ADDR range_beginning,
> > +					     CORE_ADDR range_end)> callback)
> 
> Same comment about std::function.  (and I had forgotten to suggest
> that callback should probably be a universal reference / "&&callback").

That is OK, I have already noticed you had studied a lot of C++ schoolbooks
before you permitted GDB to use C++.


Jan


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