This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

HPUX function address.

	I've found the following problem:

spe170> cc -v
Reading specs from /usr/lib/gcc-lib/hppa-linux/3.0.4/specs
Configured with: ../src/configure -v --enable-languages=c,c++,f77,proto,objc 
--prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared 
--with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long 
--enable-nls --without-included-gettext --disable-checking 
--enable-threads=posix --with-cpp-install-dir=bin hppa-linux
Thread model: posix
gcc version 3.0.4
spe170> cc -g -o func func.c
spe170> gdb func
GNU gdb 2002-04-01-cvs
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 "hppa-linux"...
(gdb) l
3       int
4       func()
5       {
6               return;
7       }
9       int
10      main()
11      {
12              printf("0x%x\n", (long)func);
13      }
(gdb) b 12
Breakpoint 1 at 0x10524: file func.c, line 12.
(gdb) r
Starting program: /house/grunblat/hp-ux/c/func 

Breakpoint 1, main () at func.c:12
12              printf("0x%x\n", (long)func);
(gdb) p func
$1 = {int ()} 0x104fc <func>
(gdb) n

Program exited with code 010.

I think it should print 0x104fc, right?
Is there a compiler switch I'm missing?
Should I just try another compiler version?

Thanks in advance.
Daniel Grunblatt.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]