From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 200663858D35; Sun, 7 Jan 2024 06:50:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 200663858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 200663858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704610241; cv=none; b=gUyYa3Iog9a3dQObcr0GdjfwsI+Acpj3y09C5NSCLGg0mGkn2+KUF5bjLXN2oEKZpdMo4HoUJo8Glz3RJuUTnbv15eIUaLNvSfbPpBzxfRMgOWeJYSJSQS9BkkxLSVNWaXQ+e2ZV4FeCcOOAmuvmZT7HwiL9/+5OILRDo9fX7cw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704610241; c=relaxed/simple; bh=DyzRbmRePOocUWjWpK2LO4rEZGGDHAGJTR2Zox9bOm8=; h=DKIM-Signature:Date:Message-Id:From:To:Subject:MIME-version; b=Yf6USLizFIxZadLGnvnZ6ctFe+FtUz19cYDYEgMOh3ui1nDbggaAC3eP0izE71JqYk4MuDc9tAAWyx2j1qFtxpg2c4pMr/tAqEA7qcxcW0+zxcsXA/lNl+/RI5uIqPRnaDeXQK1VZhkB9vtuv0auA1AW+iqlxmEBPwo+s/FhpJw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ROifLYlRP4jciLOIYK1Gdr7zGYEWcQJhwnOE60o8dY4=; b=DlG+UlFd408m/ZkCXGyp 3GqMIfXKeQRN1f5WDROS6eHzSuFAGfPE3vSZ6WwPNv6a0wTzFYV+lt4+1FftrfCChtcQ/NmfqiELI EoXEc1LNo0m7RdVKNCzedYAs6hn62K9fwEx2cpviA9gfVRR77zJZReTN1RcMfAC0p+jMOmnWXOH6g hccdJY/lnwxovrbAgaqyJ4virFyiP3Vl/lox78NKSCV1R1CVyucFE8+CXmGad2hkR5unuBM3x2pQD WuakdlG5LCC2PsWVLF9djhhg/BrB0mEjn5eEa6ZSe7XKki5+nRIyeJgkXusFPwhR+pVW+OItzLpQ7 FMvvHwjuef25OA==; Date: Sun, 07 Jan 2024 08:50:31 +0200 Message-Id: <83bk9xsklk.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Bj=C3=B6rn_Sch=C3=A4pers?= Cc: iant@google.com, gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org In-Reply-To: <863fd658-11e9-455e-9def-8a95217bc98f@hazardy.de> (message from =?utf-8?Q?Bj=C3=B6rn_Sch=C3=A4pers?= on Sat, 6 Jan 2024 23:15:24 +0100) Subject: Re: [PATCH 6/4] libbacktrace: Add loaded dlls after initialize References: <20230120105409.54949-1-gcc@hazardy.de> <20230120105409.54949-4-gcc@hazardy.de> <0c08e584-499f-473f-8699-a41c6a967536@hazardy.de> <863fd658-11e9-455e-9def-8a95217bc98f@hazardy.de> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Sat, 6 Jan 2024 23:15:24 +0100 > From: Björn Schäpers > Cc: gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org > > This patch adds libraries which are loaded after backtrace_initialize, like > plugins or similar. > > I don't know what style is preferred for the Win32 typedefs, should the code use > PVOID or void*? It doesn't matter, at least not if the source file includes the Windows header files (where PVOID is defined). > + if (reason != /*LDR_DLL_NOTIFICATION_REASON_LOADED*/1) IMO, it would be better to supply a #define if undefined: #ifndef LDR_DLL_NOTIFICATION_REASON_LOADED # define LDR_DLL_NOTIFICATION_REASON_LOADED 1 #endif > + if (!GetModuleHandleEx (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS > + | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, > + (TCHAR*) notification_data->dll_base, Is TCHAR correct here? does libbacktrace indeed use TCHAR and relies on compile-time definition of UNICODE? (I'm not familiar with the internals of libbacktrace, so apologies if this is a silly question.) Thanks.