# Core file unrecognized by gdb

**URL:** https://forums.sifive.com/t/core-file-unrecognized-by-gdb/1858
**Category:** HiFive Unleashed
**Created:** [December 11, 2018, 5:25pm UTC](https://forums.sifive.com/t/core-file-unrecognized-by-gdb/1858 "2018-12-11T17:25:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rrh](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@rrh](https://forums.sifive.com/u/rrh)
#### Post date: [December 11, 2018, 5:25pm UTC](https://forums.sifive.com/t/core-file-unrecognized-by-gdb/1858/1 "2018-12-11T17:25:15Z")

</div>

I built the freedom-u-sdk on my ubuntu 16.04 dev machine. I cross compiled a program on the dev machine, copied the a.out to the freedom-unleashed board, ran the a.out there, got a core file, copied the core file back.

The cross-targeted gdb on the dev box doesn’t recognize the core file; gdb says (Elided):

…  
This GDB was configured as “–host=x86\_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu”.  
…  
“core”: no core file handler recognizes format

yet running objdump says  
freedom-u-sdk/toolchain/bin/riscv64-unknown-linux-gnu-objdump -x core

core: file format elf64-littleriscv  
core  
architecture: riscv:rv64, flags 0x00000000:

Is this inability to read core files expected?

---

<div class="post-metadata">

### Author: ![jimw](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@jimw](https://forums.sifive.com/u/jimw)
#### Post date: [December 11, 2018, 6:00pm UTC](https://forums.sifive.com/t/core-file-unrecognized-by-gdb/1858/2 "2018-12-11T18:00:54Z")

</div>

freedom-u-sdk uses an old copy of riscv-gnu-toolchain that uses an old local port of gdb. I added core file support to FSF gdb over the summer and a few weeks ago I replaced the local gdb port in riscv-gnu-toolchain with the FSF gdb port. So if you git clone an up-to-date copy of riscv-gnu-toolchain this should work. But it isn’t expected to work with the toolchain in freedom-u-sdk.

freedom-u-sdk is what we use for demos. It isn’t meant to be a real linux system. If you want a real linux system, you should use debian, fedora, opensuse, openembedded/yocto, etc.

---

<div class="post-metadata">

### Author: ![rrh](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@rrh](https://forums.sifive.com/u/rrh)
#### Post date: [December 11, 2018, 9:29pm UTC](https://forums.sifive.com/t/core-file-unrecognized-by-gdb/1858/3 "2018-12-11T21:29:36Z")

</div>

I got an up-to-date copy off riscv-gnu-toolchain, rebuilt the stack, and the tool chain seems to work fine at first look.

Thanks for the pointers!
