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: [commit] fix gdbserver build failure on amd64-linux


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


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