gcc 4.7 and gdb 6.3 problem

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
competentcompton
Posts: 268
Joined: Wed Aug 02, 2006 3:06 am

gcc 4.7 and gdb 6.3 problem

Unread postby competentcompton » Sat May 04, 2013 1:47 am

Hi,

I have a piece of code that I was trying to compile and debug with gcc 4.7 and gdb 6.3.

Maybe these two versions are not compatible?

The problem is that when debugging code compiled with the -g option the debugger does not stop in main.
Rather it stops at a line of code that is about 1/3 of the way through the source file.

Anyone else seen this?

Cheers

User avatar
foetz
Moderator
Moderator
Posts: 5863
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: gcc 4.7 and gdb 6.3 problem

Unread postby foetz » Sat May 04, 2013 2:55 am

did you set a breakpoint? if yes how?
r-a-c.de

competentcompton
Posts: 268
Joined: Wed Aug 02, 2006 3:06 am

Re: gcc 4.7 and gdb 6.3 problem

Unread postby competentcompton » Sat May 04, 2013 3:20 am

yes I did

under gdb I used

break main

but also I ran it as

gdb -dbx

and used stop in main

both incorrectly stopped at the same line in the code.

Cheers

User avatar
canavan
Posts: 754
Joined: Mon Jul 21, 2003 6:19 am

Re: gcc 4.7 and gdb 6.3 problem

Unread postby canavan » Sun May 05, 2013 8:56 am

If you compile with any kind of optimizations, there may be no 1:1 mapping between the lines of source code and the program code. Sometimes, if you single-step through the program, the execution will jump all over the place. Try recompiling with -O0.

User avatar
foetz
Moderator
Moderator
Posts: 5863
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: gcc 4.7 and gdb 6.3 problem

Unread postby foetz » Sun May 05, 2013 1:07 pm

alternatively you could just use "disas" on main and set an explicit breakpoint
r-a-c.de

competentcompton
Posts: 268
Joined: Wed Aug 02, 2006 3:06 am

Re: gcc 4.7 and gdb 6.3 problem

Unread postby competentcompton » Mon May 06, 2013 2:21 am

Compilation line is

gcc -g source.c


Also output the result of preprocessing and looking at the result of that it appears that the preprocess is keeping line numbers ok.

Looking at the output from gcc -S and comparing the code from it appears that

disas main show the correct code.

However

info line main

shows

Line 102 of "lg.c" starts at address 0x100026f8 <test_interior+80> amnd ends at <main+1088>

Clearly when I use

break main
run

I would hope that it would indicate that I am at start address 0x???? <main+offset>

Still scratching my head at this one.

Cheers

competentcompton
Posts: 268
Joined: Wed Aug 02, 2006 3:06 am

Re: gcc 4.7 and gdb 6.3 problem

Unread postby competentcompton » Mon May 06, 2013 2:30 am

one other thing I wanted to add. If I compile it with my mipspro 7.4.4m the gdb 6.3 gets the line numbers correct but I get some other issues which I was hoping that using a gcc/gdb combo would fix and not throw this problem up.

Cheers

User avatar
foetz
Moderator
Moderator
Posts: 5863
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Re: gcc 4.7 and gdb 6.3 problem

Unread postby foetz » Mon May 06, 2013 4:27 am

well gnu for everything but x86 is only the cheap alternative in most cases. having glitches like this is quite common
r-a-c.de

User avatar
ShadeOfBlue
Moderator
Moderator
Posts: 799
Joined: Tue Nov 25, 2003 12:09 pm
Location: Europe

Re: gcc 4.7 and gdb 6.3 problem

Unread postby ShadeOfBlue » Mon May 06, 2013 4:59 am

Try a newer GDB, there have been some changes to the debugging format in gcc 4.something.

competentcompton
Posts: 268
Joined: Wed Aug 02, 2006 3:06 am

Re: gcc 4.7 and gdb 6.3 problem

Unread postby competentcompton » Mon May 06, 2013 2:56 pm

I thought that it might come down to using a newer version of gdb.

Anyone know who did the neko 6.3 compile. Just want to find out if there any special instructions?

Cheers

hamei
Posts: 10101
Joined: Tue Feb 24, 2004 4:10 pm
Location: over the rainbow

Re: gcc 4.7 and gdb 6.3 problem

Unread postby hamei » Mon May 06, 2013 6:36 pm

competentcompton wrote:Anyone know who did the neko 6.3 compile. Just want to find out if there any special instructions?

Usually that's all in the release notes ... /usr/nekoware/relnotes

If you wanted to upgrade you can take the original spec and idb files that you'll find in /usr/nekoware/dist and make a tardist .... it's not difficult, just a little tedious.
hi ! my name is talking tina and i love you very much !

competentcompton
Posts: 268
Joined: Wed Aug 02, 2006 3:06 am

Re: gcc 4.7 and gdb 6.3 problem

Unread postby competentcompton » Thu May 09, 2013 3:59 am

well the release notes setings certainly do not work for a compile of gdb 7.6

I'll have to look into this one some more. Already getting compiler errors.

Cheers

User avatar
vishnu
Posts: 2303
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: gcc 4.7 and gdb 6.3 problem

Unread postby vishnu » Thu May 09, 2013 12:35 pm

Presumably you don't have the cvd debugger that comes with Prodev Workshop?
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

competentcompton
Posts: 268
Joined: Wed Aug 02, 2006 3:06 am

Re: gcc 4.7 and gdb 6.3 problem

Unread postby competentcompton » Thu May 09, 2013 3:02 pm

Sensitive topic

I have db which is version 7.1 (I think) and it was giving problems with debugging code from my 7.4.4m compiler.

I can't find it and may have lost the disk it is on (darn!)

I thought I would try using gdb 6.3 but it (pparently) has issues with mips C++ code.

Then I thought "sod it" I will try to use gcc 4.7 but presto it doesn't work either.

I have gone full round trip and am now left with compiling gdb myself and hoping that it works with gcc 4.7

:roll:

User avatar
vishnu
Posts: 2303
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: gcc 4.7 and gdb 6.3 problem

Unread postby vishnu » Thu May 09, 2013 3:52 pm

Is that the version of cvd that comes with Prodev Workshop 2.9.1? Looks like they haven't updated the product information since MIPSPro 7.4 came out: http://techpubs.sgi.com/library/tpl/cgi-bin/summary.cgi?db=bks&docnumber=007-2582-006
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 1 guest