From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id C89613858C53 for ; Thu, 25 Jan 2024 22:04:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C89613858C53 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=golang.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C89613858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706220291; cv=none; b=gdih2BlmAJUgGyuUnjFqn+9twoUdno1clYFeJ4iuQQJivZgfSxvIkJbCnp8zd+B7T0YDIVYfZ0t75ffs+Dqb7bwUO9w+LVWzniylV2MZH069Rq2RNzTHci9iqIEGlFtBYPwuRh2DsMOyDRbgd9nHpyYY6pKEKBmvJykbLyCg3QY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706220291; c=relaxed/simple; bh=GDMntkw92f5iP7xhy93AHWBp3Aezorrtx9Mh7Ok1U9c=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Rk+2st7sxT1WiWccl7EepbuzMVhm+4ypKZZnDDMCnQqsv379G0FiY/zCcho8TeIlt9TfXN3YV1E0lN0qmPayZszEAfh9k0qMMve733e9ojMPlnnsP+U4kqLzM7nCTTSx9zIdRnZ1tPD9B3XSmg5v6Aa6aLOPBSHuWwkutqOhE5Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5ce74ea4bf2so845646a12.0 for ; Thu, 25 Jan 2024 14:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google-com.20230601.gappssmtp.com; s=20230601; t=1706220289; x=1706825089; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KllcJ8wudFxzKr1OIQCLioKq2DHmk9hFk3W0FdaSVX0=; b=TxrDTgTdFOYrzfHIeIdKgchOQsNBHl1vc34fhBgvs2D3uYzWqMRozgLt0q2i9yCx7Z iyTV1+ONG8x1IeccurVLC80djpIbLtmUAZDc2tyr95VebH1MC3uAx1U8PJqaDy/XJIPv RQtU0zwwPY08v5lRN9RAwfNADx08O3X+Sm3PI5OTYmhPraOM1hBEUnu6hTKwgP9LEL/P WIHGZlGMMKwTbVn1D5WwxTmqiL7QncsFz1/LEjhZkGbUjxwMZc9Q03oOuw0MYOEoLbZF vmHvSui8bpjKHmIX+jQ/HKMVd5QCgNg1hDxpTNcMXt3jIH4K9z343sZOd6kFqqFV3hcv mWwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706220289; x=1706825089; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KllcJ8wudFxzKr1OIQCLioKq2DHmk9hFk3W0FdaSVX0=; b=shE0+eWFwfSjpu1aBITXOXT4vWjwtfxqS/eOcexYDa9xGxkCgrQ83knJ5MO5Z25FH7 58YT9ZAFwjScVOkMuovEkD7Jdrp/sZGq58x9JL0bLX395BVfhFh9Eg/eKG7O4M7tnPqt I8NIy+usxBmCW0cibrGiU4ijXVQlOyZg47EiXauHv60py+gTqjYn42BPpHG/lSR2pUzc SELrlOWbtW/D1YkjQeUata640cv6c67PiMFXyo6dCtDxEXe2Y6UZXizcNpCfAyVow8PX sN/I+8ZvwPrgyK/uKcCq1hkHgEgKIgWx8h7gTElTsMnbT/BEOpePTVb9VemGi3G0F9tG QBwg== X-Gm-Message-State: AOJu0YyL//YB/e8j00QL6izQcMpdpC1YPJwZnaulkD47omXSnMlC9iMQ /LohUrLgI7Z7W9biVGT/zC6kGMOyU5n6HMBHEF/nzLgoBgNe9pYmkxO05YA+fQC3AHe49U5OsF2 kKAHflM1HEXZPUbMiTOpYFbvjR9B4Tvar0qgM X-Google-Smtp-Source: AGHT+IG7j9Aqa4YPWn4IZ9v2bBnZPrc//kVx89ICvPsWKGWaQleZ2NS6t0eSK86n4gpblHcEpQDV6GpPqxm4z2+LORo= X-Received: by 2002:a05:6a20:7d84:b0:19c:748a:303a with SMTP id v4-20020a056a207d8400b0019c748a303amr308239pzj.17.1706220288474; Thu, 25 Jan 2024 14:04:48 -0800 (PST) MIME-Version: 1.0 References: <20230120105409.54949-1-gcc@hazardy.de> <20230120105409.54949-4-gcc@hazardy.de> <0c08e584-499f-473f-8699-a41c6a967536@hazardy.de> <2bb200e6-2ae7-40b0-86a7-24a72532924c@hazardy.de> In-Reply-To: <2bb200e6-2ae7-40b0-86a7-24a72532924c@hazardy.de> From: Ian Lance Taylor Date: Thu, 25 Jan 2024 14:04:36 -0800 Message-ID: Subject: Re: [PATCH 5/4] libbacktrace: improve getting debug information for loaded dlls To: =?UTF-8?B?QmrDtnJuIFNjaMOkcGVycw==?= Cc: gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_SPF_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Jan 25, 2024 at 11:53=E2=80=AFAM Bj=C3=B6rn Sch=C3=A4pers wrote: > > Am 23.01.2024 um 23:37 schrieb Ian Lance Taylor: > > On Thu, Jan 4, 2024 at 2:33=E2=80=AFPM Bj=C3=B6rn Sch=C3=A4pers wrote: > >> > >> Am 03.01.2024 um 00:12 schrieb Bj=C3=B6rn Sch=C3=A4pers: > >>> Am 30.11.2023 um 20:53 schrieb Ian Lance Taylor: > >>>> On Fri, Jan 20, 2023 at 2:55=E2=80=AFAM Bj=C3=B6rn Sch=C3=A4pers wrote: > >>>>> > >>>>> From: Bj=C3=B6rn Sch=C3=A4pers > >>>>> > >>>>> Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, exc= ept > >>>>> that libraries loaded after the backtrace_initialize are not handle= d. > >>>>> But as far as I can see that's the same for elf. > >>>> > >>>> Thanks, but I don't want a patch that loops using goto statements. > >>>> Please rewrite to avoid that. It may be simpler to call a function. > >>>> > >>>> Also starting with a module count of 1000 seems like a lot. Do > >>>> typical Windows programs load that many modules? > >>>> > >>>> Ian > >>>> > >>>> > >>> > >>> Rewritten using a function. > >>> > >>> If that is commited, could you attribute that commit to me (--author= =3D"Bj=C3=B6rn > >>> Sch=C3=A4pers ")? > >>> > >>> Thanks and kind regards, > >>> Bj=C3=B6rn. > >> > >> I noticed that under 64 bit libraries loaded with LoadLibrary were mis= sing. > >> EnumProcessModules stated the correct number of modules, but did not f= ill the > >> the HMODULEs, but set them to 0. While trying to investigate I noticed= if I do > >> the very same thing from main (in C++) I even got fewer module HMODULE= s. > >> > >> So I went a different way. This detects all libraries correctly, in 32= and 64 > >> bit. The question is, if it should be a patch on top of the previous, = or should > >> they be merged, or even only this solution and drop the EnumProcessMod= ules variant? > > > > Is there any reason to use both patches? Seems simpler to just use > > this one if it works. Thanks. > > > > Ian > > This one needs the tlhelp32 header and its functions, which are (accoridn= g to > the microsoft documentation) are only available since Windows XP rsp. Win= dows > Server 2003. > > If that's no problem, and in my opinion it shouldn't be, then I can basic= ally > drop patch 4 and rebase this one. I don't see that as a problem. It seems like the patch will fall back cleanly on ancient Windows and simply fail to pick up other loaded DLLs. I think that is fine. I'll look for an updated patch. Thanks. Ian