sim: constify prog_name
authorMike Frysinger <vapier@gentoo.org>
Thu, 20 Feb 2014 05:13:48 +0000 (00:13 -0500)
committerMike Frysinger <vapier@gentoo.org>
Wed, 5 Mar 2014 06:42:44 +0000 (01:42 -0500)
There's no need for the prog_name handed down to the core to be mutable,
so add const markings to it and all the related funcs.

39 files changed:
gdb/ChangeLog
gdb/remote-sim.c
include/gdb/ChangeLog
include/gdb/remote-sim.h
sim/arm/ChangeLog
sim/arm/wrapper.c
sim/avr/ChangeLog
sim/avr/interp.c
sim/common/ChangeLog
sim/common/sim-hload.c
sim/common/sim-load.c
sim/common/sim-utils.c
sim/common/sim-utils.h
sim/cr16/ChangeLog
sim/cr16/interp.c
sim/cris/ChangeLog
sim/cris/sim-if.c
sim/d10v/ChangeLog
sim/d10v/interp.c
sim/erc32/ChangeLog
sim/erc32/interf.c
sim/h8300/ChangeLog
sim/h8300/compile.c
sim/m32c/ChangeLog
sim/m32c/gdb-if.c
sim/mcore/ChangeLog
sim/mcore/interp.c
sim/microblaze/ChangeLog
sim/microblaze/interp.c
sim/moxie/ChangeLog
sim/moxie/interp.c
sim/ppc/ChangeLog
sim/ppc/sim_calls.c
sim/rl78/ChangeLog
sim/rl78/gdb-if.c
sim/rx/ChangeLog
sim/rx/gdb-if.c
sim/sh/ChangeLog
sim/sh/interp.c

index 2129d6ffcdfb320cc529a9fbd89069bf0214022a..8108e50d64a60f0129a4b2b66895f162fa4bef39 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * remote-sim.c (gdbsim_load): Add const to prog.
+
 2014-03-03  Tom Tromey  <tromey@redhat.com>
 
        * elfread.c (probe_key): Change to bfd_data.
index 061469030206b9367c6e2efc6379f5cb1ebcbb0b..3bda04375679d25ae19aae7ad7e4559f3918dca5 100644 (file)
@@ -564,7 +564,7 @@ static void
 gdbsim_load (struct target_ops *self, char *args, int fromtty)
 {
   char **argv;
-  char *prog;
+  const char *prog;
   struct sim_inferior_data *sim_data
     = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NEEDED);
 
index d5afee2b505940f7f012e0012788df0e30eaed76..5ffeef39fbae4efa0700d19c758d3510ece52c2e 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * remote-sim.h (sim_load): Add const to prog.
+
 2014-02-09  Doug Evans  <xdje42@gmail.com>
 
        * section-scripts.h: New file.
index 985b2cd6a9b0c670de2f4389a6648b8608f28a24..b8b2406bcad8b4f438ce1c53859d56d1cb872070 100644 (file)
@@ -140,7 +140,7 @@ void sim_close (SIM_DESC sd, int quitting);
    Such manipulation should probably (?) occure in
    sim_create_inferior. */
 
