🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Peter O'Gorman Sun, 07 May 2006 15:09
portability issues with gdb-6.4
#1219
Author: 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--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads