Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Hannes Domani <ssbssa@yahoo.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Implement debugging of WOW64 processes
Date: Wed, 04 Mar 2020 18:15:00 -0000	[thread overview]
Message-ID: <83b2886f-55c7-f8e6-e127-34bc0fe07165@simark.ca> (raw)
In-Reply-To: <20200304171216.28885-1-ssbssa@yahoo.de>

On 2020-03-04 12:12 p.m., Hannes Domani via gdb-patches wrote:
> @@ -1879,6 +2110,21 @@ do_initial_windows_stuff (struct target_ops *ops, DWORD pid, int attaching)
>    clear_proceed_status (0);
>    init_wait_for_inferior ();
>  
> +#ifdef __x86_64__
> +  ignore_first_breakpoint = !attaching && wow64_process;
> +
> +  if (wow64_process)
> +    {
> +      windows_set_context_register_offsets (i386_mappings);
> +      windows_set_segment_register_p (i386_windows_segment_register_p);
> +    }
> +  else
> +    {
> +      windows_set_context_register_offsets (amd64_mappings);
> +      windows_set_segment_register_p (amd64_windows_segment_register_p);
> +    }
> +#endif

The other place where windows_set_context_register_offsets and
windows_set_segment_register_p are called is in _initialize_i386_windows_nat and
_initialize_amd64_windows_nat.  I'm thinking that since we are calling them here,
it's no longer relevant to call them in the _initialize_* functions.  I think it
would be simpler to keep just the calls here.  You could probably do like you do
elsewhere:

#ifdef __x64_64__
  if (!wow64_process)
    {
      windows_set_context_register_offsets (amd64_mappings);
      windows_set_segment_register_p (amd64_windows_segment_register_p);
    }
  else
#else
    {
      windows_set_context_register_offsets (i386_mappings);
      windows_set_segment_register_p (i386_windows_segment_register_p);
    }
#endif

They day somebody will implement multi-inferior support for Windows, the calls
in the _initialize_* functions will have to go anyway, this it will be an inferior
property anyway (I suppose you could debug one WOW64 and one non-WOW64 process at
the same time).

Simon


      parent reply	other threads:[~2020-03-04 18:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200304171216.28885-1-ssbssa.ref@yahoo.de>
2020-03-04 17:12 ` Hannes Domani via gdb-patches
2020-03-04 17:33   ` Eli Zaretskii
2020-03-04 18:15   ` Simon Marchi [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=83b2886f-55c7-f8e6-e127-34bc0fe07165@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=ssbssa@yahoo.de \
    /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