Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Loading a Core File
@ 2007-07-06 11:26 Robert Norton
  2007-07-06 12:03 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Norton @ 2007-07-06 11:26 UTC (permalink / raw)
  To: gdb

Hi,
 
Our built in simulator (using remote-sim.c) has the ability to load core
files via a custom command 'sim loadcore'. This causes the simulator to
load all the state from the core file, but it doesn't but GDB into a
state which is suitable for examining core files. We can do this with
some trickery to fool gdb into thinking it is in a running state e.g.:
 
target sim
load
break main
run
sim loadcore <corefile>
 
But this is arcane and doesn't result in a completely consistent state
e.g. some things are still cached by gdb which isn't aware that memory /
registers have just changed under its feet. I borrowed the following
from corelow.c:

      target_fetch_registers (-1);
 
      /* Now, set up the frame cache, and print the top of stack.  */
      flush_cached_frames ();
      select_frame (get_current_frame ());
 
But it's not a complete solution. What is the 'proper' way of doing core
files in gdb? What is involved in getting it to work via 'target core'?
 
Many thanks,
 
Robert


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

* Re: Loading a Core File
  2007-07-06 11:26 Loading a Core File Robert Norton
@ 2007-07-06 12:03 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-07-06 12:03 UTC (permalink / raw)
  To: Robert Norton; +Cc: gdb

On Fri, Jul 06, 2007 at 04:26:19AM -0700, Robert Norton wrote:
> But it's not a complete solution. What is the 'proper' way of doing core
> files in gdb? What is involved in getting it to work via 'target core'?

Take a look at any cross debugging target which supports core files.
Use corelow.o in TDEPFILES, then implement regset_from_core_section.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2007-07-06 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-06 11:26 Loading a Core File Robert Norton
2007-07-06 12:03 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox