This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Loading a Core File
- From: "Robert Norton" <rnorton at broadcom dot com>
- To: gdb at sourceware dot org
- Date: Fri, 6 Jul 2007 04:26:19 -0700
- Subject: Loading a Core File
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