From: Pedro Alves <pedro@codesourcery.com>
To: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
Cc: gdb-patches@sourceware.org, "'Stan Shebs'" <stan@codesourcery.com>
Subject: Re: [RFA] Fix mingw32 gdbserver build failure
Date: Tue, 15 Jun 2010 10:40:00 -0000 [thread overview]
Message-ID: <201006151140.04578.pedro@codesourcery.com> (raw)
In-Reply-To: <001201cb0c72$5c2b55a0$148200e0$@muller@ics-cnrs.unistra.fr>
On Tuesday 15 June 2010 11:06:01, Pierre Muller wrote:
> gdbserver compilation fails for mingw32.
>
> This was because of int64_t use in emit_const
> of revision 1.70 dated 2010-06-14.
>
> Rather than simply adding a single line patch as obvious,
> I would prefer that we use HAVE_STDINT_H
> in all occurences of include <stdint.h>
>
Ooops, sorry. That got left behind when I moved the new
code between our private stub into gdbserver. If you'll notice,
gdbserver/tracepoint.c doesn't use int64_t anywhere; it instead
uses LONGEST/ULONGEST. In fact, nothing in gdbserver uses the
c99 intXX_t typtes. There's a comment there mentioning
that using gnulib's stdint.h would be nice.
I'm applying this in a bit. It should fix the mingw32 issue.
--
Pedro Alves
2010-06-15 Pedro Alves <pedro@codesourcery.com>
* linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
(i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
LONGEST uses.
* server.h (struct emit_ops): Replace int64_t uses with LONGEST
uses.
* tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
uses with LONGEST uses.
---
gdb/gdbserver/linux-x86-low.c | 12 ++++++------
gdb/gdbserver/server.h | 2 +-
gdb/gdbserver/tracepoint.c | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
Index: src/gdb/gdbserver/linux-x86-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-x86-low.c 2010-06-15 11:28:45.000000000 +0100
+++ src/gdb/gdbserver/linux-x86-low.c 2010-06-15 11:29:33.000000000 +0100
@@ -1764,7 +1764,7 @@ amd64_write_goto_address (CORE_ADDR from
}
static void
-amd64_emit_const (int64_t num)
+amd64_emit_const (LONGEST num)
{
unsigned char buf[16];
int i;
@@ -1772,7 +1772,7 @@ amd64_emit_const (int64_t num)
i = 0;
buf[i++] = 0x48; buf[i++] = 0xb8; /* mov $<n>,%rax */
- *((int64_t *) (&buf[i])) = num;
+ *((LONGEST *) (&buf[i])) = num;
i += 8;
append_insns (&buildaddr, i, buf);
current_insn_ptr = buildaddr;
@@ -1784,7 +1784,7 @@ amd64_emit_call (CORE_ADDR fn)
unsigned char buf[16];
int i;
CORE_ADDR buildaddr;
- int64_t offset64;
+ LONGEST offset64;
/* The destination function being in the shared library, may be
>31-bits away off the compiled code pad. */
@@ -1919,7 +1919,7 @@ amd64_emit_int_call_1 (CORE_ADDR fn, int
amd64_emit_call (fn);
}
-/* FN's prototype is `void(*fn)(int,int64_t)'. */
+/* FN's prototype is `void(*fn)(int,LONGEST)'. */
static void
amd64_emit_void_call_2 (CORE_ADDR fn, int arg1)
@@ -2251,7 +2251,7 @@ i386_write_goto_address (CORE_ADDR from,
}
static void
-i386_emit_const (int64_t num)
+i386_emit_const (LONGEST num)
{
unsigned char buf[16];
int i, hi;
@@ -2414,7 +2414,7 @@ i386_emit_int_call_1 (CORE_ADDR fn, int
"lea 0x8(%esp),%esp");
}
-/* FN's prototype is `void(*fn)(int,int64_t)'. */
+/* FN's prototype is `void(*fn)(int,LONGEST)'. */
static void
i386_emit_void_call_2 (CORE_ADDR fn, int arg1)
Index: src/gdb/gdbserver/server.h
===================================================================
--- src.orig/gdb/gdbserver/server.h 2010-06-15 11:28:37.000000000 +0100
+++ src/gdb/gdbserver/server.h 2010-06-15 11:30:18.000000000 +0100
@@ -598,7 +598,7 @@ struct emit_ops
void (*emit_if_goto) (int *offset_p, int *size_p);
void (*emit_goto) (int *offset_p, int *size_p);
void (*write_goto_address) (CORE_ADDR from, CORE_ADDR to, int size);
- void (*emit_const) (int64_t num);
+ void (*emit_const) (LONGEST num);
void (*emit_call) (CORE_ADDR fn);
void (*emit_reg) (int reg);
void (*emit_pop) (void);
Index: src/gdb/gdbserver/tracepoint.c
===================================================================
--- src.orig/gdb/gdbserver/tracepoint.c 2010-06-15 11:28:15.000000000 +0100
+++ src/gdb/gdbserver/tracepoint.c 2010-06-15 11:29:04.000000000 +0100
@@ -5113,7 +5113,7 @@ write_goto_address (CORE_ADDR from, CORE
}
static void
-emit_const (int64_t num)
+emit_const (LONGEST num)
{
target_emit_ops ()->emit_const (num);
}
@@ -5162,7 +5162,7 @@ emit_int_call_1 (CORE_ADDR fn, int arg1)
target_emit_ops ()->emit_int_call_1 (fn, arg1);
}
-/* FN's prototype is `void(*fn)(int,int64_t)'. */
+/* FN's prototype is `void(*fn)(int,LONGEST)'. */
static void
emit_void_call_2 (CORE_ADDR fn, int arg1)
prev parent reply other threads:[~2010-06-15 10:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-15 10:06 Pierre Muller
2010-06-15 10:40 ` Pedro Alves [this message]
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=201006151140.04578.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=pierre.muller@ics-cnrs.unistra.fr \
--cc=stan@codesourcery.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