Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [patch]: Replace stryoul call to fetch address
Date: Wed, 27 Feb 2013 17:20:00 -0000	[thread overview]
Message-ID: <512E404E.6070504@redhat.com> (raw)
In-Reply-To: <20130227164419.GA16975@calimero.vinschen.de>

On 02/27/2013 04:44 PM, Corinna Vinschen wrote:
> Hi,

Hi,

> 
> here's a small patch which will help along building GDB on the (not
> yet finished) x86_64 Cygwin.
> 
> Mostly these are just a few casts, and tweaks to the printf format
> strings, so that the argument and the format matches all three cases:
> 
> - i686
> - x86_64 LLP (Mingw, native Windows)
> - x86_64 LP  (Cygwin)
> 
> The most important part of the patch is in handle_output_debug_string,
> though.  The address for the context information is read from the string
> using the strtoul function.  This works fine for a 32 bit GDB, and it
> also works fine for a 64 bit Cygwin GDB.  It does not work for a 64 bit
> Mingw GDB debugging a 64 bit Cygwin application, though.  Therefore I
> replaced the strtoul with a call to string_to_core_addr.

IIRC, the matching Cygwin code that that special
Cygwin signals handling was never implemented, or it was disabled
on Cygwin, or some such, and that gdb bits is actually causing
trouble -- see http://sourceware.org/ml/gdb-patches/2013-02/msg00122.html.
We should just zap it all.

> Apart from that there's more required to get GDB working on Cygwin,
> apparently, but I thought the below patch is simple enough to go in
> already.

One thing that comes to mind is I think we'll need to have separate
mingw64/cygwin64 osabis.  Currently, mingw 32/64 use
GDB_OSABI_CYGWIN, and that limps along, but with LP vs LLP, that
won't work.  We'll need a way to distinguish Cygwin vs native Windows
binaries.  Probably by checking for cygwin.dll in the dll import list?

Another point where that'd be good is in step-over-longjmp support
(gdbarch_get_longjmp_target).  IIRC, the offset of PC within
the jmpbuf of msvcrt.dll is not the same as Cygwin's (32-bit;
dunno about 64-bit).

> 
> Ok to apply?

>  		    DWORD err = GetLastError ();
> -		    warning (_("SuspendThread failed. (winerr %d)"),
> +		    warning (_("SuspendThread failed. (winerr %u)"),
>  			     (int) err);

This one doesn't look right.  %d matches the cast to signed int.
I think you wanted the converse.  %u and (unsigned).

Otherwise looks fine to me.

-- 
Pedro Alves


  reply	other threads:[~2013-02-27 17:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27 16:44 Corinna Vinschen
2013-02-27 17:20 ` Pedro Alves [this message]
2013-02-27 18:47   ` Corinna Vinschen
2013-02-27 19:40     ` Pedro Alves
2013-02-27 19:53       ` Corinna Vinschen
2013-02-27 20:03         ` [patch] gdbserver/win32-low.c: Fix printf-like formatting (was Re: [patch]: Replace stryoul call to fetch address) Corinna Vinschen
2013-02-27 21:05           ` Eli Zaretskii
2013-02-27 21:25             ` Corinna Vinschen
2013-02-27 21:30               ` Eli Zaretskii
2013-02-28  9:19                 ` Corinna Vinschen
2013-02-28 16:20                   ` Eli Zaretskii
2013-02-27 21:50           ` Pedro Alves
2013-02-28 11:01             ` Corinna Vinschen
2013-02-28  0:44         ` [patch]: Replace stryoul call to fetch address Pedro Alves
2013-02-28 10:02           ` Corinna Vinschen
2013-02-28 16:33             ` Corinna Vinschen
2013-02-28 16:48               ` Corinna Vinschen
2013-02-28 17:04                 ` Pedro Alves
2013-02-27 20:24   ` Christopher Faylor
2013-02-27 20:29     ` Christopher Faylor
2013-02-28  0:33       ` Pedro Alves

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=512E404E.6070504@redhat.com \
    --to=palves@redhat.com \
    --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