public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* RE: RFC GDB Linux Awareness analysis
@ 2015-10-05 18:54 duane
  2015-10-05 19:41 ` Doug Evans
  0 siblings, 1 reply; 8+ messages in thread
From: duane @ 2015-10-05 18:54 UTC (permalink / raw)
  To: Doug Evans; +Cc: Peter Griffin, Andreas Arnez, gdb, Lee Jones

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.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-05 19:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20150603142858.GA19370@griffinp-ThinkPad-X1-Carbon-2nd>
2015-08-20 18:22 ` RFC GDB Linux Awareness analysis 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
2015-10-05 18:54 duane
2015-10-05 19:41 ` Doug Evans

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).