-Wwrite-strings: Constify target_pid_to_str and target_thread_extra_thread_info
[deliverable/binutils-gdb.git] / gdb / gdbarch.sh
index 9b94703ef973a180e43848895c9014b4d2a83d04..c471b73cb10b024fd1ff955fbbc0469f1f0732f6 100755 (executable)
@@ -2,7 +2,7 @@
 
 # Architecture commands for GDB, the GNU debugger.
 #
-# Copyright (C) 1998-2016 Free Software Foundation, Inc.
+# Copyright (C) 1998-2017 Free Software Foundation, Inc.
 #
 # This file is part of GDB.
 #
@@ -634,7 +634,7 @@ m:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr::core_addr_identity::0
 # the condition and only put the breakpoint at the branch destination if
 # the condition is true, so that we ensure forward progress when stepping
 # past a conditional branch to self.
-F:VEC (CORE_ADDR) *:software_single_step:struct frame_info *frame:frame
+F:VEC (CORE_ADDR) *:software_single_step:struct regcache *regcache:regcache
 
 # Return non-zero if the processor is executing a delay slot and a
 # further single-step is needed before the instruction finishes.
@@ -745,7 +745,7 @@ M:ULONGEST:core_xfer_shared_libraries:gdb_byte *readbuf, ULONGEST offset, ULONGE
 M:ULONGEST:core_xfer_shared_libraries_aix:gdb_byte *readbuf, ULONGEST offset, ULONGEST len:readbuf, offset, len
 
 # How the core target converts a PTID from a core file to a string.
-M:char *:core_pid_to_str:ptid_t ptid:ptid
+M:const char *:core_pid_to_str:ptid_t ptid:ptid
 
 # How the core target extracts the name of a thread from a core file.
 M:const char *:core_thread_name:struct thread_info *thr:thr
@@ -1163,6 +1163,10 @@ m:const char *:gnu_triplet_regexp:void:::default_gnu_triplet_regexp::0
 # each address in memory.
 m:int:addressable_memory_unit_size:void:::default_addressable_memory_unit_size::0
 
+# Functions for allowing a target to modify its disassembler options.
+v:char **:disassembler_options:::0:0::0:pstring_ptr (gdbarch->disassembler_options)
+v:const disasm_options_t *:valid_disassembler_options:::0:0::0:host_address_to_string (gdbarch->valid_disassembler_options)
+
 EOF
 }
 
@@ -1216,7 +1220,7 @@ cat <<EOF
 
 /* Dynamic architecture support for GDB, the GNU debugger.
 
-   Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -1259,6 +1263,7 @@ cat <<EOF
 #define GDBARCH_H
 
 #include "frame.h"
+#include "dis-asm.h"
 
 struct floatformat;
 struct ui_file;
@@ -1673,6 +1678,14 @@ pstring (const char *string)
   return string;
 }
 
+static char *
+pstring_ptr (char **string)
+{
+  if (string == NULL || *string == NULL)
+    return "(null)";
+  return *string;
+}
+
 /* Helper function to print a list of strings, represented as "const
    char *const *".  The list is printed comma-separated.  */
 
@@ -1875,18 +1888,13 @@ cat <<EOF
 static void
 verify_gdbarch (struct gdbarch *gdbarch)
 {
-  struct ui_file *log;
-  struct cleanup *cleanups;
-  long length;
-  char *buf;
+  string_file log;
 
-  log = mem_fileopen ();
-  cleanups = make_cleanup_ui_file_delete (log);
   /* fundamental */
   if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
-    fprintf_unfiltered (log, "\n\tbyte-order");
+    log.puts ("\n\tbyte-order");
   if (gdbarch->bfd_arch_info == NULL)
-    fprintf_unfiltered (log, "\n\tbfd_arch_info");
+    log.puts ("\n\tbfd_arch_info");
   /* Check those that need to be defined for the given multi-arch level.  */
 EOF
 function_list | while do_read
@@ -1915,22 +1923,19 @@ do
        elif [ -n "${invalid_p}" ]
        then
            printf "  if (${invalid_p})\n"
-           printf "    fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n"
+           printf "    log.puts (\"\\\\n\\\\t${function}\");\n"
        elif [ -n "${predefault}" ]
        then
            printf "  if (gdbarch->${function} == ${predefault})\n"
-           printf "    fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n"
+           printf "    log.puts (\"\\\\n\\\\t${function}\");\n"
        fi
     fi
 done
 cat <<EOF
-  buf = ui_file_xstrdup (log, &length);
-  make_cleanup (xfree, buf);
-  if (length > 0)
+  if (!log.empty ())
     internal_error (__FILE__, __LINE__,
                     _("verify_gdbarch: the following are invalid ...%s"),
-                    buf);
-  do_cleanups (cleanups);
+                    log.c_str ());
 }
 EOF
 
This page took 0.025745 seconds and 4 git commands to generate.