Operating System - Linux
1753943 Members
9369 Online
108811 Solutions
New Discussion юеВ

Problems using gdb with gcc 4.0.0 in HP/UX 10.20

 
SOLVED
Go to solution
Alan Sengillo_1
Occasional Advisor

Problems using gdb with gcc 4.0.0 in HP/UX 10.20

I downloaded gcc 4.0.0 for HP/UX 10.20 from http://mirrors.develooper.com/hpux/. When I compile my program with the -g option, gdb does not see any source code.

Gdb works without any problems with gcc 3.4.3. I have made sure I was using the gdb that came with the 4.0.0 install.
4 REPLIES 4
H.Merijn Brand (procura
Honored Contributor

Re: Problems using gdb with gcc 4.0.0 in HP/UX 10.20

Cannot tell from here what's happening. Just tried from the machine that built was made on:

d3:/tmp 110 > cat test.c
int main (int argc, char *argv[])
{
int i = 0;

i = i + 1;
return (i);
} /* main */
d3:/tmp 111 > gcc --version
gcc (GCC) 4.1.1
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

d3:/tmp 112 > gdb --version
GNU gdb 6.3
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 "hppa2.0-hp-hpux10.20".
d3:/tmp 113 > gcc -g -o xx test.c
d3:/tmp 114 > gdb ./xx
GNU gdb 6.3
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 "hppa2.0-hp-hpux10.20"...
(gdb) b main
Breakpoint 1 at 0x225c: file test.c, line 2.
(gdb) r
Starting program: /tmp/xx

Breakpoint 1, main (argc=1, argv=0x7b03a884) at test.c:2
2 {
(gdb) l
1 int main (int argc, char *argv[])
2 {
3 int i = 0;
4
5 i = i + 1;
6 return (i);
7 } /* main */
(gdb) c
Continuing.

Program exited with code 01.
(gdb) q
d3:/tmp 115 >

Upgrade?

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Alan Sengillo_1
Occasional Advisor

Re: Problems using gdb with gcc 4.0.0 in HP/UX 10.20

Here is what happens when I do the same thing. As you can see I am missing line numbers at the break points.

[mouse] 25 % cat test.c
int main (int argc, char *argv[])
{
int i = 0;

i = i + 1;
return (i);
} /* main */

[mouse] 26 % gcc --version
gcc (GCC) 4.0.0
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[mouse] 27 % gdb --version
GNU gdb 6.2.1
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 "hppa2.0-hp-hpux10.20".
[mouse] 28 % gcc -g -o xx test.c
[mouse] 29 % gdb ./xx
GNU gdb 6.2.1
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 "hppa2.0-hp-hpux10.20"...
(gdb) b main
Breakpoint 1 at 0x2250
(gdb) r
Starting program: /home/gatesrc/dev/sengillo/SIR087924Gcc/Test/xx

Breakpoint 1, 0x00002250 in main ()
(gdb) l
1 int main (int argc, char *argv[])
2 {
3 int i = 0;
4
5 i = i + 1;
6 return (i);
7 } /* main */
8
(gdb) c
Continuing.

Program exited with code 01.
(gdb) q
H.Merijn Brand (procura
Honored Contributor
Solution

Re: Problems using gdb with gcc 4.0.0 in HP/UX 10.20

again, consider an upgrade.

I don't know if you have to blame gcc: 4.1.1 might include more/better debug info than 4.0.0) or gdb (6.3 shows more than 6.2.1).

I was not able to build gdb-6.4 (yet)

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Alan Sengillo_1
Occasional Advisor

Re: Problems using gdb with gcc 4.0.0 in HP/UX 10.20

The upgrade to 4.1.1 worked.