Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Oct 2016 01:41:11 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 213696] gdb ignores breakpoints
Message-ID:  <bug-213696-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213696

            Bug ID: 213696
           Summary: gdb ignores breakpoints
           Product: Base System
           Version: 11.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: gmarthe@inbos.com.au
                CC: freebsd-amd64@FreeBSD.org
                CC: freebsd-amd64@FreeBSD.org

Hello,

On FreeBSD 11-Release, gdb breakpoints do not seem to work.

The following program:

#include <stdio.h>
#include <stdlib.h>

int main (int argc, char **argv) {
        fprintf (stderr, "hello bsd\n");
        fprintf (stderr, "bye bsd\n");
}

compiled as follows:
cc -g -O0 gm2.c -o gm2

$ gdb gm2
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 condition=
s.
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"...
(gdb) break main
Breakpoint 1 at 0x4007a9: file gm2.c, line 5.
(gdb) run
Starting program: /usr/home/gmarthe/c/gm2=20
hello bsd
bye bsd

Program exited normally.
You can't do that without a process to debug.
(gdb) quit

I have the same results on FreeBSD-CURRENT, to be expected as that is the s=
ame
version of gdb.

I'm new to BSD and so maybe I'm missing something here.  I would expect thi=
s to
run as it does under Linux - see below:

$ gdb gm2
GNU gdb (Debian 7.11.1-2) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.htm=
l>
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-linux-gnu".
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"...
Reading symbols from gm2...done.
(gdb) break main
Breakpoint 1 at 0x400545: file gm2.c, line 5.
(gdb) run
Starting program: /tmp/gm2=20

Breakpoint 1, main (argc=3D1, argv=3D0x7fffffffe5e8) at gm2.c:5
5                   fprintf (stderr, "hello bsd\n");
(gdb)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-213696-8>