From patchwork Mon Jul 24 10:39:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 21738 Received: (qmail 26704 invoked by alias); 24 Jul 2017 10:40:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25451 invoked by uid 89); 24 Jul 2017 10:40:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=brings, collects X-HELO: sessmg22.ericsson.net Received: from sessmg22.ericsson.net (HELO sessmg22.ericsson.net) (193.180.251.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Jul 2017 10:40:17 +0000 Received: from ESESSHC017.ericsson.se (Unknown_Domain [153.88.183.69]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id A2.C4.06959.E8EC5795; Mon, 24 Jul 2017 12:40:14 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.69) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 24 Jul 2017 12:40:12 +0200 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from elxacz23q12.ki.sw.ericsson.se (192.176.1.81) by DBXPR07MB317.eurprd07.prod.outlook.com (2a01:111:e400:941d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1304.10; Mon, 24 Jul 2017 10:40:11 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH 1/3] gdb lwp_info: Add destructor, initialize fields, use new/delete Date: Mon, 24 Jul 2017 12:39:55 +0200 Message-ID: <1500892797-7523-2-git-send-email-simon.marchi@ericsson.com> In-Reply-To: <1500892797-7523-1-git-send-email-simon.marchi@ericsson.com> References: <1500892797-7523-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-ClientProxiedBy: DB6P190CA0007.EURP190.PROD.OUTLOOK.COM (2603:10a6:6:2f::20) To DBXPR07MB317.eurprd07.prod.outlook.com (2a01:111:e400:941d::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 56a4b4a6-7dfd-42e7-26ca-08d4d2805c52 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DBXPR07MB317; X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB317; 3:t1tQS96JfAEYfU8OjgJnpwBU6xLXnbOi26UadFQrE/Zu/36BOkruta2BWY9npYlWBEc5ZT3cGFXVKu4WEOcFsoFPRrWcQdh3fyrZvkS4nOB/3xU+qFWbsEWC3rYksHUdqNuuzmjCL5ThNFAnLFfSKQ3sT5IHCx6Zuy6rLFMaJXNONVEYznfq8FOwhOdeXXYQuE0ewN3Q92PzUdaxlpXTcgRLGlevQ/LPq0Satl0tMSSJMXIB0Y1E72pPLl49eYx7tLhOYCcy7nqkNCyaG1nsJ0+WLVEMBCgiHM4KgNryq5aRFAHTWFNSMyKNfQhbUFaD+KjjiSNll+Hi36lNp8rSOlky7Ak59Zgtz0CXAGxKZAhyD70Xx/vfe8+qYpQH4yTKZlag0WDZs9iZ+Z1WGrtEuyAbWrUemLjRrxyKdeglrsF8q281WS+7kRQw/yW0TX+JE8kF91sVip/2/1eMJeFgoxF9WKnp12271L3U6m/0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mc9H3PjLnQnDSphdtZxInscDwvGSymVtPzi06pPe15pqG2zN92bh8XOrlsJMZbCwJzLeyQH3uRQwy5qx2yVEFBCVCotpzLnoxcTAgoKru+8o0d/zcdnvteaAZePemz4zBj4kS2jgJc9Dk2fHO3GYI8c3Hy2WHYtxpOqPnDcYijXN6z8Bb8RfBOe6cxgQYdHXlzaQWEV0iWXk9BFVQ8B7c7DGwserIbEmdmDLjgB2z6w5Ym/DT6s0XDL4wIffyxVZERd7OesVJPXlxNzHpz2hhZVmVSV42c3cEfPZlWWozHi86+a4vuJYFkAgghMxUj5ByNd3tPvu93KOdCaw0rDHCx8G23rLMgV5gNi43qVlU/CCcQIvukB07Zse+XwpVAaxCctzxryQMONKmgbWNd9h+7emGQZmsC2hfKWM X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DBXPR07MB317; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DBXPR07MB317; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DBXPR07MB317; 4:tG0omZD9FYDafw8ek4wRRFnZd3Cpvc9KZ5vaM3B71Ul?= =?us-ascii?Q?z/P2vlWg//j3wlm7r2v7KR8Pwf2wrajpJoUdbMHzgGlJZ4ygVE49LybrEwYR?= =?us-ascii?Q?Sg2ed/YcoqeXo6DntLnemlZAKWdDvzLS4rH2XfGbaZCfk4OZtmf4ZOTWUfwh?= =?us-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HU0UX0m5QoNgQEi?= =?us-ascii?Q?Cp/KRytcu849VmriR10F0YkCkyQLESvajLnotbTUj6aV4OVb5Hha36Jljk1o?= =?us-ascii?Q?AW4z+qtiXQC3pIEqRYz+L5dg3brJv?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39850400002)(39450400003)(39400400002)(39410400002)(39860400002)(39840400002)(54534003)(189002)(199003)(110136004)(53936002)(6512007)(66066001)(97736004)(189998001)(6666003)(68736007)(38730400002)(5890100001)(7350300001)(101416001)(50986999)(76176999)(86362001)(5660300001)(6116002)(3846002)(42186005)(36756003)(6916009)(2950100002)(33646002)(81166006)(81156014)(7736002)(305945005)(25786009)(4326008)(2361001)(2351001)(48376002)(2906002)(478600001)(105586002)(8676002)(6486002)(5003940100001)(50466002)(50226002)(106356001)(47776003)(6506006); DIR:OUT; SFP:1101; SCL:1; SRVR:DBXPR07MB317; H:elxacz23q12.ki.sw.ericsson.se; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DBXPR07MB317; 23:Eq3tjTJon7dp7AzloMBdPJ2nfD6Q6BoMuBTfcDWun2?= =?us-ascii?Q?0RHpmAHtXQEHTY5M8OwMpSLNHaPl+XGSRy9SCcwmAlmKE1K+XLKDbnTIOk3s?= =?us-ascii?Q?nRxlwFvIGe94ScdQku9eqKh4gZlXZIfgwr7X5GCRMMYmGoGRQINLEcAVV3mJ?= =?us-ascii?Q?yUr8SI8cFSAGI90UdrUzAGwZH7jzGllzuX86Inm5r2J1Bb+ydd+B6v56zIIT?= =?us-ascii?Q?Q39fjkeZTPj/BkeuIAHPQnyMGB3zDX+1OdX4Rwa5csZGyD8KlRJhcDXHe6Hn?= =?us-ascii?Q?l2iYo7INsCgMAYCexQmRT4V99BOTStjKHGgOUQnX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r2YhGOjI3WJr/Hnnq7iPiWvpmOVvbX3jR/ouBg1rBXuOEfzMP5ki7hzP91s?= =?us-ascii?Q?47IbUCmjIK188bgkkjgyZ+M4KfnwSEw+pU1i5WkaiAyki1S39qRoLZMFSN4a?= =?us-ascii?Q?mRag93QXYCp83gRO/hTZ+/duzBoQKsCY6le2dwUet892hPPQW8MUDCvNslOW?= =?us-ascii?Q?qbeA=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DBXPR07MB317; 6:ltMdJOmbRjp3rkkroLJzndpbdVo/SEqHS1D2q2QloVL?= =?us-ascii?Q?RhTOQWZI2j6z6s/BqY6dssVzkgW+AJfobQValll5jplKW1vXvgOyZhBRKbyK?= =?us-ascii?Q?znHV0pMz9haFNoVH2HxUfk5XGs+tond2Eguah/T1YBVPnaDGHKRevO75t9aP?= =?us-ascii?Q?r//1hNrAq9XhjQTbCycWRXKfcvtvwivwM9Wrmd3xaItRcHG9cjTg2EIJjI/F?= =?us-ascii?Q?miyXpeEvvIHP3/NeWMZ0fG3nyGkgx1G8siDqLiLFvAAkhz28DQX5RNAckARy?= =?us-ascii?Q?KuO4BvoKy1oqbTBs2phDYPU9EyJIclgCZ6GdhX7q6i31nhISsO9f3qC0cPCn?= =?us-ascii?Q?sHzTX/BmubjK/mWQRw9XbTAZHSE623D9BwK96N/zmiYPmP7KVfq8ImoOW4US?= =?us-ascii?Q?0lpueQFD/xWNbbK8lBgJavAbt7oOJ8B1+PsredmUfus6r9xO6CI8IhYjaM7f?= =?us-ascii?Q?hDt+BhTsSNdi52hAivvwNkpiduU2DpT3AWRRbQuyulrTZrwp6V++jmdQfm0Z?= =?us-ascii?Q?pGNQvhlHpoJ6Qe8ItPBAeXYmgkrL4YJ37LjXyLSJRauzvkrfm6y4MPRhoBBr?= =?us-ascii?Q?9b8+L/9bBcGPhEEgkn0GuxpPZ51TBXuZ/vweiyhIT3+0kQat6heJDtPBJOAT?= =?us-ascii?Q?j0pNHkr5DnyhoQ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j9e7PQQ2JSpKP/O9SovPA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DBXPR07MB317; 7:KWDeDIMebgQrFRNV5cCwk/3WU+yD06mgDk+rCAD12LaNW8iIKJPa88lKrhMntjf6mVCkHrBLBIY3wRvT1yYWqEeVamg6A8AckwJxsTo+tZtG+KP0JUEJjnHF2OTUSeuKJgB00XvQ3f+1H8Fkt2knJZugdc3XABQ68PpJCgct9S0FQX99BpKVRVKdDdytPCuvcfVQMt/ZjS9K7xnZ/DwWBK67zOPG4VpC4ANoGwj9mhp7xkIhD/Scswu45wRNi4+Co46IUmGfiifond1OPYiTt2665NhS6qyNDObr1nrwCYvrcD/cOtAV3ZbRzCQSvRHBh3I399pJvZ8YbQAnE/vQBO6CUL5uqhQqvYoSKz9euN+/yiQ6BGGtTxz3AqLfaB6fzJ8Q+ZtD1Zp/WeW34zLbHsgwGt7VCYHZ4ESdi9PxETQNBIdJj0jvBrm74fbSKZ7StvboPqGxOwfRQkITM2ZlO7Z8ZZwOe4wy9JzDVgYpbOLTdSa0eTyeYyNcGH/tejpPq4iZYDRWHo9jYe5HAjhCpfnMU4EdFG0jXs4KBLCbjBRsEaNZ29xNITQuwby87hv94Gf5KlK4M1i6mrsWx+NpTffBg+RnuVGeTRfi8HWJkCQmh6JLFK0mfBQs7mHTZ6ANBaceAcPo3hkUTn0QI0gAs8xLfYeu6D04Q8k9JmvNcJ9+47povxI2dnZsMz8icRUxkvWmBobtEu/e8QU1ZvLsy4sdms87r/DMn4rCh+yGoxVdEcllh6Qjb+BqGa6lK7y/YEbZR69ETevNRjm8jd/lfuatwIbzypg75SO4UbMNX7k= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 10:40:11.0742 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBXPR07MB317 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes From: Simon Marchi Partially convert the lwp_info type to C++ by adding a constructor and initializing fields directly in the struct declaration. Also, change a few fields to bool. I did this patch in order to be able to use a unique_ptr field in a following patch. gdb/ChangeLog: * linux-nat.h (struct lwp_info): Add constructor, initialize fields with default values. : Change type to bool. * linux-nat.c (linux_child_follow_fork): Adapt to type change to bool. (lwp_free): Use delete on lp. (add_initial_lwp): Create lwp_info by calling lwp_info constructor. (delete_lwp): Likewise. (find_lwp_pid): Likewise. (linux_nat_switch_fork): Adapt to type change to bool. (linux_nat_post_attach_wait): Change type of SIGNALLED parameter to bool *. (attach_proc_task_lwp_callback): Adapt to type change to bool. (linux_nat_attach): Adapt to type change to bool. (detach_one_lwp): Likewise. (linux_resume_one_lwp_throw): Likewise. (resume_clear_callback): Likewise. (resume_set_callback): Likewise. (linux_handle_syscall_trap): Likewise. (linux_handle_extended_wait): Likewise. (wait_lwp): Likewise. (stop_callback): Likewise. (set_ignore_sigint): Likewise. (maybe_clear_ignore_sigint): Likewise. (check_stopped_by_watchpoint): Likewise. (stop_wait_callback): Likewise. (linux_nat_filter_event): Likewise. (linux_nat_wait_1): Likewise. --- gdb/linux-nat.c | 92 +++++++++++++++++++++++++-------------------------------- gdb/linux-nat.h | 52 +++++++++++++++++--------------- 2 files changed, 68 insertions(+), 76 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 8b29245..9378276 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -493,7 +493,7 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child, old_chain = save_inferior_ptid (); inferior_ptid = child_ptid; child_lp = add_lwp (inferior_ptid); - child_lp->stopped = 1; + child_lp->stopped = true; child_lp->last_resume_kind = resume_stop; /* Detach new forked process? */ @@ -557,7 +557,7 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child, fprintf_unfiltered (gdb_stdlog, "LCFF: waiting for VFORK_DONE on %d\n", parent_pid); - parent_lp->stopped = 1; + parent_lp->stopped = true; /* We'll handle the VFORK_DONE event like any other event, in target_wait. */ @@ -608,7 +608,7 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child, resuming the inferior. */ parent_lp->status = 0; parent_lp->waitstatus.kind = TARGET_WAITKIND_VFORK_DONE; - parent_lp->stopped = 1; + parent_lp->stopped = true; /* If we're in async mode, need to tell the event loop there's something here to process. */ @@ -622,7 +622,7 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child, struct lwp_info *child_lp; child_lp = add_lwp (inferior_ptid); - child_lp->stopped = 1; + child_lp->stopped = true; child_lp->last_resume_kind = resume_stop; /* Let the thread_db layer learn about this new process. */ @@ -838,7 +838,7 @@ static void lwp_free (struct lwp_info *lp) { xfree (lp->arch_private); - xfree (lp); + delete lp; } /* Traversal function for purge_lwp_list. */ @@ -884,19 +884,9 @@ purge_lwp_list (int pid) static struct lwp_info * add_initial_lwp (ptid_t ptid) { - struct lwp_info *lp; - gdb_assert (ptid_lwp_p (ptid)); - lp = XNEW (struct lwp_info); - - memset (lp, 0, sizeof (struct lwp_info)); - - lp->last_resume_kind = resume_continue; - lp->waitstatus.kind = TARGET_WAITKIND_IGNORE; - - lp->ptid = ptid; - lp->core = -1; + lwp_info *lp = new lwp_info (ptid); /* Add to sorted-by-reverse-creation-order list. */ lwp_list_add (lp); @@ -935,9 +925,8 @@ delete_lwp (ptid_t ptid) { struct lwp_info *lp; void **slot; - struct lwp_info dummy; + lwp_info dummy (ptid); - dummy.ptid = ptid; slot = htab_find_slot (lwp_lwpid_htab, &dummy, NO_INSERT); if (slot == NULL) return; @@ -962,14 +951,13 @@ find_lwp_pid (ptid_t ptid) { struct lwp_info *lp; int lwp; - struct lwp_info dummy; if (ptid_lwp_p (ptid)) lwp = ptid_get_lwp (ptid); else lwp = ptid_get_pid (ptid); - dummy.ptid = ptid_build (0, lwp, 0); + lwp_info dummy (ptid_build (0, lwp, 0)); lp = (struct lwp_info *) htab_find (lwp_lwpid_htab, &dummy); return lp; } @@ -1010,7 +998,7 @@ linux_nat_switch_fork (ptid_t new_ptid) purge_lwp_list (ptid_get_pid (inferior_ptid)); lp = add_lwp (new_ptid); - lp->stopped = 1; + lp->stopped = true; /* This changes the thread's ptid while preserving the gdb thread num. Also changes the inferior pid, while preserving the @@ -1045,7 +1033,7 @@ exit_lwp (struct lwp_info *lp) Returns a wait status for that LWP, to cache. */ static int -linux_nat_post_attach_wait (ptid_t ptid, int *signalled) +linux_nat_post_attach_wait (ptid_t ptid, bool *signalled) { pid_t new_pid, pid = ptid_get_lwp (ptid); int status; @@ -1093,7 +1081,7 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled) if (WSTOPSIG (status) != SIGSTOP) { - *signalled = 1; + *signalled = true; if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Received %s after attaching\n", @@ -1176,14 +1164,14 @@ attach_proc_task_lwp_callback (ptid_t ptid) /* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH brings it to a halt. */ - lp->signalled = 1; + lp->signalled = true; /* We need to wait for a stop before being able to make the next ptrace call on this LWP. */ lp->must_set_ptrace_flags = 1; /* So that wait collects the SIGSTOP. */ - lp->resumed = 1; + lp->resumed = true; /* Also add the LWP to gdb's thread list, in case a matching libthread_db is not found (or the process uses @@ -1279,10 +1267,10 @@ linux_nat_attach (struct target_ops *ops, const char *args, int from_tty) status, (long) ptid_get_lwp (ptid)); } - lp->stopped = 1; + lp->stopped = true; /* Save the wait status to report later. */ - lp->resumed = 1; + lp->resumed = true; if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNA: waitpid %ld, saving status %s\n", @@ -1419,7 +1407,7 @@ detach_one_lwp (struct lwp_info *lp, int *signo_p) target_pid_to_str (lp->ptid)); kill_lwp (lwpid, SIGCONT); - lp->signalled = 0; + lp->signalled = false; } if (signo_p == NULL) @@ -1582,7 +1570,7 @@ linux_resume_one_lwp_throw (struct lwp_info *lp, int step, later try to stop the LWP and hang forever waiting for a stop status. Note that we must not throw after this is cleared, otherwise handle_zombie_lwp_error would get confused. */ - lp->stopped = 0; + lp->stopped = false; lp->core = -1; lp->stop_reason = TARGET_STOPPED_BY_NO_REASON; registers_changed_ptid (lp->ptid); @@ -1714,7 +1702,7 @@ linux_nat_resume_callback (struct lwp_info *lp, void *except) static int resume_clear_callback (struct lwp_info *lp, void *data) { - lp->resumed = 0; + lp->resumed = false; lp->last_resume_kind = resume_stop; return 0; } @@ -1722,7 +1710,7 @@ resume_clear_callback (struct lwp_info *lp, void *data) static int resume_set_callback (struct lwp_info *lp, void *data) { - lp->resumed = 1; + lp->resumed = true; lp->last_resume_kind = resume_continue; return 0; } @@ -1888,7 +1876,7 @@ linux_handle_syscall_trap (struct lwp_info *lp, int stopping) lp->syscall_state = TARGET_WAITKIND_IGNORE; ptrace (PTRACE_CONT, ptid_get_lwp (lp->ptid), 0, 0); - lp->stopped = 0; + lp->stopped = false; return 1; } @@ -2063,8 +2051,8 @@ linux_handle_extended_wait (struct lwp_info *lp, int status) pid, new_pid); new_lp = add_lwp (ptid_build (ptid_get_pid (lp->ptid), new_pid, 0)); - new_lp->stopped = 1; - new_lp->resumed = 1; + new_lp->stopped = true; + new_lp->resumed = true; /* If the thread_db layer is active, let it record the user level thread id and status, and add the thread to GDB's @@ -2093,7 +2081,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status) fork / vfork than for clone, so we do not try - but we handle it for clone events here. */ - new_lp->signalled = 1; + new_lp->signalled = true; /* We created NEW_LP so it cannot yet contain STATUS. */ gdb_assert (new_lp->status == 0); @@ -2133,7 +2121,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status) /* The thread that execed must have been resumed, but, when a thread execs, it changes its tid to the tgid, and the old tgid thread might have not been resumed. */ - lp->resumed = 1; + lp->resumed = true; return 0; } @@ -2280,7 +2268,7 @@ wait_lwp (struct lwp_info *lp) } gdb_assert (WIFSTOPPED (status)); - lp->stopped = 1; + lp->stopped = true; if (lp->must_set_ptrace_flags) { @@ -2349,7 +2337,7 @@ stop_callback (struct lwp_info *lp, void *data) errno ? safe_strerror (errno) : "ERRNO-OK"); } - lp->signalled = 1; + lp->signalled = true; gdb_assert (lp->status == 0); } @@ -2413,7 +2401,7 @@ set_ignore_sigint (struct lwp_info *lp, void *data) && WSTOPSIG (lp->status) == SIGINT) lp->status = 0; else - lp->ignore_sigint = 1; + lp->ignore_sigint = true; return 0; } @@ -2436,7 +2424,7 @@ maybe_clear_ignore_sigint (struct lwp_info *lp) fprintf_unfiltered (gdb_stdlog, "MCIS: Clearing bogus flag for %s\n", target_pid_to_str (lp->ptid)); - lp->ignore_sigint = 0; + lp->ignore_sigint = false; } } @@ -2475,7 +2463,7 @@ check_stopped_by_watchpoint (struct lwp_info *lp) linux_ops->to_stopped_data_address (¤t_target, &lp->stopped_data_address); else - lp->stopped_data_address_p = 0; + lp->stopped_data_address_p = false; } do_cleanups (old_chain); @@ -2549,11 +2537,11 @@ stop_wait_callback (struct lwp_info *lp, void *data) if (lp->ignore_sigint && WIFSTOPPED (status) && WSTOPSIG (status) == SIGINT) { - lp->ignore_sigint = 0; + lp->ignore_sigint = false; errno = 0; ptrace (PTRACE_CONT, ptid_get_lwp (lp->ptid), 0, 0); - lp->stopped = 0; + lp->stopped = false; if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "PTRACE_CONT %s, 0, 0 (%s) " @@ -2593,7 +2581,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) /* Reset SIGNALLED only after the stop_wait_callback call above as it does gdb_assert on SIGNALLED. */ - lp->signalled = 0; + lp->signalled = false; } } @@ -2995,8 +2983,8 @@ linux_nat_filter_event (int lwpid, int status) lwpid); lp = add_lwp (ptid_build (lwpid, lwpid, 0)); - lp->stopped = 1; - lp->resumed = 1; + lp->stopped = true; + lp->resumed = true; add_thread (lp->ptid); } @@ -3019,7 +3007,7 @@ linux_nat_filter_event (int lwpid, int status) /* This LWP is stopped now. (And if dead, this prevents it from ever being continued.) */ - lp->stopped = 1; + lp->stopped = true; if (WIFSTOPPED (status) && lp->must_set_ptrace_flags) { @@ -3088,7 +3076,7 @@ linux_nat_filter_event (int lwpid, int status) ptid_get_lwp (lp->ptid), lp->resumed); /* Dead LWP's aren't expected to reported a pending sigstop. */ - lp->signalled = 0; + lp->signalled = false; /* Store the pending event in the waitstatus, because W_EXITCODE(0,0) == 0. */ @@ -3101,7 +3089,7 @@ linux_nat_filter_event (int lwpid, int status) if (lp->signalled && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP) { - lp->signalled = 0; + lp->signalled = false; if (lp->last_resume_kind == resume_stop) { @@ -3138,7 +3126,7 @@ linux_nat_filter_event (int lwpid, int status) target_pid_to_str (lp->ptid)); /* This is a delayed SIGINT. */ - lp->ignore_sigint = 0; + lp->ignore_sigint = false; linux_resume_one_lwp (lp, lp->step, GDB_SIGNAL_0); if (debug_linux_nat) @@ -3177,7 +3165,7 @@ linux_nat_filter_event (int lwpid, int status) mark it as ignored for all LWPs except this one. */ iterate_over_lwps (pid_to_ptid (ptid_get_pid (lp->ptid)), set_ignore_sigint, NULL); - lp->ignore_sigint = 0; + lp->ignore_sigint = false; } else maybe_clear_ignore_sigint (lp); @@ -3314,7 +3302,7 @@ linux_nat_wait_1 (struct target_ops *ops, ptid_get_pid (inferior_ptid), 0)); lp = add_initial_lwp (inferior_ptid); - lp->resumed = 1; + lp->resumed = true; } /* Make sure SIGCHLD is blocked until the sigsuspend below. */ diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h index 3378bd6..a783674 100644 --- a/gdb/linux-nat.h +++ b/gdb/linux-nat.h @@ -29,82 +29,86 @@ struct arch_lwp_info; struct lwp_info { + lwp_info (ptid_t ptid_) + : ptid (ptid_) + {} + /* The process id of the LWP. This is a combination of the LWP id and overall process id. */ ptid_t ptid; /* If this flag is set, we need to set the event request flags the next time we see this LWP stop. */ - int must_set_ptrace_flags; + bool must_set_ptrace_flags = false; - /* Non-zero if we sent this LWP a SIGSTOP (but the LWP didn't report + /* True if we sent this LWP a SIGSTOP (but the LWP didn't report it back yet). */ - int signalled; + bool signalled = false; - /* Non-zero if this LWP is stopped. */ - int stopped; + /* True if this LWP is stopped. */ + bool stopped = false; - /* Non-zero if this LWP will be/has been resumed. Note that an LWP + /* True if this LWP will be/has been resumed. Note that an LWP can be marked both as stopped and resumed at the same time. This happens if we try to resume an LWP that has a wait status pending. We shouldn't let the LWP run until that wait status has been processed, but we should not report that wait status if GDB didn't try to let the LWP run. */ - int resumed; + bool resumed = false; /* The last resume GDB requested on this thread. */ - enum resume_kind last_resume_kind; + resume_kind last_resume_kind = resume_continue; /* If non-zero, a pending wait status. */ - int status; + int status = 0; /* When 'stopped' is set, this is where the lwp last stopped, with decr_pc_after_break already accounted for. If the LWP is running, and stepping, this is the address at which the lwp was resumed (that is, it's the previous stop PC). If the LWP is running and not stepping, this is 0. */ - CORE_ADDR stop_pc; + CORE_ADDR stop_pc = 0; - /* Non-zero if we were stepping this LWP. */ - int step; + /* True if we were stepping this LWP. */ + bool step = false; /* The reason the LWP last stopped, if we need to track it (breakpoint, watchpoint, etc.) */ - enum target_stop_reason stop_reason; + target_stop_reason stop_reason = TARGET_STOPPED_BY_NO_REASON; /* On architectures where it is possible to know the data address of - a triggered watchpoint, STOPPED_DATA_ADDRESS_P is non-zero, and + a triggered watchpoint, STOPPED_DATA_ADDRESS_P is true, and STOPPED_DATA_ADDRESS contains such data address. Otherwise, STOPPED_DATA_ADDRESS_P is false, and STOPPED_DATA_ADDRESS is undefined. Only valid if STOPPED_BY_WATCHPOINT is true. */ - int stopped_data_address_p; - CORE_ADDR stopped_data_address; + bool stopped_data_address_p = false; + CORE_ADDR stopped_data_address = 0; - /* Non-zero if we expect a duplicated SIGINT. */ - int ignore_sigint; + /* True if we expect a duplicated SIGINT. */ + bool ignore_sigint = false; /* If WAITSTATUS->KIND != TARGET_WAITKIND_SPURIOUS, the waitstatus for this LWP's last event. This may correspond to STATUS above, or to a local variable in lin_lwp_wait. */ - struct target_waitstatus waitstatus; + target_waitstatus waitstatus { TARGET_WAITKIND_IGNORE }; /* Signal whether we are in a SYSCALL_ENTRY or in a SYSCALL_RETURN event. Values: - TARGET_WAITKIND_SYSCALL_ENTRY - TARGET_WAITKIND_SYSCALL_RETURN */ - enum target_waitkind syscall_state; + target_waitkind syscall_state = TARGET_WAITKIND_IGNORE; /* The processor core this LWP was last seen on. */ - int core; + int core = -1; /* Arch-specific additions. */ - struct arch_lwp_info *arch_private; + arch_lwp_info *arch_private = NULL; /* Previous and next pointers in doubly-linked list of known LWPs, sorted by reverse creation order. */ - struct lwp_info *prev; - struct lwp_info *next; + lwp_info *prev = NULL; + lwp_info *next = NULL; }; /* The global list of LWPs, for ALL_LWPS. Unlike the threads list,