Fix incomplete constification in remote-sim.c

2014-07-30  Roland McGrath  <mcgrathr@google.com>

	* remote-sim.c (gdbsim_open): Apply constification to forward decl.
This commit is contained in:
Roland McGrath 2014-07-30 13:06:52 -07:00
parent 014f9477f4
commit 74228e7790
2 changed files with 28 additions and 24 deletions

View File

@ -1,3 +1,7 @@
2014-07-30 Roland McGrath <mcgrathr@google.com>
* remote-sim.c (gdbsim_open): Apply constification to forward decl.
2014-07-30 Tom Tromey <tromey@redhat.com> 2014-07-30 Tom Tromey <tromey@redhat.com>
* bsd-kvm.c (bsd_kvm_open): Constify. * bsd-kvm.c (bsd_kvm_open): Constify.
@ -1602,7 +1606,7 @@
momentary_breakpoint_from_master with additional argument. momentary_breakpoint_from_master with additional argument.
(momentary_breakpoint_from_master): Add argument to function (momentary_breakpoint_from_master): Add argument to function
definition and use it to initialize structure member flag. definition and use it to initialize structure member flag.
(clone_momentary_breakpoint): Call (clone_momentary_breakpoint): Call
momentary_breakpoint_from_master with additional argument. momentary_breakpoint_from_master with additional argument.
* infrun.c (follow_inferior_reset_breakpoints): Clear structure * infrun.c (follow_inferior_reset_breakpoints): Clear structure
member flags set in momentary_breakpoint_from_master. member flags set in momentary_breakpoint_from_master.
@ -1920,7 +1924,7 @@
(gdb_PyObject_HasAttrString): New inline function definitions. (gdb_PyObject_HasAttrString): New inline function definitions.
* py-value.c (get_field_flag): Remove the now unnecessary cast to * py-value.c (get_field_flag): Remove the now unnecessary cast to
char * of the second argument to PyObject_GetAttrString. char * of the second argument to PyObject_GetAttrString.
2014-06-10 Joel Brobecker <brobecker@adacore.com> 2014-06-10 Joel Brobecker <brobecker@adacore.com>
* serial.c (serial_write): Fix index of character to be printed * serial.c (serial_write): Fix index of character to be printed
@ -9402,7 +9406,7 @@
2014-02-03 Kevin Buettner <kevinb@redhat.com> 2014-02-03 Kevin Buettner <kevinb@redhat.com>
* mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Rewrite * mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Rewrite
dwarf2_to_gdb[] table using symbolic constants. Adjust dwarf2_to_gdb[] table using symbolic constants. Adjust
penultimate entry from number representing the PC register penultimate entry from number representing the PC register
to symbolic constant representing the MDR register. Add to symbolic constant representing the MDR register. Add

View File

