[U-Boot] [PATCH] arc: introduce "mdbtrick" target
Alexey Brodkin
Alexey.Brodkin at synopsys.com
Fri Dec 26 11:17:49 CET 2014
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 at 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
More information about the U-Boot
mailing list