🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1219

portability issues with gdb-6.4

#1219
From: Peter O'Gorman
Date: Sun, 07 May 2006 15:09
118 lines
5258 bytes
--jI8keyz6grp/JLjh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,
We've just built gdb-6.4, and ran into one or two issues.
1) In gdb/gdbserver/remote-utils.c a variable is declared not at the
beginiing of the block. This breaks on many non-recent gcc compilers.
2) Is mips-irix a gdb supported platform? If so the mips subdir does not
build with the native cc, I'll assume that it builds on this platform
with gcc, so added a GCC check to configure.
3) Similarly for powerpc-aix, xlc does not build the subdir, so I made
the dir dependent on gcc. I have not tested if it builds with gcc on
aix.
4) struct symtab_and_line cursal = { }; is not portable. I changed these
to { 0 }, which compiles with irix cc, but it seems likely that just
removing the '= { }' would also work.

Patch against 6.4 is attached.

Thank you,
Peter

--jI8keyz6grp/JLjh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gdb.diff"

Index: gdb/gdbserver/remote-utils.c
===================================================================
--- gdb/gdbserver/remote-utils.c.orig
+++ gdb/gdbserver/remote-utils.c
@@ -681,9 +681,9 @@ prepare_resume_reply (char *buf, char st
 
       if (using_threads)
 	{
+	  unsigned int gdb_id_from_wait = thread_to_gdb_id (current_inferior);
 	  /* FIXME right place to set this? */
 	  thread_from_wait = ((struct inferior_list_entry *)current_inferior)->id;
-	  unsigned int gdb_id_from_wait = thread_to_gdb_id (current_inferior);
 
 	  if (debug_threads)
 	    fprintf (stderr, "Writing resume reply for %ld\n\n", thread_from_wait);
Index: sim/configure.ac
===================================================================
--- sim/configure.ac.orig
+++ sim/configure.ac
@@ -89,10 +89,12 @@ if test "${enable_sim}" != no; then
 	   common=yes
 	   ;;
        mips*-*-*)
-           AC_CONFIG_SUBDIRS(mips)
-	   testsuite=yes
-	   common=yes
-	   igen=yes
+	   if test "$GCC" = yes; then
+             AC_CONFIG_SUBDIRS(mips)
+	     testsuite=yes
+	     common=yes
+	     igen=yes
+	   fi
 	   ;;
        mn10300*-*-*)
            AC_CONFIG_SUBDIRS(mn10300)
@@ -110,8 +112,10 @@ if test "${enable_sim}" != no; then
 	   common=yes
 	   ;;
        powerpc*-*-* )
-           AC_CONFIG_SUBDIRS(ppc)
-	   common=yes
+	   if test "$GCC" = yes; then
+             AC_CONFIG_SUBDIRS(ppc)
+	     common=yes
+	   fi
 	   ;;
        v850*-*-* )
            AC_CONFIG_SUBDIRS(v850)
Index: gdb/cli/cli-cmds.c
===================================================================
--- gdb/cli/cli-cmds.c.orig
+++ gdb/cli/cli-cmds.c
@@ -651,9 +651,9 @@ static void
 list_command (char *arg, int from_tty)
 {
   struct symtabs_and_lines sals, sals_end;
-  struct symtab_and_line sal = { };
-  struct symtab_and_line sal_end = { };
-  struct symtab_and_line cursal = { };
+  struct symtab_and_line sal = { 0 };
+  struct symtab_and_line sal_end = { 0 };
+  struct symtab_and_line cursal = { 0 };
   struct symbol *sym;
   char *arg1;
   int no_end = 1;
Index: gdb/source.c
===================================================================
--- gdb/source.c.orig
+++ gdb/source.c
@@ -142,7 +142,7 @@ get_lines_to_list (void)
 struct symtab_and_line
 get_current_source_symtab_and_line (void)
 {
-  struct symtab_and_line cursal = { };
+  struct symtab_and_line cursal = { 0 };
 
   cursal.symtab = current_source_symtab;
   cursal.line = current_source_line;
@@ -181,7 +181,7 @@ set_default_source_symtab_and_line (void
 struct symtab_and_line
 set_current_source_symtab_and_line (const struct symtab_and_line *sal)
 {
-  struct symtab_and_line cursal = { };
+  struct symtab_and_line cursal = { 0 };
   
   cursal.symtab = current_source_symtab;
   cursal.line = current_source_line;

--jI8keyz6grp/JLjh--
Technical Details
Message-ID: <mailman.1543.1147014584.9609.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,aa9adea85367b452,start
X-Google-Attributes: gidf5053,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
From: Peter O'Gorman <bug-gdb@mlists.thewrittenword.com>
Newsgroups: gnu.gdb.bug
Subject: portability issues with gdb-6.4
Date: Sun, 7 May 2006 10:09:33 -0500
Lines: 122
Approved: bug-gdb@gnu.org
Message-ID: <mailman.1543.1147014584.9609.bug-gdb@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="jI8keyz6grp/JLjh"
X-Trace: news.Stanford.EDU 1147014585 10625 199.232.76.165 (7 May 2006 15:09:45 GMT)
X-Complaints-To: news@news.stanford.edu
To: bug-gdb@gnu.org
Envelope-to: bug-gdb@gnu.org
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040907i
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>