creating a core dump

Till Straumann strauman at slac.stanford.edu
Thu Nov 4 21:25:09 UTC 2004


sebastian ssmoller wrote:
> hi
> 
> (...)
> 
>>If you have another VME board use your secondary board
>>to grab the target board's memory over the VME backplane
>>and ship it to the host e.g., via network. This is faster
>>and in many cases you can even obtain a coredump of a
>>crashed board which is very desirable.
> 
> 
> sounds interesting ... but a bit to difficult for me ;-)
> if i could manage to transfer a core dump/memory image to my host
> i would be happy :)

?? that's very simple. You can e.g., use the 167-Bug firmware on
the second board. IMO simpler than getting a serial cable
connection to work ;-)

> 
> 
>>I have some patches to the 68k exception handler so it
>>dumps register contents to a known place if it crashes.
> 
> 
> a memory image would be enough for me at the moment ...
>

OK

> 
>>I also have an application which converts a raw memory
>>image into a core file that can be analyzed with GDB.
> 
> 
> thats what i need - how to get it ?

distributed on the 'rtems evaluation CD'. It's in the
tool directory [linux host]

/opt/rtems4.6.0CD/host/i386_linux24/bin/m68k-rtems-gencore

the source is under

/opt/rtems4.6.0CD/src/ssrlApps/cexp/gencore.c

NOTE: you need a BFD library for your *target* if you
want to build this yourself.

> 
> 
>>Finally, I have a small patch for GDB to add core-file
>>support for m68k-rtems.
> 
> 
> thought there was a m68k-rtems-gdb available (e.g. from freebsd ports) -
> isnt this all i need to debug core files ?

I believe core file support is not enabled for this configuration
(rtems doesn't specify a core file format and there is no implementation
for reading registers from the core). My patch choses 'netbsd' the
corefile format (because that's implemented for pretty much every
BFD target) and provides an implementation for reading registers
(which in your case would just be unused).

> 
> remaining question: is there a simple way to transfer a part of the
> memory (which is needed to get enough info out of the core dump) over
> a serial line?


fd = open("xx",yyy)

/* initialize nbytes, start_addr */

while (nbytes > 0 && (put=write(fd,start_addr,nbytes)) > 0) {
   nbytes-=put;
   start_addr+=put;
}

close(fd)

HTH
-- Till
> 
> (...)
> 
> thx
> regards,
> seb
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gdb-6.0-ssrl.diff
URL: <http://lists.rtems.org/pipermail/users/attachments/20041104/b5451b30/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gencore.c
URL: <http://lists.rtems.org/pipermail/users/attachments/20041104/b5451b30/attachment-0001.c>


More information about the users mailing list