Make "print" and "compile print" support -OPT options
[deliverable/binutils-gdb.git] / sim / ppc / emul_bugapi.c
index 97028bf9de91fffc2ec8d177001bc39390f010ac..8481b6fb39e6cfcad9496507caf10ded4532aef7 100644 (file)
@@ -4,7 +4,7 @@
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
+    the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
@@ -13,8 +13,7 @@
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+    along with this program; if not, see <http://www.gnu.org/licenses/>.
 
     */
 
@@ -203,6 +202,7 @@ emul_bugapi_create(device *root,
 {
   device *node;
   os_emul_data *bugapi;
+  char *filename;
 
   /* check it really is for us */
   if (name != NULL
@@ -301,8 +301,12 @@ emul_bugapi_create(device *root,
                : "ppc-xcoff"));
 
   if (image != NULL)
-    tree_parse(root, "/openprom/init/load-binary/file-name \"%s",
-              bfd_get_filename(image));
+    {
+      filename = tree_quote_property (bfd_get_filename(image));
+      tree_parse(root, "/openprom/init/load-binary/file-name %s",
+                filename);
+      free (filename);
+    }
 
   return bugapi;
 }
@@ -335,7 +339,7 @@ emul_bugapi_instruction_name(int call_id)
   static char buffer[40];
   int i;
 
-  for (i = 0; i < sizeof (bug_mapping) / sizeof (bug_mapping[0]); i++)
+  for (i = 0; i < ARRAY_SIZE (bug_mapping); i++)
     {
       if (bug_mapping[i].value == call_id)
        return bug_mapping[i].info;
@@ -378,7 +382,7 @@ emul_bugapi_do_read(os_emul_data *bugapi,
       status--;
   }
 
-  zfree(scratch_buffer);
+  free(scratch_buffer);
   return status;
 }
 
@@ -467,7 +471,7 @@ emul_bugapi_do_write(os_emul_data *bugapi,
       /* write */
       device_instance_write(bugapi->output, scratch_buffer, nbytes);
 
-      zfree(scratch_buffer);
+      free(scratch_buffer);
     }
 
   if (suffix)
This page took 0.071817 seconds and 4 git commands to generate.