Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: <duane@duaneellis.com>
To: "Doug Evans" <dje@google.com>
Cc: "Peter Griffin" <peter.griffin@linaro.org>,
	 "Andreas Arnez" <arnez@linux.vnet.ibm.com>,
	"gdb" <gdb@sourceware.org>,  "Lee Jones" <lee.jones@linaro.org>
Subject: RE: RFC GDB Linux Awareness analysis
Date: Mon, 05 Oct 2015 18:54:00 -0000	[thread overview]
Message-ID: <20151005115437.5c1bb9f86d671edec44bb378f25c04cc.28494d3874.wbe@email03.secureserver.net> (raw)

duane> 7) A good example of scripting is during postmortem debug
duane> GDB cannot call (execute) a helper function within the 
duane> target because the target is not “live”

doug> Depends on what the helper function does of course.
doug> E.g., it's possible to resurrect a corefile (assuming it hasn't
been
doug> truncated, etc.) enough to run a pretty-printer contained in the 
doug> app (as opposed to in python).

Yes, as you said "it depends on what it does"

I would say almost categorically you *cannot* use the target pretty
printer.

Bare metal is often a synonym for "cross compiling". That means
host != target, and loading a complete image into a real target is 
not always viable, or possible. (ie: You may need to construct
MMU page tables, or initialize memory decoders, or DDR to make memory
work.

The advantage is: The Target CPU might be able to execute opcodes :-)

The easier method is loading into a 'memory only' emulation, and do not 
support execution. Yes, you could use an opcode simulator... (ie: the 
armulator) but that is not viable for all CPU types.

Using your "pretty print" solution as the example - another problem is
the run time library support. I'll bet it would be very helpful to use
the targets version of "printf()" in some way (maybe sprintf())

The problem is often the underlying printf() routines in the target 
C library in some cases [often!] use malloc/free to manage buffers

And thus, often make use of some OS feature like a semaphore or mutex.
Thus, while calling this special function interrupts get turned back on
and who knows what else get changed.

Every target is different, every embedded system is different.

Some of these pretty print problems also occur when live debugging.

This whole area is one giant rat hole of problems to make work
universally.

-Duane.




             reply	other threads:[~2015-10-05 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 18:54 duane [this message]
2015-10-05 19:41 ` Doug Evans
     [not found] <20150603142858.GA19370@griffinp-ThinkPad-X1-Carbon-2nd>
2015-08-20 18:22 ` Andreas Arnez
2015-09-30 13:27   ` Peter Griffin
2015-09-30 16:41     ` Duane Ellis
2015-10-05 18:32       ` Doug Evans
2015-10-01  9:25     ` Yao Qi
2015-10-02 10:56     ` Andreas Arnez

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=20151005115437.5c1bb9f86d671edec44bb378f25c04cc.28494d3874.wbe@email03.secureserver.net \
    --to=duane@duaneellis.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=dje@google.com \
    --cc=gdb@sourceware.org \
    --cc=lee.jones@linaro.org \
    --cc=peter.griffin@linaro.org \
    /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