public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Fredrik Hederstierna <fredrik.hederstierna@verisure.com>
To: Paul Mathieu <paulmathieu@google.com>, Simon Marchi <simark@simark.ca>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Luis Machado <luis.machado@linaro.org>,
	Alan Hayward <Alan.Hayward@arm.com>
Subject: Re: [PATCH] gdb: add support for handling core dumps on arm-none-eabi
Date: Tue, 20 Oct 2020 11:41:29 +0000	[thread overview]
Message-ID: <AM6PR10MB21504CBD56291D9C255739E1EF1F0@AM6PR10MB2150.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAO_VGhphy+WUJ0Z+=D5k_43ax2K6SKZOwC1Erc-FtMbEY3yd-A@mail.gmail.com>

Hi all,

I rebased and update my patch and it not run against GDB 10 / git-master, available at

https://sourceware.org/bugzilla/show_bug.cgi?id=14383

I debugged my remote arm-none bare-metal Cortex-M4 target app over openocd/JTAG,
and generate core-file:
(gdb) gcore bare_metal.core

Then later off-line on my host PC, I successfully debugged it with register, call-stack etc:
$ arm-none-eabi-gdb my_bare_metal_app.elf bare_metal.core

So this patch 'works', but I'm not sure if this is the correct direction to go,
but could be a start.
Besides this, next step could be to do this 'core-generator' tool that could be used for embedded targets, running on host PC.

Please check the patch out, it builds fine with GDB-10/master on my machine.
Any comments are appreciated!

Thanks, BR Fredrik


From: Paul Mathieu <paulmathieu@google.com>
Sent: Monday, October 19, 2020 5:25 PM
To: Simon Marchi <simark@simark.ca>
Cc: Fredrik Hederstierna <fredrik.hederstierna@verisure.com>; gdb-patches@sourceware.org <gdb-patches@sourceware.org>; Luis Machado <luis.machado@linaro.org>
Subject: Re: [PATCH] gdb: add support for handling core dumps on arm-none-eabi 
 
Hi Simon, thanks for keeping this moving!


> > The idea then is to have some PC host supporting tool to convert/generate corefiles from some custom memory dump formats.
> > The FreeRTOS (or any other bare-metal alike OS) could maintain this supporting tool.
>
> Indeed.
>
> One question for you: when making GDB generate the core, I presume it
> would always have a single thread, as when debugging a bare-metal ARM
> processor with GDB, you see a single thread.
>
> Assuming you make that tool to convert a memory dump of a FreeRTOS
> system to a core GDB can read, would you make each FreeRTOS task appear
> as a separate thread in the core?

I assumed that we could use .reg/xxx note sections to dump task
information, haven't tested it though.
That would be something that generate-core would not be able to do
without support for the underlying OS. I imagine that we should be
able to add some fort of support for FreeRTOS?
My target runs RTX5, I'm not sure how widespread it is and if it is
worth adding support for. That said, as long as the core format is
specified and has support for multiple tasks (at least CPU regs),
collecting that information and formatting it shouldn't be too much
trouble on my end.


> Can you and Paul maybe sync up (and with Luis as well, probably) on what
> are the next steps?  I think your patch was a great start, but it would
> need to be rebased.  You could also look at Paul's patch to see if
> there's anything you'd like to pick from it.

Happy to. The patch that I proposed is quite minimal, the only nice
thing about it is that it builds on top of master.

Paul

  reply	other threads:[~2020-10-20 11:41 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17  0:02 Fredrik Hederstierna
2020-10-19  2:08 ` Simon Marchi
2020-10-19 13:13   ` Luis Machado
2020-10-19 13:15   ` Alan Hayward
2020-10-19 15:25   ` Paul Mathieu
2020-10-20 11:41     ` Fredrik Hederstierna [this message]
2020-10-20 12:39       ` Simon Marchi
2020-10-20 14:00         ` Fredrik Hederstierna
2020-10-20 15:04           ` Simon Marchi
2020-10-20 22:05             ` Fredrik Hederstierna
2020-10-20 23:06               ` Simon Marchi
2020-10-22  0:52                 ` Fredrik Hederstierna
2020-10-22  1:24                   ` Simon Marchi
2020-10-22  1:49                   ` Simon Marchi
2020-10-22 22:32                     ` Fredrik Hederstierna
2020-10-23  0:37                       ` Simon Marchi
2020-10-25 21:06                         ` Fredrik Hederstierna
2020-10-26 11:24                           ` Luis Machado
2020-10-26 15:49                             ` Fredrik Hederstierna
2020-10-27 16:53                               ` Paul Mathieu
2021-01-14 12:36                                 ` Fredrik Hederstierna
2021-01-14 12:50                                   ` Luis Machado
2021-01-18 11:09                                     ` Andrew Burgess
2021-01-18 14:01                                       ` Luis Machado
2021-06-21  6:30                                         ` [PATCH] sim: arm: add support for handling core dumps Fredrik Hederstierna
2021-06-22  3:20                                           ` Mike Frysinger
2021-06-24 13:01                                             ` Alan Hayward
2021-06-29  9:11                                               ` Fredrik Hederstierna
2021-01-18 11:01                                   ` [PATCH] gdb: add support for handling core dumps on arm-none-eabi Andrew Burgess
2021-06-22  2:16                           ` Mike Frysinger
2020-10-20 19:34       ` [PATCH] gdb: Support corefiles for arm-none-eabi Fredrik Hederstierna
2020-10-20 21:49       ` Fredrik Hederstierna
2020-10-20 21:58       ` [PATCH v2] Support for corefiles for arm-none-eabi target Fredrik Hederstierna
2020-10-21  2:51         ` Simon Marchi
2020-10-21 14:38         ` Luis Machado
2020-10-22  0:44       ` [PATCH v3][PR gdb/14383]: gdb: corefile support " Fredrik Hederstierna
2020-10-22  0:44         ` [PATCH v3][PR gdb/14383]: Support for corefiles " Fredrik Hederstierna
2020-10-25 20:46       ` [PATCH] " Fredrik Hederstierna
2020-10-25 20:50       ` [PATCH v4][PR gdb/14383] " Fredrik Hederstierna
  -- strict thread matches above, loose matches on Subject: below --
2020-10-02 17:32 [PATCH] gdb: add support for handling core dumps on arm-none-eabi Paul Mathieu
2020-10-02 17:51 ` Luis Machado
2020-10-02 21:54   ` Paul Mathieu
2020-10-02 21:59     ` Simon Marchi
2020-10-03  3:57     ` Simon Marchi
2020-10-02 23:55 ` Simon Marchi
2020-10-03  0:35   ` Paul Mathieu
2020-10-03  2:24     ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR10MB21504CBD56291D9C255739E1EF1F0@AM6PR10MB2150.EURPRD10.PROD.OUTLOOK.COM \
    --to=fredrik.hederstierna@verisure.com \
    --cc=Alan.Hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.org \
    --cc=paulmathieu@google.com \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).