From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Daniel Jacobowitz'" <drow@false.org>, <gdb-patches@sourceware.org>
Subject: [RFA v3] Allow cygwin native to compile with --enable-64-bit-bfd
Date: Mon, 03 Dec 2007 15:18:00 -0000 [thread overview]
Message-ID: <000001c835bf$95610bd0$c0232370$@u-strasbg.fr> (raw)
In-Reply-To: <20071202040023.GA20011@caradoc.them.org>
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Daniel Jacobowitz
> Sent: Sunday, December 02, 2007 5:00 AM
> To: gdb-patches@sourceware.org
> Cc: Pierre Muller
> Subject: Re: [RFA v2] Allow cygwin native to compile with --enable-64-
> bit-bfd
>
> On Sat, Dec 01, 2007 at 09:43:11PM -0500, Christopher Faylor wrote:
> > I'd like to get opinions from other maintainers on the use of a macro
> > for this case. I don't like seeing unexplained double casts like
> this
> > and I think a macro could make it clearer.
> >
> > Daniel were you implying that you would just tolerate a macro here or
> > do you think it's an ok idea.
>
> I'm very familiar with this idiom, so the double cast stands out when
> I see it. If there were a macro I'd have to go figure out whether it
> was doing something more subtle. I'd write it this way, but not
> complain if someone else wrote it differently.
>
> > >2007-11-28 Pierre Muller <muller@ics.u-strasbg.fr>
> > >
> > > *win32-nat.c: Allow compilation if CORE_ADDR is 8 byte long.
> > > Add "gdb_stdint.h" dependency required for uintptr_t type use.
>
> Added includes -> update Makefile.in. Tom's been working on automatic
> dependencies for GCC. Maybe we can do something similar for GDB
> soon...
I modified the patch to add the change to Makefile.in.
After checking again that there was
no change to the testsuite.
OK to commit?
2007-12-03 Pierre Muller <muller@ics.u-strasbg.fr>
* win32-nat.c: Allow compilation if CORE_ADDR is 8 byte long.
Add "gdb_stdint.h" dependency required for uintptr_t type use.
(handle_output_debug_string): Use uintptr_t typecast.
(handle_exception): Ditto.
(win32_xfer_memory): Ditto.
* Makefile.in (win32-nat.o): Add dependency to gdb_stdint header.
Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.963
diff -u -p -r1.963 Makefile.in
--- gdb/Makefile.in 30 Nov 2007 21:50:18 -0000 1.963
+++ gdb/Makefile.in 2 Dec 2007 21:43:10 -0000
@@ -2940,7 +2940,7 @@ win32-nat.o: win32-nat.c $(defs_h) $(fra
$(regcache_h) $(top_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \
$(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(exec_h) $(solist_h) \
$(solib_h) $(i386_tdep_h) $(i387_tdep_h) $(gdb_obstack_h) \
- $(xml_support_h) $(i386_cygwin_tdep_h)
+ $(xml_support_h) $(i386_cygwin_tdep_h) $(gdb_stdint_h)
win32-termcap.o: win32-termcap.c
wrapper.o: wrapper.c $(defs_h) $(value_h) $(exceptions_h) $(wrapper_h) \
$(ui_out_h)
Index: gdb/win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.142
diff -u -p -r1.142 win32-nat.c
--- gdb/win32-nat.c 2 Dec 2007 21:32:46 -0000 1.142
+++ gdb/win32-nat.c 2 Dec 2007 21:43:12 -0000
@@ -48,6 +48,7 @@
#include "objfiles.h"
#include "gdb_obstack.h"
#include "gdb_string.h"
+#include "gdb_stdint.h"
#include "gdbthread.h"
#include "gdbcmd.h"
#include <sys/param.h>
@@ -828,7 +829,8 @@ handle_output_debug_string (struct targe
int retval = 0;
if (!target_read_string
- ((CORE_ADDR) current_event.u.DebugString.lpDebugStringData, &s, 1024,
0)
+ ((CORE_ADDR) (uintptr_t)
current_event.u.DebugString.lpDebugStringData,
+ &s, 1024, 0)
|| !s || !*s)
/* nothing to do */;
else if (strncmp (s, _CYGWIN_SIGNAL_STRING, sizeof
(_CYGWIN_SIGNAL_STRING) - 1) != 0)
@@ -1022,7 +1024,8 @@ handle_exception (struct target_waitstat
and will be sent as a cygwin-specific-signal. So, ignore SEGVs
if they show up
within the text segment of the DLL itself. */
char *fn;
- bfd_vma addr = (bfd_vma)
current_event.u.Exception.ExceptionRecord.ExceptionAddress;
+ bfd_vma addr = (bfd_vma) (uintptr_t) current_event.u.Exception.
+
ExceptionRecord.ExceptionAddress;
if ((!cygwin_exceptions && (addr >= cygwin_load_start && addr <
cygwin_load_end))
|| (find_pc_partial_function (addr, &fn, NULL, NULL)
&& strncmp (fn, "KERNEL32!IsBad", strlen ("KERNEL32!IsBad"))
== 0))
@@ -1932,20 +1935,23 @@ win32_xfer_memory (CORE_ADDR memaddr, gd
struct target_ops *target)
{
DWORD done = 0;
if (write)
{
DEBUG_MEM (("gdb: write target memory, %d bytes at 0x%08lx\n",
- len, (DWORD) memaddr));
- if (!WriteProcessMemory (current_process_handle, (LPVOID) memaddr,
our,
+ len, (DWORD) (uintptr_t) memaddr));
+ if (!WriteProcessMemory (current_process_handle,
+ (LPVOID) (uintptr_t) memaddr, our,
len, &done))
done = 0;
- FlushInstructionCache (current_process_handle, (LPCVOID) memaddr,
len);
+ FlushInstructionCache (current_process_handle,
+ (LPCVOID) (uintptr_t) memaddr, len);
}
else
{
DEBUG_MEM (("gdb: read target memory, %d bytes at 0x%08lx\n",
- len, (DWORD) memaddr));
- if (!ReadProcessMemory (current_process_handle, (LPCVOID) memaddr,
our,
+ len, (DWORD) (uintptr_t) memaddr));
+ if (!ReadProcessMemory (current_process_handle,
+ (LPCVOID) (uintptr_t) memaddr, our,
len, &done))
done = 0;
}
next prev parent reply other threads:[~2007-12-03 15:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-23 8:50 [RFC/RFA] " Pierre Muller
2007-11-24 21:07 ` Christopher Faylor
2007-11-24 22:47 ` Daniel Jacobowitz
2007-11-25 17:32 ` Christopher Faylor
2007-11-25 19:08 ` Daniel Jacobowitz
2007-11-25 22:12 ` Christopher Faylor
2007-11-26 9:12 ` Pierre Muller
2007-11-26 15:18 ` Ulrich Weigand
2007-11-29 10:11 ` [RFA v2] " Pierre Muller
2007-12-02 2:43 ` Christopher Faylor
2007-12-02 4:00 ` Daniel Jacobowitz
2007-12-03 15:18 ` Pierre Muller [this message]
2007-12-06 9:23 ` [RFA v3] " Christopher Faylor
2007-12-06 14:06 ` Pierre Muller
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='000001c835bf$95610bd0$c0232370$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/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