[Bug 213696] gdb ignores breakpoints

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Oct 22 01:41:11 UTC 2016


            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 at FreeBSD.org
          Reporter: gmarthe at inbos.com.au
                CC: freebsd-amd64 at FreeBSD.org
                CC: freebsd-amd64 at FreeBSD.org


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 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"...
(gdb) break main
Breakpoint 1 at 0x4007a9: file gm2.c, line 5.
(gdb) run
Starting program: /usr/home/gmarthe/c/gm2 
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 same
version of gdb.

I'm new to BSD and so maybe I'm missing something here.  I would expect this 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.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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
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 

Breakpoint 1, main (argc=1, argv=0x7fffffffe5e8) at gm2.c:5
5                   fprintf (stderr, "hello bsd\n");

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

More information about the freebsd-bugs mailing list