From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by sourceware.org (Postfix) with ESMTPS id F2A8B38618EB for ; Wed, 8 Jul 2020 16:12:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F2A8B38618EB Received: by mail-qt1-x841.google.com with SMTP id g13so34904196qtv.8 for ; Wed, 08 Jul 2020 09:12:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uNbx45zTqPSO1TM0SiFigHb6/SiQxcnXnXqv+Fuezzc=; b=i8hhlwQE3PuNkQ2k+04jWTTBU518kRW6VpGmOiTmPSX0mN0sGMs6bxc1yBafZVP2Z6 PLd0Br+BNv9NO0O6xSgrJR+j7UwPUfQTFLYnGRvpZYPJYPoHSEvfXK+DUFpgk1MwCDhd UNwIvjH7yVf88NYFW770+1FHBk/ztKMVryU/SyF3LcW8G/LNnI+D08Ik6ZoRggW3sAAL 0GEd2OC/IUqI+gueb4xCNIVFy0aIfZZu2QtxuXhIPbOsgzwUDYzZURr7Rr77+YOtKSHS hGKT/z0gSTeKQHadb+QhqLmURLcYcyJ0c+X29bzFoXk8a577j+eBtJdkHJcEy/IE7Hqp qHCw== X-Gm-Message-State: AOAM533BlXUjFFyNmYCDDPMxQLS4oi2cFCVK7BX/yQ1a+qSRQb2qA6+Q Vyr6+wsFnPSLm8MfYeIRBOy4bJiG53XNOvcItMWKDIXH X-Google-Smtp-Source: ABdhPJwDFJX0cXsLntQCueofRlQ2uIYinnF7Ozr3+Nc/VaKtcs1/RRRHirSvQtC+16eKJdeN+9/SoWiy2ePkQBmnDk8= X-Received: by 2002:ac8:3563:: with SMTP id z32mr40950717qtb.244.1594224741166; Wed, 08 Jul 2020 09:12:21 -0700 (PDT) MIME-Version: 1.0 References: <20200701213225.14144-1-jon.turney@dronecode.org.uk> <20200701213225.14144-8-jon.turney@dronecode.org.uk> In-Reply-To: From: Christian Biesinger Date: Wed, 8 Jul 2020 11:11:44 -0500 Message-ID: Subject: Re: [PATCH 7/7] Add handling for 64-bit module addresses in Cygwin core dumps To: Jon Turney Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 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, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 08 Jul 2020 16:12:23 -0000 On Wed, Jul 8, 2020 at 10:50 AM Jon Turney wrote: > > On 06/07/2020 21:13, Christian Biesinger via Gdb-patches wrote: > > On Wed, Jul 1, 2020 at 4:34 PM Jon Turney wrote: > >> --- a/bfd/elf.c > >> +++ b/bfd/elf.c > >> @@ -10185,10 +10185,19 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) > >> break; > >> > >> case 3 /* NOTE_INFO_MODULE */: > >> - /* Make a ".module/xxxxxxxx" section. */ > >> + case 4 /* NOTE_INFO_MODULE64 */: > > > > It really seems like these should be actual constants, which would > > also make it easier to understand... > > Absolutely. > > Before [1], this structure was defined by including Cygwin's > (so this code didn't work in cross-environments). > > I can't find a model of adding note structure definitions (the other > grok_note functions seem to rely on OS definitions), so I'm not sure > what kind of change you are asking me to make in this patch. I was just suggesting adding a `static constexpr int NOTE_INFO_MODULE64 = 4` in some appropriate place, maybe at the top of this file. Er, I guess this is bfd, so make it a #define. > > [1] > https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=4a6636fbb5c051fbe15d18a005a2a505ef652571 > > > > >> + /* Make a ".module/" section. */ > >> /* module_info.base_address */ > >> - base_addr = bfd_get_32 (abfd, note->descdata + 4); > >> - sprintf (buf, ".module/%08lx", (unsigned long) base_addr); > >> + if (type == 3) > > > > ...this if. > > > >> --- a/gdb/windows-tdep.c > >> +++ b/gdb/windows-tdep.c > >> + if (data_type == 3) /* NOTE_INFO_MODULE */ > > > > Same here.