From a1855c1db0fb6d4ab803b5589069fe04c2864b64 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 11 Oct 2012 02:07:22 +0000 Subject: [PATCH] * dwarf2read.c (read_1_byte): Add const to buf parameter. (read_1_signed_byte, read_2_bytes, read_2_signed_bytes): Ditto. (read_4_bytes, read_4_signed_bytes, read_8_bytes): Ditto. (lookup_dwo_file): Add const to dwo_name parameter. (lookup_dwo_comp_unit, lookup_dwo_type_unit): Ditto. --- gdb/ChangeLog | 8 ++++++++ gdb/dwarf2read.c | 34 +++++++++++++++++----------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8fe5e271577..b6ca77a98f3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2012-10-10 Doug Evans + + * dwarf2read.c (read_1_byte): Add const to buf parameter. + (read_1_signed_byte, read_2_bytes, read_2_signed_bytes): Ditto. + (read_4_bytes, read_4_signed_bytes, read_8_bytes): Ditto. + (lookup_dwo_file): Add const to dwo_name parameter. + (lookup_dwo_comp_unit, lookup_dwo_type_unit): Ditto. + 2012-10-06 Jan Kratochvil Fix crash during stepping on ppc32. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 009be3c890f..afddd30007e 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1237,15 +1237,15 @@ static gdb_byte *read_attribute (const struct die_reader_specs *, struct attribute *, struct attr_abbrev *, gdb_byte *); -static unsigned int read_1_byte (bfd *, gdb_byte *); +static unsigned int read_1_byte (bfd *, const gdb_byte *); -static int read_1_signed_byte (bfd *, gdb_byte *); +static int read_1_signed_byte (bfd *, const gdb_byte *); -static unsigned int read_2_bytes (bfd *, gdb_byte *); +static unsigned int read_2_bytes (bfd *, const gdb_byte *); -static unsigned int read_4_bytes (bfd *, gdb_byte *); +static unsigned int read_4_bytes (bfd *, const gdb_byte *); -static ULONGEST read_8_bytes (bfd *, gdb_byte *); +static ULONGEST read_8_bytes (bfd *, const gdb_byte *); static CORE_ADDR read_address (bfd *, gdb_byte *ptr, struct dwarf2_cu *, unsigned int *); @@ -1623,10 +1623,10 @@ static htab_t allocate_signatured_type_table (struct objfile *objfile); static htab_t allocate_dwo_unit_table (struct objfile *objfile); static struct dwo_unit *lookup_dwo_comp_unit - (struct dwarf2_per_cu_data *, char *, const char *, ULONGEST); + (struct dwarf2_per_cu_data *, const char *, const char *, ULONGEST); static struct dwo_unit *lookup_dwo_type_unit - (struct signatured_type *, char *, const char *); + (struct signatured_type *, const char *, const char *); static void free_dwo_file_cleanup (void *); @@ -8373,7 +8373,7 @@ init_dwo_file (const char *dwo_name, const char *comp_dir) /* Lookup DWO file DWO_NAME. */ static struct dwo_file * -lookup_dwo_file (char *dwo_name, const char *comp_dir) +lookup_dwo_file (const char *dwo_name, const char *comp_dir) { struct dwo_file *dwo_file; struct dwo_file find_entry; @@ -8405,7 +8405,7 @@ lookup_dwo_file (char *dwo_name, const char *comp_dir) static struct dwo_unit * lookup_dwo_comp_unit (struct dwarf2_per_cu_data *this_cu, - char *dwo_name, const char *comp_dir, + const char *dwo_name, const char *comp_dir, ULONGEST signature) { struct objfile *objfile = dwarf2_per_objfile->objfile; @@ -8444,7 +8444,7 @@ lookup_dwo_comp_unit (struct dwarf2_per_cu_data *this_cu, static struct dwo_unit * lookup_dwo_type_unit (struct signatured_type *this_tu, - char *dwo_name, const char *comp_dir) + const char *dwo_name, const char *comp_dir) { struct objfile *objfile = dwarf2_per_objfile->objfile; struct dwo_file *dwo_file; @@ -13397,43 +13397,43 @@ read_attribute (const struct die_reader_specs *reader, /* Read dwarf information from a buffer. */ static unsigned int -read_1_byte (bfd *abfd, gdb_byte *buf) +read_1_byte (bfd *abfd, const gdb_byte *buf) { return bfd_get_8 (abfd, buf); } static int -read_1_signed_byte (bfd *abfd, gdb_byte *buf) +read_1_signed_byte (bfd *abfd, const gdb_byte *buf) { return bfd_get_signed_8 (abfd, buf); } static unsigned int -read_2_bytes (bfd *abfd, gdb_byte *buf) +read_2_bytes (bfd *abfd, const gdb_byte *buf) { return bfd_get_16 (abfd, buf); } static int -read_2_signed_bytes (bfd *abfd, gdb_byte *buf) +read_2_signed_bytes (bfd *abfd, const gdb_byte *buf) { return bfd_get_signed_16 (abfd, buf); } static unsigned int -read_4_bytes (bfd *abfd, gdb_byte *buf) +read_4_bytes (bfd *abfd, const gdb_byte *buf) { return bfd_get_32 (abfd, buf); } static int -read_4_signed_bytes (bfd *abfd, gdb_byte *buf) +read_4_signed_bytes (bfd *abfd, const gdb_byte *buf) { return bfd_get_signed_32 (abfd, buf); } static ULONGEST -read_8_bytes (bfd *abfd, gdb_byte *buf) +read_8_bytes (bfd *abfd, const gdb_byte *buf) { return bfd_get_64 (abfd, buf); } -- 2.30.2