-SIM_RC sim_load (SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty);
+SIM_RC sim_load (SIM_DESC sd, const char *prog, struct bfd *abfd, int from_tty);
 
 
 /* Prepare to run the simulated program.
index 7ad1e3d0baf442d1c205db366f2c60d90699619c..69e3447ae0c1f5a1a1bde205749eaae912cb5283 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * wrapper.c (sim_load): Add const to prog.
+
 2013-09-23  Alan Modra  <amodra@gmail.com>
 
        * configure: Regenerate.
index 0ea9ee1e314a3272f94f9997e813136ef1e21a34..c475962bc42920bd2e65a43da94b67781f007f4a 100644 (file)
@@ -888,7 +888,7 @@ sim_close (sd, quitting)
 SIM_RC
 sim_load (sd, prog, abfd, from_tty)
      SIM_DESC sd;
-     char *prog;
+     const char *prog;
      bfd *abfd;
      int from_tty ATTRIBUTE_UNUSED;
 {
index 8dd3ec59dd23ee78caf4a1d180a5211834c03967..56f79be8c3b4135ad6646a14d461d888028740b8 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_load): Add const to prog.
+
 2013-09-23  Alan Modra  <amodra@gmail.com>
 
        * configure: Regenerate.
@@ -13,8 +17,7 @@
 2012-05-24  Pedro Alves  <palves@redhat.com>
 
        PR gdb/7205
-
-        Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
+       * Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
 
 2012-03-24  Mike Frysinger  <vapier@gentoo.org>
 
index f14514b33b3ede3f57309f9ea26e0fdd3f175c84..1ee6507eec8c0c77b7e0c9ce24ee66a27d542e4d 100644 (file)
@@ -1793,7 +1793,7 @@ sim_close (SIM_DESC sd, int quitting)
 }
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty)
 {
   bfd *prog_bfd;
 
index 89e37ca99fb9c220a47c0cc640711baedeaa2d36..9bf58e27af30b8f88325970762aa715142a0bc48 100644 (file)
@@ -1,3 +1,11 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-hload.c (sim_load): Add const to prog.
+       * sim-load.c (sim_load_file): Likewise.
+       * sim-utils.c (sim_analyze_program): Likewise.
+       * sim-utils.h (sim_analyze_program): Likewise.
+       (sim_load_file): Likewise.
+
 2014-03-04  Mike Frysinger  <vapier@gentoo.org>
 
        * acinclude.m4 (build_warnings): Copy from gdb/configure.ac.
index 66a981bc5c979aa40d9b1f1ff2106106b85fc60b..b380ee0188072540fd43b411913ab1b8d0ecdb2a 100644 (file)
@@ -27,7 +27,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
    modeling a hardware platform. */
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog_name, struct bfd *prog_bfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog_name, struct bfd *prog_bfd, int from_tty)
 {
   bfd *result_bfd;
 
index f077065bcf5cb273bb17d964ce0a152d3ab54aa0..7e29f6c306e51173ba3a5bcbfd3dc90fd5d39d5e 100644 (file)
@@ -57,7 +57,7 @@ static void xprintf_bfd_vma (host_callback *, bfd_vma);
 
 bfd *
 sim_load_file (SIM_DESC sd, const char *myname, host_callback *callback,
-              char *prog, bfd *prog_bfd, int verbose_p, int lma_p,
+              const char *prog, bfd *prog_bfd, int verbose_p, int lma_p,
               sim_write_fn do_write)
 {
   asection *s;
index 2ec7c7c21690d976be756c21d4244fff7df676a3..64291f0c5b7208633847237e204e6bff58abba58 100644 (file)
@@ -211,7 +211,7 @@ sim_add_commas (char *buf, int sizeof_buf, unsigned long value)
    bfd open.  */
 
 SIM_RC
-sim_analyze_program (SIM_DESC sd, char *prog_name, bfd *prog_bfd)
+sim_analyze_program (SIM_DESC sd, const char *prog_name, bfd *prog_bfd)
 {
   asection *s;
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
index ddb19abe2523e6a504f93e371e3f306c62a44eec..30fac1a5f7feb00853535d0245e4fa08f0abb9af 100644 (file)
@@ -45,7 +45,7 @@ unsigned long sim_elapsed_time_since (SIM_ELAPSED_TIME start);
 
 /* Utilities for manipulating the load image.  */
 
-SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name,
+SIM_RC sim_analyze_program (SIM_DESC sd, const char *prog_name,
                            struct bfd *prog_bfd);
 
 /* Load program PROG into the simulator using the function DO_LOAD.
@@ -63,7 +63,7 @@ SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name,
 typedef int sim_write_fn (SIM_DESC sd, SIM_ADDR mem,
                          const unsigned char *buf, int length);
 struct bfd *sim_load_file (SIM_DESC sd, const char *myname,
-                          host_callback *callback, char *prog,
+                          host_callback *callback, const char *prog,
                           struct bfd *prog_bfd, int verbose_p,
                           int lma_p, sim_write_fn do_load);
 
index 8e32571b7c652f951921c1e56d4320f1fd8dd076..9903ad4fa6f7de3582ae705604f6b2845ea6e031 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_load): Add const to prog.
+
 2014-03-04  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index 2ef14cb4496a0e024bfd8bf953b6e4ef88da4a52..48da9167d937deb0c1fb1716555b0e8990b51832 100644 (file)
@@ -1567,7 +1567,7 @@ sim_do_command (sd, cmd)
 }
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, struct bfd *abfd, int from_tty)
 {
   extern bfd *sim_load_file (); /* ??? Don't know where this should live.  */
 
index 07d04b070402498836cd6d1463e26feac577c71b..5b302295aab64cbb49ffe48a89fc6d2cc76948aa 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_load): Add const to prog.
+
 2014-03-04  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index 4ecba06f9e1c609fbe95db9cd7e649d2eec6f668..325321ff9fdc8c95880142d17e18edefacdb90c4 100644 (file)
@@ -343,7 +343,7 @@ cris_program_offset_write (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf,
    files differently.  */
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog_name, struct bfd *prog_bfd,
+sim_load (SIM_DESC sd, const char *prog_name, struct bfd *prog_bfd,
          int from_tty ATTRIBUTE_UNUSED)
 {
   bfd *result_bfd;
index 1231a5f1598b475ef503c6df96e361c1e295d896..4a878b03306c487126d82ffafec66462e0f87d88 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_load): Add const to prog.
+
 2014-03-04  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index a0b334ddb5125b44ec553e65e5ed7aa4730f51d8..f07520ed1a1e9a0d3f61d5edf4278fd5f092e244 100644 (file)
@@ -1490,7 +1490,7 @@ sim_do_command (sd, cmd)
 SIM_RC
 sim_load (sd, prog, abfd, from_tty)
      SIM_DESC sd;
-     char *prog;
+     const char *prog;
      bfd *abfd;
      int from_tty;
 {
index d7266fd7c06422e8de8051361081b44d0287bf38..1592693738554ff56580eab6f9fb43ce326b544d 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * interf.c (sim_load): Add const to prog.
+
 2013-10-09  Sergio Durigan Junior  <sergiodj@redhat.com>
 
        PR sim/16018:
index e2db44ea7fbf4e3f5e617e85d52ba313834ef934..84229cd54d7c108e1392a2366bd971ba1fe15e02 100644 (file)
@@ -290,7 +290,7 @@ sim_close(sd, quitting)
 SIM_RC
 sim_load(sd, prog, abfd, from_tty)
      SIM_DESC sd;
-     char *prog;
+     const char *prog;
      bfd *abfd;
      int from_tty;
 {
index 38280e824d963020aa58cd9b11e1bed6be09ae1c..13bff7a706a0bb2dfe65dd9d2c6f5269227a99eb 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * compile.c (sim_load): Add const to prog.
+
 2014-02-17  Mike Frysinger  <vapier@gentoo.org>
 
        PR gdb/16450
index 2c7316ce6c94068a17d02ed0a2fe47acc60eb562..348cdbbd42a6741c7964d5d87d905edaeef65b78 100644 (file)
@@ -4974,7 +4974,7 @@ sim_close (SIM_DESC sd, int quitting)
 /* Called by gdb to load a program into memory.  */
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty)
 {
   bfd *prog_bfd;
 
index 9cd5fb6fd86e3cb7359fbda2283c4715788158b7..e202191e4526aa2f5ab69c44a54bd16b4e7fcc81 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * gdb-if.c (sim_load): Add const to prog.
+
 2013-09-23  Alan Modra  <amodra@gmail.com>
 
        * configure: Regenerate.
index 56e08624cd11fd3792ebb7892515fee9288645cc..bec9d48838ac0c151f6d234ba31b14995df99a61 100644 (file)
@@ -128,7 +128,7 @@ open_objfile (const char *filename)
 
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, struct bfd * abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, struct bfd * abfd, int from_tty)
 {
   check_desc (sd);
 
index a034cdebd06310f0ad82499c130bfd9e850bfff0..c97a2c5c7c88c0854fe722dcd983ddbf0c06e830 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_load): Add const to prog.
+
 2014-02-17  Mike Frysinger  <vapier@gentoo.org>
 
        PR gdb/16450
index 72c59f7ecb97bd31f793d8b7bd1e824b6a915d80..9b08de051afa9576ea2a821b21c87c5e136c60f3 100644 (file)
@@ -1922,7 +1922,7 @@ sim_close (sd, quitting)
 SIM_RC
 sim_load (sd, prog, abfd, from_tty)
      SIM_DESC sd;
-     char * prog;
+     const char * prog;
      bfd * abfd;
      int from_tty;
 {
index fe6add2c77df77f4bfc31c028c2e0a16fe3c3273..911a8b3769bb51901ac4d862d0037a160dc7bf7f 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_load): Add const to prog.
+
 2014-02-17  Mike Frysinger  <vapier@gentoo.org>
 
        PR gdb/16450
index 4907b7383d5a6bbd254a39310dcd91e2408d11be..8fcf9d964cd98a384193ea762cb569f7cce75907 100644 (file)
@@ -887,7 +887,7 @@ sim_close (SIM_DESC sd, int quitting)
 }
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty)
 {
   /* Do the right thing for ELF executables; this turns out to be
      just about the right thing for any object format that:
index 95daaef06b7588ccf13daa9eb50691222ac94ef0..33a27852ffd7f68a1b913a638c40fcd1e47354f8 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_load): Add const to prog.
+
 2014-02-17  Mike Frysinger  <vapier@gentoo.org>
 
        PR gdb/16450
index 63dc8fc8fd9204ce64e88bff60cfa089f09b2234..32687322297ab4bbd06e873c361a0ff1edc7ba20 100644 (file)
@@ -1230,7 +1230,7 @@ load_dtb (SIM_DESC sd, const char *filename)
 SIM_RC
 sim_load (sd, prog, abfd, from_tty)
      SIM_DESC sd;
-     char * prog;
+     const char * prog;
      bfd * abfd;
      int from_tty;
 {
index 749ece737244e847206a6947602784f78cdd23c7..3f279fec1146535d94515140b922348280043d06 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim_calls.c (sim_load): Add const to prog.
+
 2014-02-17  Aaro Koskinen  <aaro.koskinen@iki.fi>
 
        PR gdb/12202
index a3ebba0f5b318520882b05b6c98e961883b72c4b..27ee1fea1a796f6c6c87a7e0a1aa74f498b1dae5 100644 (file)
@@ -97,7 +97,7 @@ sim_close (SIM_DESC sd, int quitting)
 
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty)
 {
   TRACE(trace_gdb, ("sim_load(prog=%s, from_tty=%d) called\n",
                    prog, from_tty));
index 1cf0e3971a1221309776ac3d49555d6b94b8f7b6..4b556cc8bebdbfdb7e936faf5afc9b64dfb2ba19 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * gdb-if.c (sim_load): Add const to prog.
+
 2013-09-23  Alan Modra  <amodra@gmail.com>
 
        * configure: Regenerate.
index 5dce5cd8f6c318e2fb50fbf7a5cbf13c43e65c60..6c4b5b5fc896cf9e3ecd3d6de6fd4c339ebc7e0c 100644 (file)
@@ -140,7 +140,7 @@ open_objfile (const char *filename)
 /* Load a program.  */
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, struct bfd *abfd, int from_tty)
 {
   check_desc (sd);
 
index dc2e3e50e10f60e2e9ee9d1efc562451317bacb9..3ce615e0ade2e7c15cb968e30ef9305e92d25b4b 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * gdb-if.c (sim_load): Add const to prog.
+
 2014-02-17  Kevin Buettner  <kevinb@redhat.com>
 
        * gdb-if.c (rx_signal_to_host):  Rename to
index 4c4434ce39434fb16911fed9c6d7b361bf29c068..77048a0a0f9dfeb585074309be25a2680925f88d 100644 (file)
@@ -192,7 +192,7 @@ addr_in_swap_list (bfd_vma addr)
 }
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, struct bfd *abfd, int from_tty)
 {
   check_desc (sd);
 
index 8c1b09b4ad31ec9e1c2a3c7ebded88ac2fd36070..d479841edb788832ca49230e3237207818d98934 100644 (file)
@@ -1,3 +1,7 @@
+2014-03-05  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_load): Add const to prog.
+
 2014-02-17  Mike Frysinger  <vapier@gentoo.org>
 
        PR gdb/16450
index 5689511fa8b2a19f60a8d4d6a28cc25ec3a4d3af..cf6fd8dae06ca16e3c496ecc714956c6e6864b32 100644 (file)
@@ -2685,7 +2685,7 @@ sim_close (sd, quitting)
 SIM_RC
 sim_load (sd, prog, abfd, from_tty)
      SIM_DESC sd;
-     char *prog;
+     const char *prog;
      bfd *abfd;
      int from_tty;
 {
This page took 0.053434 seconds and 4 git commands to generate.