All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arc: introduce "mdbtrick" target
Date: Fri, 26 Dec 2014 10:17:49 +0000	[thread overview]
Message-ID: <1419589068.3584.10.camel@synopsys.com> (raw)
In-Reply-To: <20141226100026.5FCFD3800DC@gemini.denx.de>

Hi Wolfgang,

On Fri, 2014-12-26 at 11:00 +0100, Wolfgang Denk wrote:
> Dear Alexey,
> 
> In message <1419587516-30541-1-git-send-email-abrodkin@synopsys.com> you wrote:
> > MetaWare debugger doesn't support PIE (position-independent executable)
> > so the only way to load U-Boot in MDB is to fake it by:
> >   1. Reset PIE flag in ELF header
> >   2. Strip all debug information from elf
> > 
> > Even though it could be done manually but having this automated way
> > is very convenient. User may build U-Boot that will be loaded on target
> > via MDB saying "make mdbtrick".
> 
> I wonder if such manipulation helps?  Are you really able to debug PIE
> code on the target just by fooling the debugger about it like this?
> I would expect that it would fail to work if it really doesn't support
> PIE?

Well the point is MDB is still used as a primary tool for interaction
with target via JTAG. Moreover some very advanced features are not yet
implemented in GDB for ARC (and not sure if they will be implemnted
sometime soon given complexity and rare need for those features for
common user).

So if we're talking about development process when U-Boot is loaded in
target memory not by low-level boot-loader but manually through JTAG
chances are high developer uses MDB for it.

Without manipulation we're talking about (BTW I got it documented quite
a while ago here http://www.denx.de/wiki/U-Boot/ARCNotes) MDB will
refuse to even start - so no chance to load elf contents on target.

Then if we now apply the manipulation MDB will happily start and will
load all required sections into the target.

Indeed there will be no source-level debug info available. And still MDB
will do its work on showing disassembly, registers, accessing low-level
debug facilities etc.

So as a summary - this is pretty dirty hack but it simplifies life a lot
for us.

Hope this explanation makes sense.

-Alexey

  reply	other threads:[~2014-12-26 10:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-26  9:51 [U-Boot] [PATCH] arc: introduce "mdbtrick" target Alexey Brodkin
2014-12-26 10:00 ` Wolfgang Denk
2014-12-26 10:17   ` Alexey Brodkin [this message]
2014-12-26 15:48     ` Wolfgang Denk

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=1419589068.3584.10.camel@synopsys.com \
    --to=alexey.brodkin@synopsys.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.