From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by sourceware.org (Postfix) with ESMTPS id D5CE13858CDA for ; Tue, 23 Jan 2024 22:37:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D5CE13858CDA Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D5CE13858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706049446; cv=none; b=qjBv3w2iJEZNO97ObzHEbcGY8WlBjt/hW3SEF61ZYtfd1V+oCmGdDfg1n4JUufVe540LY4aQUFUesP9jqH1gfOHDn42M/oyRNpT7/erTfl0Xm3Luexm5Lz9RoauniKP/SDN0NN+DIVL4hVPFb1xWqQk76LYkDNWqSo+WJa+5R/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706049446; c=relaxed/simple; bh=xNNv5ZsMfGLcZhtRPt3J6F/OyrSqRmLHq0CGDqRSbtw=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=c7qY9hB67cc+gDp/I54onUlcdo7OJePs5idG6c++shwFR5fsnVnP5zvY9zF5/OVo6cswe5lf+cclSUiCWZbhO8eB2TTAageNlnL67RFsD2ghJXhJmR8heJoJZ60YkJsHZ/q87tc20UAvV260jTfhFS3hEFS3lv6HqVzkI610HPk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5999f3f6ce9so1085229eaf.0 for ; Tue, 23 Jan 2024 14:37:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706049444; x=1706654244; 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=gsDUMc1YXzomaWz+9yujvQljcGXpzNP1Sf5qO7vI+eE=; b=BVyvMIp64uoOq7yyOiMMrOE/0kDjn77OE0wRCuxt0epgvTiTBg5xTkQSB+8GDvjt07 TXY5Tn4nBcUL09EaCPyfn7MOmaQRNPurOzqPrUp+MKt6sGych3CR9UIx3zPyg8Ll6GO2 h2ITaumfpbERAwoORuTht3S8mLm42kn6L0B+NDnSwD7ZLLEiYS278pbuaedQlqbvniGc cu/8dG3e0KfEXUJPlfsTkXtVy47gJsSul5J+RDA3/g2F40PZeyaYTFAgoyHb3VJENgdL vk/K8k+xB1+oaJW3B1pIL7J2blPoQeFoLMkGWSVLHLlVgzgMhlUwD4oANSTVOa4pXcVS rGyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706049444; x=1706654244; 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=gsDUMc1YXzomaWz+9yujvQljcGXpzNP1Sf5qO7vI+eE=; b=NDgTwjulBdNCaLB7dV1WhgCdF6MZI0XQa26LReqxOX1xKVwSiAxpQOJEE+jf5Il7Kl DD7wlWgpJ6IT8dHI0cy1JwCfXoDwA2GxZ2Z7wLqV7Tk1omwBpcRLsUz8nJG3tA8HBmxS qHLzHFiZSe58sSQ7Nqk016ByLansDx033M0JeWaQD1SBFRC9W8iSxNzqvUR7PFT8XPGv hbCxz8rhi2icesa5Jg4u8llggMyP7csbuKxjHk2VPGkazMqdkYPJSjhWs9i7LoZsWVST 4BQph2TftJJGLZRCP3hn5opVm4F7X2gTIdEO3Cu5tl+WdFKsMwLT236eEfn/ErUcvkIq 26Lg== X-Gm-Message-State: AOJu0YyyarcS5jCoo9UQpVgdfo36WK4gHmzD3nKPmkTJaBgaB0RlPLvc Djjvnh3VpRZRXlnDnlflSL3d99NVci6yOJYwBf8luhxc5vITdhlY4zAGsailCl5FkCMfZOubpzi oDIaGLlGSCdnpQvUdy2BZvpl0fdnSCqb5R7oI X-Google-Smtp-Source: AGHT+IHM1Llg/963SVAcyF524H86dcEBKcp1BgSmcq8FA+bMj9+NJnyT4+hZYOo0PBqHe8z+95xpQuNWoPycjYrsEF4= X-Received: by 2002:a05:6358:8813:b0:175:9e9a:45be with SMTP id hv19-20020a056358881300b001759e9a45bemr7169642rwb.17.1706049443985; Tue, 23 Jan 2024 14:37:23 -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> In-Reply-To: From: Ian Lance Taylor Date: Tue, 23 Jan 2024 14:37:12 -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=-17.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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: 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, excep= t > >>> that libraries loaded after the backtrace_initialize are not handled. > >>> 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 missin= g. > EnumProcessModules stated the correct number of modules, but did not fill= 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 HMODULEs. > > So I went a different way. This detects all libraries correctly, in 32 an= d 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 EnumProcessModule= s variant? Is there any reason to use both patches? Seems simpler to just use this one if it works. Thanks. Ian