This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

[PATCH] sim: constify prog_name


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.

gdb/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* remote-sim.c (gdbsim_load): Add const to prog.

include/gdb/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* remote-sim.h (sim_load): Add const to prog.

sim/arm/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* wrapper.c (sim_load): Add const to prog.

sim/avr/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* interp.c (sim_load): Add const to prog.

sim/common/:
2014-02-19  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.

sim/cr16/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* interp.c (sim_load): Add const to prog.

sim/cris/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* sim-if.c (sim_load): Add const to prog.

sim/d10v/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* interp.c (sim_load): Add const to prog.

sim/erc32/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* interf.c (sim_load): Add const to prog.

sim/h8300/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* compile.c (sim_load): Add const to prog.

sim/m32c/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* gdb-if.c (sim_load): Add const to prog.

sim/mcore/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* interp.c (sim_load): Add const to prog.

sim/microblaze/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* interp.c (sim_load): Add const to prog.

sim/moxie/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* interp.c (sim_load): Add const to prog.

sim/ppc/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* sim_calls.c (sim_load): Add const to prog.

sim/rl78/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* gdb-if.c (sim_load): Add const to prog.

sim/rx/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* gdb-if.c (sim_load): Add const to prog.

sim/sh/:
2014-02-19  Mike Frysinger  <vapier@gentoo.org>

	* interp.c (sim_load): Add const to prog.
---
 gdb/remote-sim.c         | 2 +-
 include/gdb/remote-sim.h | 2 +-
 sim/arm/wrapper.c        | 2 +-
 sim/avr/interp.c         | 2 +-
 sim/common/sim-hload.c   | 2 +-
 sim/common/sim-load.c    | 2 +-
 sim/common/sim-utils.c   | 2 +-
 sim/common/sim-utils.h   | 4 ++--
 sim/cr16/interp.c        | 2 +-
 sim/cris/sim-if.c        | 2 +-
 sim/d10v/interp.c        | 2 +-
 sim/erc32/interf.c       | 2 +-
 sim/h8300/compile.c      | 2 +-
 sim/m32c/gdb-if.c        | 2 +-
 sim/mcore/interp.c       | 2 +-
 sim/microblaze/interp.c  | 2 +-
 sim/moxie/interp.c       | 2 +-
 sim/ppc/sim_calls.c      | 2 +-
 sim/rl78/gdb-if.c        | 2 +-
 sim/rx/gdb-if.c          | 2 +-
 sim/sh/interp.c          | 2 +-
 21 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 0614690..3bda043 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -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);
 
diff --git a/include/gdb/remote-sim.h b/include/gdb/remote-sim.h
index 985b2cd..b8b2406 100644
--- a/include/gdb/remote-sim.h
+++ b/include/gdb/remote-sim.h
@@ -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.
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index 0ea9ee1..c475962 100644
--- a/sim/arm/wrapper.c
+++ b/sim/arm/wrapper.c
@@ -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;
 {
diff --git a/sim/avr/interp.c b/sim/avr/interp.c
index f14514b..1ee6507 100644
--- a/sim/avr/interp.c
+++ b/sim/avr/interp.c
@@ -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;
 
diff --git a/sim/common/sim-hload.c b/sim/common/sim-hload.c
index 66a981b..b380ee0 100644
--- a/sim/common/sim-hload.c
+++ b/sim/common/sim-hload.c
@@ -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;
 
diff --git a/sim/common/sim-load.c b/sim/common/sim-load.c
index f077065..7e29f6c 100644
--- a/sim/common/sim-load.c
+++ b/sim/common/sim-load.c
@@ -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;
diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c
index 2ec7c7c..64291f0 100644
--- a/sim/common/sim-utils.c
+++ b/sim/common/sim-utils.c
@@ -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);
diff --git a/sim/common/sim-utils.h b/sim/common/sim-utils.h
index ddb19ab..30fac1a 100644
--- a/sim/common/sim-utils.h
+++ b/sim/common/sim-utils.h
@@ -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);
 
diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c
index 2ef14cb..48da916 100644
--- a/sim/cr16/interp.c
+++ b/sim/cr16/interp.c
@@ -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.  */
 
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index 4ecba06..325321f 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -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;
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index a0b334d..f07520e 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -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;
 {
diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c
index e2db44e..84229cd 100644
--- a/sim/erc32/interf.c
+++ b/sim/erc32/interf.c
@@ -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;
 {
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 2c7316c..348cdbb 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -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;
 
diff --git a/sim/m32c/gdb-if.c b/sim/m32c/gdb-if.c
index 56e0862..bec9d48 100644
--- a/sim/m32c/gdb-if.c
+++ b/sim/m32c/gdb-if.c
@@ -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);
 
diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c
index 72c59f7..9b08de0 100644
--- a/sim/mcore/interp.c
+++ b/sim/mcore/interp.c
@@ -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;
 {
diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index 4907b73..8fcf9d9 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -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:
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c
index 63dc8fc..3268732 100644
--- a/sim/moxie/interp.c
+++ b/sim/moxie/interp.c
@@ -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;
 {
diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index a3ebba0..27ee1fe 100644
--- a/sim/ppc/sim_calls.c
+++ b/sim/ppc/sim_calls.c
@@ -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));
diff --git a/sim/rl78/gdb-if.c b/sim/rl78/gdb-if.c
index 5dce5cd..6c4b5b5 100644
--- a/sim/rl78/gdb-if.c
+++ b/sim/rl78/gdb-if.c
@@ -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);
 
diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c
index 4c4434c..77048a0 100644
--- a/sim/rx/gdb-if.c
+++ b/sim/rx/gdb-if.c
@@ -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);
 
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 5689511..cf6fd8d 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -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;
 {
-- 
1.9.0


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