Subject: gdb debugs filed: "no line number information" error
To: NetBSD/users <netbsd-users@netbsd.org>
From: Alexander Bubnov <alexander.bubnov@gmail.com>
List: netbsd-users
Date: 04/04/2007 16:40:42
Hello, all!

It is not possbile to debug programs. see actions below

> gcc -g ttt.c
> cat ttt.c
#include<stdio.h>

const char* IFNAME="/home/alek/tmp/in.txt";
const char* OFNAME="/home/alek/tmp/out.txt";

FILE *Fopen(const char*fn, const char*mode)
{
    FILE *p = fopen(fn,mode);
    if(p==NULL)
    {
        perror(fn);
        exit(1);
    }
    return p;
}

int main()
{
    FILE *ifs,*ofs;
    puts("START TEST");

    ifs=Fopen(IFNAME,"r");
    ofs=Fopen(OFNAME,"w");

    fclose(ifs);
    fclose(ofs);

    puts("END TEST");
    return 0;
}
> gdb a.out
GNU gdb 5.3nb1
Copyright 2002 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--netbsdelf"...
(gdb) b main
Breakpoint 1 at 0x80487f5: file ttt.c, line 20.
(gdb) r
Starting program: /home/alek/mera/tv/cr-498/src/a.out

Breakpoint 1, main () at ttt.c:20
20          puts("START TEST");
(gdb) n
0x080484dc in init_fallthru ()
(gdb)
Single stepping until exit from function init_fallthru,
which has no line number information.
START TEST
END TEST

Program exited normally.
(gdb) q

I use NetBSD 3.1

Is it a bug?