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


LGTM with a couple minor nits below.

On 02/12/2017 08:23 PM, Jan Kratochvil wrote:

> --- a/gdb/defs.h
> +++ b/gdb/defs.h
> @@ -648,6 +648,10 @@ extern void store_typed_address (gdb_byte *buf, struct type *type,
>  
>  extern int watchdog;
>  
> +/* From dwarf2read.c */
> +
> +ULONGEST gdb_read_unsigned_leb128 (bfd *, const gdb_byte *, unsigned int *);

Not needed anymore.

> +
>  /* Hooks for alternate command interfaces.  */
>  
>  /* * The name of the interpreter if specified on the command line.  */
> diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
> index c1e02eb..39a067d 100644
> --- a/gdb/dwarf2loc.c
> +++ b/gdb/dwarf2loc.c
> @@ -39,6 +39,7 @@
>  #include "dwarf2-frame.h"
>  #include "compile/compile.h"
>  #include "selftest.h"
> +#include "libbfd.h"

We've determined this is an internal bfd header.
Do we need this?

>  #include <algorithm>
>  #include <vector>
>  #include <unordered_set>
> @@ -143,6 +144,57 @@ decode_debug_loc_addresses (const gdb_byte *loc_ptr, const gdb_byte *buf_end,
>    return DEBUG_LOC_START_END;
>  }
>  


>  
> +/* 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.

> -/* 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

bool/true/false?

> +dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
> +			 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").

Thanks,
Pedro Alves


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