From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81163 invoked by alias); 15 Oct 2017 08:11:46 -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 81150 invoked by uid 89); 15 Oct 2017 08:11:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.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, HX-Received:Sun, hesham, Hesham X-HELO: mail-qk0-f171.google.com Received: from mail-qk0-f171.google.com (HELO mail-qk0-f171.google.com) (209.85.220.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 15 Oct 2017 08:11:44 +0000 Received: by mail-qk0-f171.google.com with SMTP id y23so9527669qkb.10 for ; Sun, 15 Oct 2017 01:11:44 -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; bh=uMc/c3oqvjmHFLjMV+MZowj87ikXsTf0XQ7gWkQAd08=; b=uiLWDGzGCtU4D0EDr7Y2YV/3aGj4fmKrn8x/VwBigl+bMtSfCyeFDd55iDeh6qEl+c hcShoeJBrsaURFAS7Js3KLSOR2UA+YviH9cTbJvi54KrNx75MIjz8LGOR2foqvxBuUAy fA7EXiP5XJQTd5w8jRffZb/bUvQ59gtFZhS/QxIYuO5iiu/2XBgLXvK6ArjeSjbgcz7L Lfd0vWxR10bKqvd2l9sC9kXbdsoWp2wcclyNc9qz7K+VtiOVCjk7k8WX9WzEY2MMyS5p oaSlZCltwaBWPesAhimIf6sQuExUT7NPwxFYvQaayB0vFnhGxqecMf/ldiKAFM81xH+B nQRw== X-Gm-Message-State: AMCzsaWt19D2NMjnrnQK3cEbrjVGl5954hW5nCnHZqRiE9CUkD4Dxh4a oVULIvpLmeZwwGNmEZuBWGwgECq5qSdYf5CSghA= X-Google-Smtp-Source: AOwi7QByROMXOjtJFdKDECWOFTRBWs8402UbznCt5boaikUgarbUkVglG2Dp4IMbK69TQTqHm0nDqmKWx8BAASD+KsQ= X-Received: by 10.55.16.151 with SMTP id 23mr8548167qkq.225.1508055103020; Sun, 15 Oct 2017 01:11:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.19.138 with HTTP; Sun, 15 Oct 2017 01:11:42 -0700 (PDT) In-Reply-To: References: <20171013201955.GK8425@1170ee0b50d5> From: Christian Gagneraud Date: Sun, 15 Oct 2017 08:11:00 -0000 Message-ID: Subject: Re: Postmortem debugging with arm-none-eabi-gdb from memory dump (not core) To: Hesham M Cc: Yao Qi , gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00041.txt.bz2 On 14 October 2017 at 21:52, Hesham M wrote: > 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 like >>> 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 dump >>> of the whole memory (ROM is already known and through the hardware debugger >>> used I can write the RAM contents to a file (outside the target of course). >>> 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 crash >>> 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.html#index-generate_002dcore_002dfile >> you can take a loop how GDB does it. Core dump are just ELF files, you might be able to create one yourself: https://stackoverflow.com/questions/5986366/elf-core-file-format >> >>> >>> 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. Do you have a link to this SO question? Chris