From: roland@gnu.ai.mit.edu (Roland McGrath)
Subject: gdb 4.5 can't find my function
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 14 Apr 1992 13:18:48 GMT

hp300bsd; gdb 4.5 compiled with gcc 2.1

Here is a transcript of a gdb session.  In the last several commands, gdb
is failing to find a function which is defined in read.c, while it finds
other functions in the same file.  nm on the executable finds those
functions in the symbol table.

The losing binary can be found in
/home/fsf/roland/make/hp300/make.gdb-loses on albert.gnu.ai.mit.edu.
gdb was built in /home/gp2/gnu/gdb-4.5/.


GDB is free software and you are welcome to 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.
GDB 4.5, Copyright 1992 Free Software Foundation, Inc...
Reading in symbols for main.c...done.
Breakpoint 1 at 0x5892: file main.c, line 339.
(gdb) cd ~/libc/misc
Working directory /home/fsf/roland/libc/misc
 (canonically /home/gd2/gnu/libc/misc).
(gdb) core core
Core was generated by `make'.
#0  0x10f7a in __kill ()
(gdb) up
Reading in symbols for commands.c...done.
#1  0x1776 in fatal_error_signal (sig=6) at commands.c:414
(gdb) 
#2  0xfff0005e in end ()
(gdb) 
Reading in symbols for abort.c...done.
#3  0x1140c in abort () at abort.c:57
abort.c:57: No such file or directory.
(gdb) 
Reading in symbols for file.c...done.
#4  0x3496 in lookup_file (name=0x37c48 "") at file.c:55
(gdb) 
#5  0x3bd6 in snap_deps () at file.c:335
(gdb) p d
$1 = (struct dep *) 0x69668
(gdb) p *d
$2 = {
  next = 0x69648, 
  name = 0x37c48 "", 
  file = 0xd7000000, 
  changed = 0
}
(gdb) r ../hp300/sys/param.h
Starting program: /home/fsf/roland/make/hp300/make ../hp300/sys/param.h
Reading in symbols for sysdeps/unix/bsd/hp9k3bsd/start.c...done.
make: Entering directory `/home/gd2/gnu/libc/misc'

Program received signal 6, IOT trap
0x10f7a in __kill ()
Reading in symbols for ../sysdeps/posix/raise.c...done.
#1  0x1575a in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x1140c in abort () at abort.c:57
abort.c:57: No such file or directory.
#3  0x3496 in lookup_file (name=0x4dc38 "") at file.c:55
#4  0x3bd6 in snap_deps () at file.c:335
(gdb) p f
$3 = (struct file *) 0x5c388
(gdb) p f->name
$4 = 0x5c548 "../hp300/machine/machparam.h"
(gdb) p f2->name
$5 = 0x5c548 "../hp300/machine/machparam.h"
(gdb) p f==f2
$6 = 1
(gdb) p f2->prev
$7 = (struct file *) 0x0
(gdb) p f2->deps
$8 = (struct dep *) 0x69648
(gdb) p d
$9 = (struct dep *) 0x695e8
(gdb) p $8
$10 = (struct dep *) 0x69648
(gdb) p *$
$11 = {
  next = 0x69628, 
  name = 0x0, 
  file = 0x87d48, 
  changed = 0
}
(gdb) p *$.next
$12 = {
  next = 0x695e8, 
  name = 0x0, 
  file = 0x7b388, 
  changed = 0
}
(gdb) 
$13 = {
  next = 0x695c8, 
  name = 0x4dc38 "", 
  file = 0xd7000000, 
  changed = 0
}
(gdb) up
#5  0x5e0c in main (argc=2, argv=0xffeffa50, envp=0x0) at main.c:630
(gdb) b record_files
Function record_files not defined.
(gdb) b record_files
Function record_files not defined.
(gdb) l read_makefile
Function read_makefile not defined.
(gdb) b read_all_makefiles
Reading in symbols for read.c...done.
Breakpoint 2 at 0x706a: file read.c, line 112.
(gdb) b record_files
Function record_files not defined.
(gdb) 

Newsgroups: gnu.gdb.bug