Hi!
GDB works fine for me until I set a breakpoint, then it wigs out, and I can't figure out why. I have searched Gentoo-bugzilla, GDB-bugzilla, and the forums, but have come up with no solution that has worked. There's an article in the GDB manual about a similar problem (
http://sources.redhat.com/gdb/current/o ... html#SEC38), but that was unhelpful as well.
Can anyone suggest a solution? This is really wracking my nerves as I need to use GDB and it fails on even tiny programs. I'm getting the same problems with GDB 5.3 & 6.0.
<gdb>
$ gdb ./simple.bin
GNU gdb 6.2
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 "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0xef4: file simple.cc, line 11.
(gdb) info b
Num Type Disp Enb Address What
1 breakpoint keep y 0x00000ef4 in main at simple.cc:11
(gdb) run
Starting program: /home/gsolrac/Projects/C++AndC/simple.bin
Warning:
Cannot insert breakpoint 1.
Error accessing memory address 0xef4: Input/output error.
</gdb>
<simple.cc>
#include <iostream>
#include <string>
using namespace std;
string message();
int main()
{
cout << "Hello " << message() << endl;
return 0;
}
string message()
{
return "World";
}
</simple.cc>
Compiled with: $ g++ -g simple.cc -o simple.bin
$ gcc --version
gcc (GCC) 3.3.3 20040412 (Gentoo Hardened Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)
<emerge --info>
Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r1, 2.6.7-gentoo-r14)
=================================================================
System uname: 2.6.7-gentoo-r14 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
DISTDIR="/home/gentoo/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="
http://gentoo.mirror.sdv.fr ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo http://www.gigaload.org/gentoo.org/ http://mir.zyrianes.net/gentoo/ http://ftp.easynet.nl/mirror/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/gentoo/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi aim alsa apach arts avi bidi bonobo cdr crypt cups curl curlwrappers dga div4linux doc emacs encode esd ethereal fbcon flash foomaticdb gdbm gif gnome gphoto2 gpm gtk gtk2 gtkhtml guile iconv icq imap imlib innodb jabber java jikes jpeg junit kde ldap libg++ libwww mad maildir mailwrapper mikmod mime motif mpeg msn mysql mysqli ncurses nls offensive oggvorbis opengl oscar oss pam pcmcia pcre pdflib perl php pic pie plotutils png pnp posix prelude python qt quicktime readline samba sasl sdl simplexml slang soap sockets spell spl ssl svg svga tcltk tcpd tidy tiff truetype trusted unicode usb vhosts videos wxwindows x86 xine xml2 xmms xv xvid yahoo zlib"
</emerge --info>