This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit] fix gdbserver build failure on amd64-linux
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org, stan at codesourcery dot com
- Date: Mon, 02 Jul 2012 18:28:48 +0100
- Subject: Re: [commit] fix gdbserver build failure on amd64-linux
- References: <20120702171241.5E9E11E1392@ruffy2.mtv.corp.google.com>
On 07/02/2012 06:12 PM, Doug Evans wrote:
> Hi.
>
> fyi, I committed this.
>
> 2012-07-02 Doug Evans <dje@google.com>
>
> * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
> pointer to int.
>
> Index: mem-break.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbserver/mem-break.c,v
> retrieving revision 1.34
> diff -u -p -r1.34 mem-break.c
> --- mem-break.c 2 Jul 2012 15:29:38 -0000 1.34
> +++ mem-break.c 2 Jul 2012 17:10:13 -0000
> @@ -22,6 +22,7 @@
> #include "server.h"
> #include "regcache.h"
> #include "ax.h"
> +#include <stdint.h>
>
> const unsigned char *breakpoint_data;
> int breakpoint_len;
> @@ -929,8 +930,8 @@ gdb_no_commands_at_breakpoint (CORE_ADDR
> return 0;
>
> if (debug_threads)
> - fprintf (stderr, "at 0x%s, bp command_list is 0x%x\n",
> - paddress (where), (int) bp->command_list);
> + fprintf (stderr, "at 0x%s, bp command_list is 0x%lx\n",
> + paddress (where), (long) (uintptr_t) bp->command_list);
That's not correct on e.g., Win64, where sizeof long < sizeof pointer.
The right fix is to either use host_address_to_string, or %p, if acceptable
on all hosts.
> return (bp->command_list == NULL);
> }
>
>
--
Pedro Alves