Is this gdb 6.1.1 or 7.11?

After installing gdb 7.11 from the ports tree I could no longer debug in Netbeans. The debugged program would start, I would invoke a scope with a breakpoint, but the environment would never stop or actually show any breakpoints as if I never set them.

So I decided to uninstall the ports version and try the packaged and what the?
Code:
[leo@leo00 /usr/ports/devel/gdb]$ make deinstall
===>  Switching to root credentials for 'deinstall' target
Password:
===>  Deinstalling for gdb
===>  Deinstalling gdb-7.11
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
  gdb-7.11

The operation will free 43 MiB.
[1/1] Deinstalling gdb-7.11...
[1/1] Deleting files for gdb-7.11: 100%
===>  Returning to user credentials

[leo@leo00 /usr/ports/devel/gdb]$ sudo pkg delete gdb
Checking integrity... done (0 conflicting)
Package(s) not found!
[leo@leo00 /usr/ports/devel/gdb]$ sudo pkg install gdb
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%  944 B  0.9kB/s  00:01
Fetching packagesite.txz: 100%  5 MiB  1.9MB/s  00:03
Processing entries: 100%
FreeBSD repository update completed. 25149 packages processed.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
  gdb: 7.11

The process will require 43 MiB more space.
8 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching gdb-7.11.txz: 100%  8 MiB  2.0MB/s  00:04
Checking integrity... done (0 conflicting)
[1/1] Installing gdb-7.11...
[1/1] Extracting gdb-7.11: 100%
[leo@leo00 /usr/ports/devel/gdb]$ which gdb
/usr/bin/gdb
[leo@leo00 /usr/ports/devel/gdb]$ gdb --version
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 "amd64-marcel-freebsd".

So which version is it? Why does it say it is 7.11, but after it was installed said 6.1.1? And of course it is refusing to work with the program as dwarf format 4 that g++ compiled with is not supported by gdb 6.1.1.
 
I can't seem to be able to remove gdb. It does not seem to be installed, yet which gdb consistently returns /usr/bin/gdb
Code:
[leo@leo00 ~]$ pkg info |grep gdb
gdbm-1.11_2  GNU database manager
py27-gdbm-2.7.11_4  Python bindings to the GNU dbm library (Python 2.7)
[leo@leo00 ~]$ which gdb
/usr/bin/gdb
[leo@leo00 ~]$ gdb --version
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 "amd64-marcel-freebsd".
[leo@leo00 ~]$ pkg search gdb
arm-none-eabi-gdb-7.10_4  GNU GDB for the arm bare metal target
avr-gdb-7.3.1_4  GNU GDB for the AVR target
cgdb-0.6.8  Curses-based interface to the GNU Debugger
courier-authlib-usergdbm-0.66.3_2 Userdb support for the Courier authentication library
eggdbus-0.6_3  D-Bus bindings for GObject
fpc-gdbint-3.0.0  Free Pascal unit providing interface to gdb
fpc-gdbm-3.0.0  Free Pascal interface to the GNU database system
gdb-7.11  GNU GDB of newer version than comes with the system
gdb-insight-6.6_2  Gnu debugger with the Insight GUI front-end
gdb66-6.6_3  GNU GDB of newer version than comes with the system
gdbm-1.11_2  GNU database manager
gdbmods-20020824  Wrapper for gdb -k to provide kld symbol information
p5-GDBM-1.14_3  GNU Data Base Manager (gdbm) interface
pgdbf-0.6.2  Convert XBase / FoxPro tables to PostgreSQL
psptoolchain-gdb-7.3.1_1  PlayStation Portable development toolchain gdb
py27-gdbm-2.7.11_4  Python bindings to the GNU dbm library (Python 2.7)
py33-gdbm-3.3.6_4  Python bindings to the GNU dbm library (Python 3.3)
py34-gdbm-3.4.4_4  Python bindings to the GNU dbm library (Python 3.4)
py35-gdbm-3.5.1_4  Python bindings to the GNU dbm library (Python 3.5)
pypy-gdbm-5.0.1  PyPy bindings to the GNU dbm library
ruby22-gdbm-2.2.4_3,1  Ruby extension to GDBM library
xxgdb-1.12_4  X window interface for gdb
And after I tried to install gdb-7.11 there was still the same 6.1.1 binary in place! This is so frustrating it completely turns me off on FreeBSD - I feel I have zero control of the operating system I am responsible for as it just does not do what's expected. The version of GCC that it comes with is incompatible with its version of GDB and I am absolutely powerless to change anything to be able to do my job and help my users.
 
What's in /usr is the base system, you can't remove that (but you can build and install base without gdb). Ports get installed in /usr/local. Make sure your PATH contains /usr/local/bin before /usr/bin.

If you want control over the system, try the manual, worked fine for me.
 
Code:
% gdb711 --version
GNU gdb (GDB) 7.11 [GDB v7.11 for FreeBSD]
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd10.3".
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".
 
Back
Top