Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>, philippe.waroquiers@skynet.be
Cc: gdb-patches@sourceware.org
Subject: Re: [RFAv3 2/6] Improve process exit status macros on MinGW
Date: Fri, 03 Jan 2020 20:08:00 -0000	[thread overview]
Message-ID: <493dbcb5-7788-6c58-b9b4-ce6a752727c3@redhat.com> (raw)
In-Reply-To: <52408aa9-5a86-2ade-ec23-c8293eff130d@redhat.com>

On 1/3/20 7:59 PM, Pedro Alves wrote:

>  #define AdjustTokenPrivileges		dyn_AdjustTokenPrivileges
>  #define DebugActiveProcessStop		dyn_DebugActiveProcessStop
> @@ -1627,8 +1628,23 @@ get_windows_debug_event (struct target_ops *ops,
>  	  windows_delete_thread (ptid_t (current_event.dwProcessId, 0,
>  					 current_event.dwThreadId),
>  				 0, true /* main_thread_p */);
> -	  ourstatus->kind = TARGET_WAITKIND_EXITED;
> -	  ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode;
> +	  DWORD exit_status = current_event.u.ExitProcess.dwExitCode;
> +	  /* If the exit status looks like a fatal exception, but we
> +	     don't recognize the exception's code, make the original
> +	     exit status value available, to avoid losing
> +	     information.  */
> +	  int exit_signal
> +	    = WIFSIGNALED (exit_status) ? WTERMSIG (exit_status) : -1;
> +	  if (exit_signal == -1)
> +	    {
> +	      ourstatus->kind = TARGET_WAITKIND_EXITED;
> +	      ourstatus->value.integer = exit_status;
> +	    }
> +	  else
> +	    {
> +	      ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
> +	      ourstatus->value.sig = gdb_signal_from_host (WTERMSIG (w));

I notice now that this should be:

    ourstatus->value.sig = gdb_signal_from_host (exit_signal);

I had fixed that on gdbserver, but not on windows-nat.c.  And the reason
I didn't notice is that the build tree I was using is only building
gdbserver, not the whole of gdb + gdbserver, and I failed to notice it.
Hopefully the rest of the code will build cleanly without requiring
much more fixing.

Thanks,
Pedro Alves


  reply	other threads:[~2020-01-03 20:08 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 16:18 [RFAv3 0/6] Implement | (pipe) command Philippe Waroquiers
2019-05-04 16:18 ` [RFAv3 3/6] Add function execute_command_to_ui_file Philippe Waroquiers
2019-05-04 16:18 ` [RFAv3 1/6] Add previous_saved_command_line to allow a command to repeat a previous command Philippe Waroquiers
2019-05-27 17:29   ` Pedro Alves
2019-05-04 16:18 ` [RFAv3 5/6] Test the | (pipe) command Philippe Waroquiers
2019-05-27 17:49   ` Pedro Alves
2019-05-04 16:18 ` [RFAv3 2/6] Improve process exit status macros on MinGW Philippe Waroquiers
2019-05-27 17:33   ` Pedro Alves
2019-05-27 18:38     ` Eli Zaretskii
2019-05-29 12:38       ` Pedro Alves
2019-05-29 15:03         ` Eli Zaretskii
2019-05-30 10:26         ` Philippe Waroquiers
2019-12-17 17:00     ` Eli Zaretskii
2019-12-17 17:51       ` Pedro Alves
2019-12-18 17:08         ` Eli Zaretskii
2019-12-18 17:42           ` Pedro Alves
2019-12-18 18:33             ` Eli Zaretskii
2019-12-25 15:57               ` Eli Zaretskii
2020-01-03 19:59                 ` Pedro Alves
2020-01-03 20:08                   ` Pedro Alves [this message]
2020-01-03 20:34                   ` Eli Zaretskii
2020-01-06 11:57                     ` Pedro Alves
2020-01-06 16:17                       ` Eli Zaretskii
2020-01-06 18:51                         ` Pedro Alves
2020-01-06 19:26                           ` Eli Zaretskii
2020-01-06 18:59                   ` Hannes Domani via gdb-patches
2020-01-06 19:34                     ` Eli Zaretskii
2020-01-06 19:38                       ` Hannes Domani via gdb-patches
2020-01-06 19:55                         ` Eli Zaretskii
2020-01-03 17:04               ` Pedro Alves
2019-05-04 16:18 ` [RFAv3 6/6] NEWS and documentation for | (pipe) command Philippe Waroquiers
2019-05-04 16:26   ` Eli Zaretskii
2019-05-04 16:33     ` Eli Zaretskii
2019-05-27 17:51   ` Pedro Alves
2019-05-04 16:18 ` [RFAv3 4/6] Implement " Philippe Waroquiers
2019-05-27 17:48   ` Pedro Alves
2019-05-27 17:55     ` Pedro Alves
     [not found] <271718487.11947642.1578332826544.ref@mail.yahoo.com>
2020-01-06 17:47 ` [RFAv3 2/6] Improve process exit status macros on MinGW Hannes Domani via gdb-patches
2020-01-06 18:23   ` Eli Zaretskii

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=493dbcb5-7788-6c58-b9b4-ce6a752727c3@redhat.com \
    --to=palves@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=philippe.waroquiers@skynet.be \
    /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