🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1079

Re: some compile errors fo gdb-7.0.1

#1079
From: Pedro Alves
Date: Tue, 23 Feb 2010 17:07
143 lines
7571 bytes
On Tuesday 23 February 2010 15:22:33, Harald Koenig wrote:
> Hi Pedro,
> 
> On Feb 18, Pedro Alves wrote:
> 
> > I encourage you to try building cvs head, or a recent
> > snapshot with hp cc so catch other possible tweaks
> > necessary, as gdb 7.1 is close to branching out.
> 
> thanks for the hint!  ok, so here are some more problems at least FYI, 
> not sure if all of them can and must be fixed ?!   
> 

Sure, why not?  Thanks.

> with no specific order:
> 
> -------------------------------------------------------------------------------
> SGI IRIX:
> 
> cc-1028 cc: ERROR File = gdb-CVS-20100222/gdb/varobj.c, Line = 1703
>   The expression used must have a constant value.
> 
>         varobj_update_result r = {*varp};
>                                    ^
> 
> using "gcc -pedantic" you'll get at least a warning about this problem:
> 
> gdb-CVS-20100222/gdb/varobj.c:1703: warning: initializer element is not computable at load time
> gdb-CVS-20100222/gdb/varobj.c:1711: warning: initializer element is not computable at load time
> gdb-CVS-20100222/gdb/varobj.c:1741: warning: initializer element is not computable at load time
> gdb-CVS-20100222/gdb/varobj.c:1818: warning: initializer element is not computable at load time
> gdb-CVS-20100222/gdb/varobj.c:1828: warning: initializer element is not computable at load time
> gdb-CVS-20100222/gdb/varobj.c:1855: warning: initializer element is not computable at load time
> 
> a possible fix for the 1st error would be varobj.c.diff (attached).
> 

Yes, that's the obvious fix, but, your patch doesn't compile in
a couple of places.  :-)

On Tuesday 23 February 2010 15:22:33, Harald Koenig wrote:
> -      varobj_update_result r = {*varp};
> +      varobj_update_result r = {0};
> +      r.varobj = varp;
                    ^ should be `*varp'.

Don't worry, I've fixed it here.

> -------------------------------------------------------------------------------
> old bison/yacc:  
> 
> on some older linux I run into this problem:
> 
>    c-exp.y:2238: error: field 'value' has incomplete type
> 
> these are the distros and bison/byacc versions:
> 
>     suse 9.0	bison 1.75
>     redhat 9	bison 1.35
>     centos 5.0	byacc-1.9-29.2.2
> 
> the attached patch c-exp.y.diff seems to work both with bison-2.3 and
> those older versions...

Right, YYSTYPE is used in other places without the `union' tag.

I've applied the varobj patch to both mainline and the 7.1
branch, and the c-exp.y patch to mainline (only needed there)
under the obviously correct rule.  They're small enough to
not require copyright assignment, but something bigger
than this, or too many of these, and we will.  Let us know
if you're interested to get you started.  Also please take a
look at src/gdb/CONTRIBUTE.

> 
> -------------------------------------------------------------------------------
> Solaris
> 
> on solaris 5.8 (sparc, Sun C 5.7 2005/01/07) and 5.10 (sparc Sun C 5.8 2005/10/13 and x86 Sun C 5.9 SunOS_i386 Patch 124868-01 2007/07/12) the cc complains about unknown __FUNCTION__ :
> 
> 	"gdb-CVS-20100222/bfd/elfxx-sparc.c", line 2944: undefined symbol: __FUNCTION__
> and
> 	"gdb-CVS-20100222/bfd/elf32-i386.c", line 1406: undefined symbol: __FUNCTION__
> 	"gdb-CVS-20100222/bfd/elf32-i386.c", line 3012: undefined symbol: __FUNCTION__
> 
> 
> the short hack in bfd.diff is far from being perfect, just an example
> how to get it compiling because

