This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]