* [commit] fix gdbserver build failure on amd64-linux
@ 2012-07-02 17:12 Doug Evans
2012-07-02 17:29 ` Pedro Alves
2012-07-02 17:41 ` Tom Tromey
0 siblings, 2 replies; 4+ messages in thread
From: Doug Evans @ 2012-07-02 17:12 UTC (permalink / raw)
To: gdb-patches, stan
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);
return (bp->command_list == NULL);
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [commit] fix gdbserver build failure on amd64-linux
2012-07-02 17:12 [commit] fix gdbserver build failure on amd64-linux Doug Evans
@ 2012-07-02 17:29 ` Pedro Alves
2012-07-02 17:41 ` Tom Tromey
1 sibling, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2012-07-02 17:29 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches, stan
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [commit] fix gdbserver build failure on amd64-linux
2012-07-02 17:12 [commit] fix gdbserver build failure on amd64-linux Doug Evans
2012-07-02 17:29 ` Pedro Alves
@ 2012-07-02 17:41 ` Tom Tromey
2012-07-02 17:57 ` Stan Shebs
1 sibling, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2012-07-02 17:41 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches, stan
Doug> - fprintf (stderr, "at 0x%s, bp command_list is 0x%x\n",
Doug> - paddress (where), (int) bp->command_list);
Doug> + fprintf (stderr, "at 0x%s, bp command_list is 0x%lx\n",
Doug> + paddress (where), (long) (uintptr_t) bp->command_list);
I think it is more normal to use host_address_to_string here.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [commit] fix gdbserver build failure on amd64-linux
2012-07-02 17:41 ` Tom Tromey
@ 2012-07-02 17:57 ` Stan Shebs
0 siblings, 0 replies; 4+ messages in thread
From: Stan Shebs @ 2012-07-02 17:57 UTC (permalink / raw)
To: gdb-patches
On 7/2/12 10:41 AM, Tom Tromey wrote:
> Doug> - fprintf (stderr, "at 0x%s, bp command_list is 0x%x\n",
> Doug> - paddress (where), (int) bp->command_list);
> Doug> + fprintf (stderr, "at 0x%s, bp command_list is 0x%lx\n",
> Doug> + paddress (where), (long) (uintptr_t) bp->command_list);
>
> I think it is more normal to use host_address_to_string here.
>
Or maybe dump the debug print altogether - I'm looking at it and
wondering why I ever thought this one was going to be useful. :-)
Stan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-02 17:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-02 17:12 [commit] fix gdbserver build failure on amd64-linux Doug Evans
2012-07-02 17:29 ` Pedro Alves
2012-07-02 17:41 ` Tom Tromey
2012-07-02 17:57 ` Stan Shebs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox