This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] Sort ``maint print architecture'' output


Hello,

The attached tweek sorts the output from ``maint print architecture''. 
It makes finding the value of one of those macro's much easier!

I'll check it in shortly.

Andrew
2001-09-26  Andrew Cagney  <ac131313@redhat.com>

	* gdbarch.sh (gdbarch_dump): Sort output.
	* gdbarch.c: Regenerate.

Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.77
diff -p -r1.77 gdbarch.sh
*** gdbarch.sh	2001/09/05 23:44:43	1.77
--- gdbarch.sh	2001/09/26 06:17:53
*************** gdbarch_dump (struct gdbarch *gdbarch, s
*** 1424,1439 ****
                        "gdbarch_dump: GDB_MULTI_ARCH = %d\\n",
                        GDB_MULTI_ARCH);
  EOF
! function_list | while do_read
  do
      # multiarch functions don't have macros.
!     class_is_multiarch_p && continue
      if [ "x${returntype}" = "xvoid" ]
      then
! 	printf "#if defined (${macro}) && GDB_MULTI_ARCH\n"
  	printf "  /* Macro might contain \`[{}]' when not multi-arch */\n"
-     else
- 	printf "#ifdef ${macro}\n"
      fi
      if class_is_function_p
      then
--- 1424,1445 ----
                        "gdbarch_dump: GDB_MULTI_ARCH = %d\\n",
                        GDB_MULTI_ARCH);
  EOF
! function_list | sort -t: +2 | while do_read
  do
      # multiarch functions don't have macros.
!     if class_is_multiarch_p
!     then
! 	printf "  if (GDB_MULTI_ARCH)\n"
! 	printf "    fprintf_unfiltered (file,\n"
! 	printf "                        \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
! 	printf "                        (long) current_gdbarch->${function});\n"
! 	continue
!     fi
!     printf "#ifdef ${macro}\n"
      if [ "x${returntype}" = "xvoid" ]
      then
! 	printf "#if GDB_MULTI_ARCH\n"
  	printf "  /* Macro might contain \`[{}]' when not multi-arch */\n"
      fi
      if class_is_function_p
      then
*************** do
*** 1446,1464 ****
  	printf "                      \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
  	printf "                      XSTRING (${macro}));\n"
      fi
!     printf "#endif\n"
! done
! function_list | while do_read
! do
!     if class_is_multiarch_p
      then
! 	printf "  if (GDB_MULTI_ARCH)\n"
! 	printf "    fprintf_unfiltered (file,\n"
! 	printf "                        \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
! 	printf "                        (long) current_gdbarch->${function});\n"
! 	continue
      fi
-     printf "#ifdef ${macro}\n"
      if [ "x${print_p}" = "x()" ]
      then
          printf "  gdbarch_dump_${function} (current_gdbarch);\n"
--- 1452,1461 ----
  	printf "                      \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
  	printf "                      XSTRING (${macro}));\n"
      fi
!     if [ "x${returntype}" = "xvoid" ]
      then
! 	printf "#endif\n"
      fi
      if [ "x${print_p}" = "x()" ]
      then
          printf "  gdbarch_dump_${function} (current_gdbarch);\n"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]