Shell GDB - Dwarf Error

My first steps with GDB are not being very fruitful...
Bash:
root@FreeBSD:~/projects/kwboot # gdb kwboot

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module /root/projects/kwboot/kwboot]

(gdb) start
Undefined command: "start".  Try "help".
(gdb) step
The program is not being run.
(gdb) quit

Anyone know what this Dwarf Error is?

I'm using the built-in version of gdb. Should I use one from ports/pkgs?
 
It seems like I'm using the built in version of GDB which apparently should not be used...

Having installed the gdb pkg, how do I make sure I get the pkg version when I just run gdb from the command line?
 
Use the full path!?
/usr/local/bin/gdb --version
Code:
GNU gdb (GDB) 8.0.1 [GDB v8.0.1 for FreeBSD]
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: ...
This GDB was configured as "x86_64-portbld-freebsd11.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
 
I just wanted to run gdb from within emacs - not sure what sort of tie up there is between them...

Eventually decided, and I know it's not ideal, to create a shell script called gdb which invokes /usr/local/bin/gdb and stick it in /sbin.
 
Back
Top