From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37823 invoked by alias); 14 Oct 2017 08:52:31 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 37813 invoked by uid 89); 14 Oct 2017 08:52:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*r:sk:gdb@sou, rom, ROM, HX-Received:Sat X-HELO: mail-it0-f49.google.com Received: from mail-it0-f49.google.com (HELO mail-it0-f49.google.com) (209.85.214.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 14 Oct 2017 08:52:29 +0000 Received: by mail-it0-f49.google.com with SMTP id o135so13077798itb.0 for ; Sat, 14 Oct 2017 01:52:29 -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:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jw+BDn88kma9PUUZ+Z+ulpe4ibtv+XBZafgzNEFBvzY=; b=g+uSsX/9OhfY17lmwdSHQgbkpa+SzUMim/6MY8qIgYT2MYbPmqaCKo+Udjg8LLWOao SGSejH6YpNbBnSS+p0en6sRkXidMT0+8XgJCOI1vdU7diM9u2gt3qtnwbDAFq5aCPzcm yIry4xUYtWqLJ92tu7TNASkv8nTUZpF+HNrrG9LdR5JQYSl3/25VI6h7gjn2Bl0uaAkb Up+XKBH3bUHRi9/w8zXp2nYFVjz3kWqFNwQqU0EgrJajJF9lUmZHUUmy15r1T5y/cOKN 8kRgZp8GLEB38htu4ZNiHq+5q7vgIiNY/2c3yFofRr8zVJTv1aMnhFcKB6YtlSKEOFxk KQRA== X-Gm-Message-State: AMCzsaUU7M0dZtyzzEl0kH8gqb0GoN66pt71xe42EYRYjxzmCJ487wH9 jCuHDOe7eKBmvL110I9AleMQ/Uebs0sh66Iy7y0= X-Google-Smtp-Source: ABhQp+TDAD5XOCfsaPci1BWMhIwKGgsQVhYcx6p6YrtYL8FnJIhtRSNE/lxtkg3/0fU4w0EpkqXGvKPcGjQzxsHccJ8= X-Received: by 10.36.179.15 with SMTP id e15mr5588109itf.77.1507971147642; Sat, 14 Oct 2017 01:52:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.33.146 with HTTP; Sat, 14 Oct 2017 01:52:27 -0700 (PDT) In-Reply-To: <20171013201955.GK8425@1170ee0b50d5> References: <20171013201955.GK8425@1170ee0b50d5> From: Hesham M Date: Sat, 14 Oct 2017 08:52:00 -0000 Message-ID: Subject: Re: Postmortem debugging with arm-none-eabi-gdb from memory dump (not core) To: Yao Qi Cc: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2017-10/txt/msg00040.txt.bz2 On Fri, Oct 13, 2017 at 4:19 PM, Yao Qi wrote: > On 17-10-05 05:55:38, Hesham M wrote: >> Hi all, >> >> As this is my first email to the list, and as an old user for gdb, I'd l= ike >> first to thank the gdb community for their effort. >> >> In a bare-metal ARM system, is there a way to use arm-none-eabi-gdb for >> postmortem debugging, the same way we do when we debug with core file on >> Linux, for example? >> >> The issue is that I don't have a "core" file but I can generate memory d= ump >> of the whole memory (ROM is already known and through the hardware debug= ger >> used I can write the RAM contents to a file (outside the target of cours= e). >> I can also collect the registers at the time of the crash. I can do the >> debugging/analysis if I connect gdb to the target at the time of the cra= sh >> but I need to do this in later time away from the target. I hope to find= a >> way to debug with memory dumps the same way gdb debugs with core files. >> >> Of course if I can convert the memory dump to a valid core file, it might >> be another path to the solution. I don't know how to do that or if there= is >> a tool that can help with this conversion. >> >> Any idea if this is possible? > > I prefer this approach, and it is possible. GDB has a command "gcore", > https://sourceware.org/gdb/current/onlinedocs/gdb/Core-File-Generation.ht= ml#index-generate_002dcore_002dfile > you can take a loop how GDB does it. > >> >> A variant of this is idea is done for Keil tools: >> https://os.mbed.com/blog/entry/Post-mortem-debugging-with-ARM-mbed/ >> >> I have posted a similar question on stackoverflow but they closed it! So, >> please let me know if my question isn't clear. >> >> Thanks, >> -Hesham > > -- > Yao (=E9=BD=90=E5=B0=A7) Hi Yao, Thanks for replying. Unfortunately, gcore is not implemented for bare-metal ARM, arm-none-eabi-gdb. GDB documentation says abour gcore: Note that this command is implemented only for some systems (as of this writing, GNU/Linux, FreeBSD, Solaris, and S390). Trying it on my system, I got: (gdb) gcore file Command not implemented for this target. I appreciate any ideas or hints. Thanks, -Hesham