c - How to use cross gdb to examine core file from crosstarget machine -


i have core file embedded sh3 linux device, , gdb of cross compiler environment (sh3-linux-gdb) in host linux.

but have problems loading core file gdb:

$ sh3-linux-gdb ./myprogram ./core gnu gdb 6.3 copyright 2004 free software foundation, inc. ... gdb configured "--host=i386-pc-linux-gnu --target=sh3-linux"... gdb can't read core files on machine. (gdb) 

why can't read core file? there way read core file target system cross gdb?

there gdbserver in target machine (sh3-linux), not gdb itself. able runtime debuging of processes of target machine gdbserver , sh3-linux-gdb, sh3-linux-gdb should correctly compiled.

edit: readelf dump requested:

[build]$ sh3-linux-readelf -a core elf header:   magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00    class:                             elf32   data:                              2's complement, little endian   version:                           1 (current)   os/abi:                            unix - system v   abi version:                       0   type:                              core (core file)   machine:                           renesas / superh sh   version:                           0x1   entry point address:               0x0   start of program headers:          52 (bytes file)   start of section headers:          0 (bytes file)   flags:                             0x0   size of header:               52 (bytes)   size of program headers:           32 (bytes)   number of program headers:         51   size of section headers:           0 (bytes)   number of section headers:         0   section header string table index: 0  there no sections in file.  there no sections in file.  program headers:   type           offset   virtaddr   physaddr   filesiz memsiz  flg align   note           0x000694 0x00000000 0x00000000 0x00200 0x00000     0   load           0x001000 0x00400000 0x00000000 0x00000 0x01000 r e 0x1000   ----- several boring lines removed -----   load           0x05a000 0x29952000 0x00000000 0x01000 0x01000 rw  0x1000   load           0x05b000 0x7be48000 0x00000000 0x15000 0x15000 rwe 0x1000  there no dynamic section in file.  there no relocations in file.  there no unwind sections in file.  no version information found in file.  notes @ offset 0x00000694 length 0x00000200:   owner         data size       description   core          0x000000a8      nt_prstatus (prstatus structure)   core          0x0000007c      nt_prpsinfo (prpsinfo structure)   core          0x000000a0      nt_auxv (auxiliary vector) [build]$  

edit2: same problem --core option:

$ sh3-linux-gdb ./myprogram --core=./core  gnu gdb 6.3 copyright 2004 free software foundation, inc. gdb free software, covered gnu general public license, , welcome change and/or distribute copies of under conditions. type "show copying" see conditions. there absolutely no warranty gdb.  type "show warranty" details. gdb configured "--host=i386-pc-linux-gnu --target=sh3-linux"...run gdb init gdb can't read core files on machine. (gdb) 

try according http://forums.freescale.com/t5/68k-coldfire-reg-microprocessors/gdb-can-t-read-core-files/td-p/70181

 sh3-linux-gdb ./myprogram --core=./core 

it may bug in old gdb http://sourceware.org/bugzilla/show_bug.cgi?id=9542 - try newer gdb (7) too.

also possible core dumped in unsupported format. target's os, version?

can post output or readelf -a core ?


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -