From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 02/26] -Wpointer-sign: gdb_byte -> char.
Date: Fri, 12 Apr 2013 12:34:00 -0000 [thread overview]
Message-ID: <5167722D.301@codesourcery.com> (raw)
In-Reply-To: <20130411225907.16791.47628.stgit@brno.lan>
On 04/12/2013 06:59 AM, Pedro Alves wrote:
> diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c
> index cee2adf..26ffbaa 100644
> --- a/gdb/i386-cygwin-tdep.c
> +++ b/gdb/i386-cygwin-tdep.c
> @@ -125,11 +125,11 @@ core_process_module_section (bfd *abfd, asection *sect, void *obj)
> struct cpms_data *data = obj;
> enum bfd_endian byte_order = gdbarch_byte_order (data->gdbarch);
>
> - char *module_name;
> + gdb_byte *module_name;
> size_t module_name_size;
> CORE_ADDR base_addr;
>
> - char *buf = NULL;
> + gdb_byte *buf = NULL;
>
> if (strncmp (sect->name, ".module", 7) != 0)
> return;
> @@ -160,7 +160,7 @@ core_process_module_section (bfd *abfd, asection *sect, void *obj)
>
> /* The first module is the .exe itself. */
> if (data->module_count != 0)
> - windows_xfer_shared_library (module_name, base_addr,
> + windows_xfer_shared_library ((char *) module_name, base_addr,
> data->gdbarch, data->obstack);
> data->module_count++;
>
It would be nice to keep 'module_name' of type 'char *', because it is a
string.
> diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
> index e2822c1..86ce062 100644
> --- a/gdb/solib-dsbt.c
> +++ b/gdb/solib-dsbt.c
> @@ -840,7 +840,7 @@ enable_break2 (void)
> if (interp_sect)
> {
> unsigned int interp_sect_size;
> - gdb_byte *buf;
> + char *buf;
> bfd *tmp_bfd = NULL;
> CORE_ADDR addr;
> gdb_byte addr_buf[TIC6X_PTR_SIZE];
> @@ -852,7 +852,7 @@ enable_break2 (void)
> interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
> buf = alloca (interp_sect_size);
> bfd_get_section_contents (exec_bfd, interp_sect,
> - buf, 0, interp_sect_size);
> + (bfd_byte *) buf, 0, interp_sect_size);
The declaration of bfd_get_section_contents is,
bfd_boolean bfd_get_section_contents
(bfd *abfd, asection *section, void *location, file_ptr offset,
bfd_size_type count);
the parameter 'location' 's type is 'void *', do we really need to cast
'buf' to 'bfd_byte *'?
>
> /* Now we need to figure out where the dynamic linker was
> loaded so that we can load its symbols and place a breakpoint
> diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
> index 52588bc..1765969 100644
> --- a/gdb/solib-frv.c
> +++ b/gdb/solib-frv.c
> @@ -535,7 +535,7 @@ enable_break2 (void)
> if (interp_sect)
> {
> unsigned int interp_sect_size;
> - gdb_byte *buf;
> + char *buf;
> bfd *tmp_bfd = NULL;
> int status;
> CORE_ADDR addr, interp_loadmap_addr;
> @@ -548,7 +548,7 @@ enable_break2 (void)
> interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
> buf = alloca (interp_sect_size);
> bfd_get_section_contents (exec_bfd, interp_sect,
> - buf, 0, interp_sect_size);
> + (gdb_byte *) buf, 0, interp_sect_size);
Likewise.
--
Yao (é½å°§)
next prev parent reply other threads:[~2013-04-12 2:32 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 23:00 [PATCH 00/26] Make GDB -Wpointer-sign clean Pedro Alves
2013-04-11 23:00 ` [PATCH 01/26] -Wpointer-sign: char -> gdb_byte Pedro Alves
2013-04-11 23:00 ` [PATCH 02/26] -Wpointer-sign: gdb_byte -> char Pedro Alves
2013-04-12 12:34 ` Yao Qi [this message]
2013-04-12 14:42 ` Pedro Alves
2013-04-11 23:01 ` [PATCH 07/26] ppc-linux-tdep.c: Wrong signness for buffer holding instructions Pedro Alves
2013-04-11 23:01 ` [PATCH 03/26] cris-tdep.c: Use unsigned variable for unsigned command Pedro Alves
2013-04-11 23:01 ` [PATCH 04/26] alpha-tdep.c/mips-tdep.c: "set heuristic-fence-post" is signed/zinteger Pedro Alves
2013-04-11 23:01 ` [PATCH 05/26] mep-tdep.c: Wrong signness for instruction buffer Pedro Alves
2013-04-11 23:01 ` [PATCH 06/26] mips-tdep.c: Wrong signness for local holding PC register Pedro Alves
2013-04-11 23:01 ` [PATCH 12/26] Cast result of obstack_base to gdb_byte * in a couple spots Pedro Alves
2013-04-11 23:01 ` [PATCH 08/26] -Wpointer-sign: s390-tdep.c Pedro Alves
2013-04-11 23:01 ` [PATCH 10/26] -Wpointer-sign: xtensa-tdep.c Pedro Alves
2013-04-11 23:02 ` [PATCH 13/26] serial_write: change prototype to take a void-pointer buffer Pedro Alves
2013-04-12 14:55 ` Pedro Alves
2013-04-19 14:23 ` Pedro Alves
2013-04-19 14:28 ` Eli Zaretskii
2013-04-19 14:28 ` Pedro Alves
2013-04-11 23:02 ` [PATCH 11/26] -Wpointer-sign: alpha-tdep.c Pedro Alves
2013-04-11 23:20 ` [PATCH 14/26] gdb_byte for binary buffer, char for string: remote.c, tracepoint.c Pedro Alves
2013-04-11 23:23 ` [PATCH 15/26] gdb_byte for binary buffer, char for string: common/agent.c Pedro Alves
2013-04-12 2:30 ` [PATCH 16/26] -Wpointer-sign: remote-mips.c Pedro Alves
2013-04-12 2:32 ` [PATCH 17/26] -Wpointer-sign: python/ Pedro Alves
2013-04-12 20:56 ` Tom Tromey
2013-04-12 6:55 ` [PATCH 18/26] -Wpointer-sign: bookmarks Pedro Alves
2013-04-12 8:58 ` [PATCH 19/26] -Wpointer-sign: coff-pe-read.c: treat strings in PE/COFF data as char * Pedro Alves
2013-04-12 9:06 ` [PATCH 20/26] -Wpointer-sign: xcoffread.c Pedro Alves
2013-04-12 9:32 ` [PATCH 21/26] -Wpointer-sign: dwarf2read.c Pedro Alves
2013-04-12 21:01 ` Tom Tromey
2013-04-12 9:54 ` [PATCH 22/26] -Wpointer-sign: dwarf2-frame.c: Pass unsigned variable to safe_read_uleb128 Pedro Alves
2013-04-12 10:01 ` [PATCH 23/26] -Wpointer-sign: ada-lang.c, ada-tasks.c Pedro Alves
2013-04-12 10:11 ` [PATCH 24/26] -Wpointer-sign: cp-valprint.c Pedro Alves
2013-04-12 10:18 ` [PATCH 25/26] -Wpointer-sign: ctf.c Pedro Alves
2013-04-12 10:39 ` [PATCH 26/26] -Wpointer-sign: record.c Pedro Alves
2013-04-12 11:34 ` [PATCH 09/26] -Wpointer-sign: aarch64-tdep.c Pedro Alves
2013-04-12 14:39 ` [PATCH 00/26] Make GDB -Wpointer-sign clean Yao Qi
2013-04-12 21:44 ` Tom Tromey
2013-04-19 14:13 ` Pedro Alves
2013-04-19 18:17 ` [COMMIT] " Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5167722D.301@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox