From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48853 invoked by alias); 13 Oct 2017 20:20:01 -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 48801 invoked by uid 89); 13 Oct 2017 20:20:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=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, H*r:sk:static. X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Oct 2017 20:19:59 +0000 Received: by mail-wm0-f46.google.com with SMTP id q124so23527719wmb.0 for ; Fri, 13 Oct 2017 13:19:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=1OMKe0oyyK9k6DNB4JyaSgwpaQxMfxKZ22wpGHwkn8U=; b=DlIFcMiwgWbVeUjDVCnfzJMeF9wJHIfSBIwd3jb6sKd9yTKmppcpwy+xjZymB3eVe3 FdBpqyx2fbjmdOazK/zX6ARKZDouj6DSAb7zbIwSeDPMXUdGmg5OFDX4ORObSMkZlCoT j/AMWal3D+a9GfpDgxkDCP9q0y6o9yTw96JPHaNNksYdKmfWdOBA1ct5WAeQGSbMT/me Cq/tyzY4M5NDYCW1RvXuJj0YBNXWjO/mZk7qGcyE5YBhOqxhCIznsbG6RBJHzZMytFxS C9HJiMaTvgS/4HyEh9xGgfy7I2dns2WJy1s8C+qOc1jxYA9c84nK1DaZRxv7pSTFi0pz wiYw== X-Gm-Message-State: AMCzsaUxkOmZE+BOqVzNeSA0O8jiinEy0rkg5Yp5ydQocBtX+eUS54KP 3MswgxhDtHcib6zk0/7sGZU= X-Google-Smtp-Source: AOwi7QDugtAGd+u19PiVENF32AkYpdJNytsUbVbFFqMeQD/6i9ob7LvfNiSwaU+LDSrDsSQwa0zCbA== X-Received: by 10.28.7.78 with SMTP id 75mr2194116wmh.31.1507925997239; Fri, 13 Oct 2017 13:19:57 -0700 (PDT) Received: from 1170ee0b50d5 (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id u96sm2799685wrc.68.2017.10.13.13.19.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 13:19:56 -0700 (PDT) Date: Fri, 13 Oct 2017 20:20:00 -0000 From: Yao Qi To: Hesham M Cc: gdb@sourceware.org Subject: Re: Postmortem debugging with arm-none-eabi-gdb from memory dump (not core) Message-ID: <20171013201955.GK8425@1170ee0b50d5> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00039.txt.bz2 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. > > 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 (齐尧)