This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Make SIZE element for dwarf_block as size_t
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 22 Jul 2012 13:57:46 +0530
- Subject: Re: [PATCH] Make SIZE element for dwarf_block as size_t
- References: <20120722131658.2809309e@spoyarek>
On Sun, 22 Jul 2012 13:16:58 +0530, Siddhesh wrote:
> 2012-07-22 Siddhesh Poyarekar <siddhesh@redhat.com>
>
> * dwarf2loc.h (struct dwarf2_locexpr_baton): Make SIZE as
> size_t.
> (struct dwarf2_loclist_baton): Likewise.
> * dwarf2read.c (struct dwarf_block): Likewise.
> (dump_die_shallow): Use pulongest to print dwarf_block.size.
>
> [1] http://sourceware.org/ml/gdb-patches/2012-06/msg00851.html
A small adjustment to this patch to adjust for the expansion of
dwarf_block.size -- a couple of local variables in decode_locdesc
needed expansion as well.
Regards,
Siddhesh
2012-07-22 Siddhesh Poyarekar <siddhesh@redhat.com>
* dwarf2loc.h (struct dwarf2_locexpr_baton): Make SIZE as
size_t.
(struct dwarf2_loclist_baton): Likewise.
* dwarf2read.c (struct dwarf_block): Likewise.
(dump_die_shallow): Use pulongest to print dwarf_block.size.
(decode_locdesc): Expand SIZE and I to size_t.
diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
index e9d06a3..0f2af3c 100644
--- a/gdb/dwarf2loc.h
+++ b/gdb/dwarf2loc.h
@@ -97,7 +97,7 @@ struct dwarf2_locexpr_baton
/* Length of the location expression. For optimized out expressions it is
zero. */
- unsigned long size;
+ size_t size;
/* The compilation unit containing the symbol whose location
we're computing. */
@@ -114,7 +114,7 @@ struct dwarf2_loclist_baton
const gdb_byte *data;
/* Length of the location list. */
- unsigned long size;
+ size_t size;
/* The compilation unit containing the symbol whose location
we're computing. */
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 187d1e8..1d499ce 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -887,7 +887,7 @@ struct die_info
/* Blocks are a bunch of untyped bytes. */
struct dwarf_block
{
- unsigned int size;
+ size_t size;
/* Valid only if SIZE is not zero. */
gdb_byte *data;
@@ -15074,12 +15074,12 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
case DW_FORM_block4:
case DW_FORM_block:
case DW_FORM_block1:
- fprintf_unfiltered (f, "block: size %d",
- DW_BLOCK (&die->attrs[i])->size);
+ fprintf_unfiltered (f, "block: size %s",
+ pulongest (DW_BLOCK (&die->attrs[i])->size));
break;
case DW_FORM_exprloc:
- fprintf_unfiltered (f, "expression: size %u",
- DW_BLOCK (&die->attrs[i])->size);
+ fprintf_unfiltered (f, "expression: size %s",
+ pulongest (DW_BLOCK (&die->attrs[i])->size));
break;
case DW_FORM_ref_addr:
fprintf_unfiltered (f, "ref address: ");
@@ -15616,8 +15616,8 @@ static CORE_ADDR
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
{
struct objfile *objfile = cu->objfile;
- int i;
- int size = blk->size;
+ size_t i;
+ size_t size = blk->size;
gdb_byte *data = blk->data;
CORE_ADDR stack[64];
int stacki;