Looks like you forgot to attach this, but, in any case, bfd is
maintained by the binutils folks, you should take that issue
there.  FYI, the CVS repository is shared between gdb, binutils
and other projects, so you should see the same issue when
building binutils.  Of course, a fix for this should be
quite okay for the gdb 7.1 branch as well, once the binutils
folks approve it.

> (a) it should check for C99 and/or solaris (e.g. if __func__ is really available -- looks like a autoconf thingy;)
> (b) this check/define should be handled elsewhere at one central place
> as there are more files "affected" :
> 
> gdb-CVS-20100222 > grep -rl __FUNCTION__ .
> ./bfd/elfxx-sparc.c
> ./bfd/bfd-in2.h
> ./bfd/nlm32-sparc.c
> ./bfd/elf64-x86-64.c
> ./bfd/elf32-i386.c
> ./bfd/elf32-bfin.c
> ./bfd/bfd-in.h

> ./sim/cris/traps.c

This one's our responsability.  You'll only trip on this if you
build for --target=cris*, though.

> ./gdb/ChangeLog-2004
> ./gdb/ChangeLog-2002
> ./gdb/ChangeLog-2000
> 
> 
> as the ChangeLogs tell that's not really a new problem, IMHO I'd go with ./gdb/ChangeLog-2000 ;-))
> 
> ./gdb/ChangeLog-2000:   * uw-thread.c: Remove __FUNCTION__ GNUism.
> ./gdb/ChangeLog-2002:   __FUNCTION__.
> ./gdb/ChangeLog-2002:   * gnu-nat.c (do_mach_notify_no_senders): Replace __FUNCTION__ with
> ./gdb/ChangeLog-2004:   * ia64-tdep.c (ia64_find_proc_info_x): Do not use __FUNCTION__.
> 
> -------------------------------------------------------------------------------
> AIX 5.3 
> 
> just FYI: while gdb 7.0.1 crashes when trying to start a program
> (typing "gdb a.out" and "r" will SIGSEGV)...
> 
> gdb 7.1.50.20100222-cvs seems to work, at least running and simple break points work...
> -------------------------------------------------------------------------------

Looks like progress to me.  :-)  Kidding aside, the truth is
that we don't have enough people tending for these ports, so
they often rot.  :-(

-- 
Pedro Alves
Technical Details
Message-ID: <mailman.1714.1266944880.14305.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!usenet.stanford.edu!news.stanford.edu!not-for-mail
References: <20100215141621.GA9469@atuin.science-computing.de> <201002181923.34196.pedro@codesourcery.com> <20100223152233.GA14951@atuin.science-computing.de>

Show Full Headers
Complete Article Headers
X-Google-Thread: f0ead4270c,bc75c21c9a9e46ff,start
X-Google-Attributes: gidf0ead4270c,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!usenet.stanford.edu!news.stanford.edu!not-for-mail
From: Pedro Alves <pedro@codesourcery.com>
Newsgroups: gnu.gdb.bug
Subject: Re: some compile errors fo gdb-7.0.1
Date: Tue, 23 Feb 2010 17:07:48 +0000
Organization: CodeSourcery
Lines: 145
Approved: bug-gdb@gnu.org
Message-ID: <mailman.1714.1266944880.14305.bug-gdb@gnu.org>
References: <20100215141621.GA9469@atuin.science-computing.de>
 <201002181923.34196.pedro@codesourcery.com>
 <20100223152233.GA14951@atuin.science-computing.de>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Trace: news.stanford.edu 1266944882 25240 199.232.76.165 (23 Feb 2010 17:08:02 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: gdb-patches@sourceware.org, bug-gdb@gnu.org
To: Harald Koenig <H.Koenig@science-computing.de>
Envelope-to: bug-gdb@gnu.org
User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; )
In-Reply-To: <20100223152233.GA14951@atuin.science-computing.de>
X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
 4)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
 4)
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>
X-Original-Bytes: 7362