From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id 8A6663858405 for ; Fri, 29 Apr 2022 18:54:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A6663858405 Received: by mail-io1-xd30.google.com with SMTP id c125so10679081iof.9 for ; Fri, 29 Apr 2022 11:54:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4cdT9MXZ2HGPImgx2RdnnyWjZjSRodb7yD04nJJUpuM=; b=IzHEa8zLYhFNXZ5ZT11EbdWCoPBKPZ4MEH3FMKnVbW+uP3qzuSobBaCb8h8uFDXFZb sKlis+Fd9LQtiAs5/7DH0Uu/nbF+b7rIHozEF3jduTpbyFCTmzufuxTVhWGcwd/rIJyQ op1pCzlmchVwVH78c0B42UfXtllLa7VWW2S96xe8LzUQsH0xR7lpmwaPXNg9ypZHQO+A ff/nBcTLXgy5QeN3PA1xpbCZIDGn4L1Ga4LE41UdLpo0sgXREtpHXXYh6fsjc+fw4XAf 005lKMTYU8Vr5RwK87Je3Vn5Aa6p+20+0kk2iHee1/YUMKh2+pTzI5O3+CeUsqBNZI3S F/Cw== X-Gm-Message-State: AOAM530Js9pP72pXWeRwnx7iNAvmf/yyLk68PC46kWb2IXeT9GNal//o BNz4udDvR0bXBkgO6vmzFc+wUXMgLcrWeQ== X-Google-Smtp-Source: ABdhPJyYV01IAPo3qy6j2YT3kvFZmLN/TL9wmhTtZfndOTY9/9Oo65mqoiryd2GfZWJEn7c4qnMBmA== X-Received: by 2002:a05:6638:140a:b0:32b:30a4:f2ae with SMTP id k10-20020a056638140a00b0032b30a4f2aemr316020jad.45.1651258458853; Fri, 29 Apr 2022 11:54:18 -0700 (PDT) Received: from murgatroyd.Home (71-211-158-194.hlrn.qwest.net. [71.211.158.194]) by smtp.gmail.com with ESMTPSA id a12-20020a92c70c000000b002cde6e352dbsm733199ilp.37.2022.04.29.11.54.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:54:18 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 2/3] Remove windows_process_info::id Date: Fri, 29 Apr 2022 12:54:13 -0600 Message-Id: <20220429185414.1855400-3-tromey@adacore.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220429185414.1855400-1-tromey@adacore.com> References: <20220429185414.1855400-1-tromey@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2022 18:54:23 -0000 I noticed that windows_process_info::id is only used by gdbserver, and not really necessary. This patch removes it. --- gdb/nat/windows-nat.h | 1 - gdbserver/win32-low.cc | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 27b653674c3..9f7f8b63192 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -144,7 +144,6 @@ struct windows_process_info { /* The process handle */ HANDLE handle = 0; - DWORD id = 0; DWORD main_thread_id = 0; enum gdb_signal last_sig = GDB_SIGNAL_0; diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index 192ea465e69..5b91ab768e5 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -337,7 +337,6 @@ do_initial_child_stuff (HANDLE proch, DWORD pid, int attached) windows_process.last_sig = GDB_SIGNAL_0; windows_process.handle = proch; - windows_process.id = pid; windows_process.main_thread_id = 0; soft_interrupt_requested = 0; @@ -678,12 +677,12 @@ win32_process_target::create_inferior (const char *program, /* Wait till we are at 1st instruction in program, return new pid (assuming success). */ - cs.last_ptid = wait (ptid_t (windows_process.id), &cs.last_status, 0); + cs.last_ptid = wait (ptid_t (pi.dwProcessId), &cs.last_status, 0); /* Necessary for handle_v_kill. */ - signal_pid = windows_process.id; + signal_pid = pi.dwProcessId; - return windows_process.id; + return pi.dwProcessId; } /* Attach to a running process. @@ -816,7 +815,7 @@ win32_process_target::detach (process_info *process) resume.sig = 0; this->resume (&resume, 1); - if (!DebugActiveProcessStop (windows_process.id)) + if (!DebugActiveProcessStop (process->pid)) return -1; DebugSetProcessKillOnExit (FALSE); @@ -1375,7 +1374,7 @@ win32_process_target::write_memory (CORE_ADDR memaddr, void win32_process_target::request_interrupt () { - if (GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, windows_process.id)) + if (GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, signal_pid)) return; /* GenerateConsoleCtrlEvent can fail if process id being debugged is -- 2.34.1