From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id 3659E385803B for ; Wed, 3 Nov 2021 13:19:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3659E385803B Received: by mail-il1-x12b.google.com with SMTP id w15so2501591ill.2 for ; Wed, 03 Nov 2021 06:19:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VbuT3Vudz2U+qtmw9kT9UOggPCH87p2wwtQgzyUYX44=; b=zAaKrbRfpOtzUqMmgLHYp4QOoqXgwZhjZCi4anfhoIJ2mbXv5AVVjErDWrPuMUukui ekZZ+aCaQvvlfBMDYw302L7HlKcH3+kmJ5IwM5AgpqLXYAy4k9DdeVXNhK994H2wV99w rJKZGIPyGFO4y3dwkwwEOrxr3eRrgvfIGXeQtY1YAmJjxA9HSJiCovxF5AdFDl8DZtO5 oOPaAR6V8kd+kLL7DPnaauEuZEF/iN0ZnUNVeitsD3kbQifWfbC1LoNuToV9yx4KQP8Z GE0fzEltJX5Z3I3QkBMjZdqCoxvSI4Ke1oVLujSN8H6lIZ9a0MgFV+snHaipqd63INOj xgoA== X-Gm-Message-State: AOAM531gNatQJpYyrW3qkkskaDOp5jNZb8TatQE8HzrWf7Cj3dmxvHN6 fCkQAcYxEQf9rN0GzOoHxXPWPovO/KWSF9jrhlxrecqiZEc= X-Google-Smtp-Source: ABdhPJxwH/+F+mh5zgsCFoffo6ayRxgkTGVuGwWS4Y2PgJssnLZ/qg2isTwwapIssF+UDZ/eZMfpUjxw5nZSQjnyM1c= X-Received: by 2002:a5d:850b:: with SMTP id q11mr11849529ion.204.1635924041913; Wed, 03 Nov 2021 00:20:41 -0700 (PDT) MIME-Version: 1.0 References: <11b6bfd2-dc8b-4f07-a6ee-74fceda32054@symas.com> In-Reply-To: <11b6bfd2-dc8b-4f07-a6ee-74fceda32054@symas.com> From: Chris Packham Date: Wed, 3 Nov 2021 20:20:30 +1300 Message-ID: Subject: Re: Process memory map To: Howard Chu Cc: "gdb@sourceware.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_RED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Nov 2021 13:19:43 -0000 On Wed, Nov 3, 2021 at 1:33 PM Howard Chu wrote: > > Is the complete map of process address space saved in a core file? When debugging > with a core file, is there a gdb command to mmap the files that were mapped at the > time the core was taken, so that references to addresses in those regions will be > valid? I recently had a similar need. I found `info proc all` (technically `info proc mappings`) contained the mapping info I needed. For a regular core file the shared libraries were automatically loaded (in my case I needed to `set auto-load safe-path` and `set sysroot` for my cross-build environment). The one slight problem I had was with a very specific core file where the crash was in ld.so in that specific case it wasn't automatically loaded and I had to muck around with `add symbol-file` and manually working out some offsets to get it loaded into the right place. I'd be interested in hearing tips from anyone else. > -- > -- Howard Chu > CTO, Symas Corp. http://www.symas.com > Director, Highland Sun http://highlandsun.com/hyc/ > Chief Architect, OpenLDAP http://www.openldap.org/project/