@ -76,7 +76,7 @@ static void gdbsim_kill (struct target_ops *);
static void gdbsim_load (struct target_ops *self, const char *prog, static void gdbsim_load (struct target_ops *self, const char *prog,
int fromtty); int fromtty);
static void gdbsim_open (char *args, int from_tty); static void gdbsim_open (const char *args, int from_tty);
static void gdbsim_close (struct target_ops *self); static void gdbsim_close (struct target_ops *self);
@ -180,7 +180,7 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
a potential allocation of a sim_inferior_data struct in order to a potential allocation of a sim_inferior_data struct in order to
avoid needlessly allocating that struct in the event that the sim avoid needlessly allocating that struct in the event that the sim
instance allocation fails. */ instance allocation fails. */
if (sim_instance_needed == SIM_INSTANCE_NEEDED if (sim_instance_needed == SIM_INSTANCE_NEEDED
&& (sim_data == NULL || sim_data->gdbsim_desc == NULL)) && (sim_data == NULL || sim_data->gdbsim_desc == NULL))
{ {
struct inferior *idup; struct inferior *idup;
@ -190,7 +190,7 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
inf->num); inf->num);
idup = iterate_over_inferiors (check_for_duplicate_sim_descriptor, idup = iterate_over_inferiors (check_for_duplicate_sim_descriptor,
sim_desc); sim_desc);
if (idup != NULL) if (idup != NULL)
{ {
/* We don't close the descriptor due to the fact that it's /* We don't close the descriptor due to the fact that it's
@ -203,8 +203,8 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
error ( error (
_("Inferior %d and inferior %d would have identical simulator state.\n" _("Inferior %d and inferior %d would have identical simulator state.\n"
"(This simulator does not support the running of more than one inferior.)"), "(This simulator does not support the running of more than one inferior.)"),
inf->num, idup->num); inf->num, idup->num);
} }
} }
if (sim_data == NULL) if (sim_data == NULL)
@ -225,7 +225,7 @@ get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
else if (sim_desc) else if (sim_desc)
{ {
/* This handles the case where sim_data was allocated prior to /* This handles the case where sim_data was allocated prior to
needing a sim instance. */ needing a sim instance. */
sim_data->gdbsim_desc = sim_desc; sim_data->gdbsim_desc = sim_desc;
} }
@ -245,7 +245,7 @@ get_sim_inferior_data_by_ptid (ptid_t ptid, int sim_instance_needed)
if (pid <= 0) if (pid <= 0)
return NULL; return NULL;
inf = find_inferior_pid (pid); inf = find_inferior_pid (pid);
if (inf) if (inf)
@ -447,7 +447,7 @@ gdbsim_fetch_register (struct target_ops *ops,
case SIM_REGNO_DOES_NOT_EXIST: case SIM_REGNO_DOES_NOT_EXIST:
{ {
/* For moment treat a `does not exist' register the same way /* For moment treat a `does not exist' register the same way
as an ``unavailable'' register. */ as an ``unavailable'' register. */
gdb_byte buf[MAX_REGISTER_SIZE]; gdb_byte buf[MAX_REGISTER_SIZE];
int nr_bytes; int nr_bytes;
@ -455,7 +455,7 @@ gdbsim_fetch_register (struct target_ops *ops,
regcache_raw_supply (regcache, regno, buf); regcache_raw_supply (regcache, regno, buf);
break; break;
} }
default: default:
{ {
static int warn_user = 1; static int warn_user = 1;
@ -529,11 +529,11 @@ gdbsim_store_register (struct target_ops *ops,
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("Register size different to expected")); _("Register size different to expected"));
if (nr_bytes < 0) if (nr_bytes < 0)
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("Register %d not updated"), regno); _("Register %d not updated"), regno);
if (nr_bytes == 0) if (nr_bytes == 0)
warning (_("Register %s not updated"), warning (_("Register %s not updated"),
gdbarch_register_name (gdbarch, regno)); gdbarch_register_name (gdbarch, regno));
if (remote_debug) if (remote_debug)
{ {
@ -764,7 +764,7 @@ static int
gdbsim_close_inferior (struct inferior *inf, void *arg) gdbsim_close_inferior (struct inferior *inf, void *arg)
{ {
struct sim_inferior_data *sim_data = inferior_data (inf, struct sim_inferior_data *sim_data = inferior_data (inf,
sim_inferior_data_key); sim_inferior_data_key);
if (sim_data != NULL) if (sim_data != NULL)
{ {
ptid_t ptid = sim_data->remote_sim_ptid; ptid_t ptid = sim_data->remote_sim_ptid;
@ -1008,7 +1008,7 @@ gdbsim_wait (struct target_ops *ops,
prev_sigint = signal (SIGINT, gdbsim_cntrl_c); prev_sigint = signal (SIGINT, gdbsim_cntrl_c);
#endif #endif
sim_resume (sim_data->gdbsim_desc, sim_data->resume_step, sim_resume (sim_data->gdbsim_desc, sim_data->resume_step,
sim_data->resume_siggnal); sim_data->resume_siggnal);
signal (SIGINT, prev_sigint); signal (SIGINT, prev_sigint);
sim_data->resume_step = 0; sim_data->resume_step = 0;
@ -1200,14 +1200,14 @@ simulator_command (char *args, int from_tty)
{ {
/* PREVIOUSLY: The user may give a command before the simulator /* PREVIOUSLY: The user may give a command before the simulator
is opened. [...] (??? assuming of course one wishes to is opened. [...] (??? assuming of course one wishes to
continue to allow commands to be sent to unopened simulators, continue to allow commands to be sent to unopened simulators,
which isn't entirely unreasonable). */ which isn't entirely unreasonable). */
/* The simulator is a builtin abstraction of a remote target. /* The simulator is a builtin abstraction of a remote target.
Consistent with that model, access to the simulator, via sim Consistent with that model, access to the simulator, via sim
commands, is restricted to the period when the channel to the commands, is restricted to the period when the channel to the
simulator is open. */ simulator is open. */
error (_("Not connected to the simulator target")); error (_("Not connected to the simulator target"));
} }