]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - include/gdb/remote-sim.h
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / include / gdb / remote-sim.h
index a49ba1a89e91d7b5e4841b68cbf9eb26ba5e2940..73fb670c17e51efae2a0626d425b4651428539a5 100644 (file)
@@ -1,23 +1,21 @@
 /* This file defines the interface between the simulator and gdb.
 
-   Copyright 1993, 1994, 1996, 1997, 1998, 2000, 2002 Free Software
-   Foundation, Inc.
+   Copyright (C) 1993-2021 Free Software Foundation, Inc.
 
-This file is part of GDB.
+   This file is part of GDB.
 
-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
-(at your option) any later version.
+   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 3 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   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.  */
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #if !defined (REMOTE_SIM_H)
 #define REMOTE_SIM_H 1
@@ -62,9 +60,10 @@ typedef enum {
 } SIM_RC;
 
 
-/* The bfd struct, as an opaque type.  */
+/* Some structs, as opaque types.  */
 
 struct bfd;
+struct host_callback_struct;
 
 
 /* Main simulator entry points.  */
@@ -105,7 +104,8 @@ struct bfd;
    sim_create_inferior.  FIXME: What should the state of the simulator
    be? */
 
-SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *callback, struct bfd *abfd, char **argv));
+SIM_DESC sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback,
+                  struct bfd *abfd, char * const *argv);
 
 
 /* Destory a simulator instance.
@@ -116,7 +116,7 @@ SIM_DESC sim_open PARAMS ((SIM_OPEN_KIND kind, struct host_callback_struct *call
    and mmap'd areas.  You cannot assume sim_kill has already been
    called. */
 
-void sim_close PARAMS ((SIM_DESC sd, int quitting));
+void sim_close (SIM_DESC sd, int quitting);
 
 
 /* Load program PROG into the simulators memory.
@@ -142,7 +142,7 @@ void sim_close PARAMS ((SIM_DESC sd, int quitting));
    Such manipulation should probably (?) occure in
    sim_create_inferior. */
 
-SIM_RC sim_load PARAMS ((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.
@@ -162,21 +162,22 @@ SIM_RC sim_load PARAMS ((SIM_DESC sd, char *prog, struct bfd *abfd, int from_tty
    address space (according to the applicable ABI) and the program
    counter and stack pointer set accordingly. */
 
-SIM_RC sim_create_inferior PARAMS ((SIM_DESC sd, struct bfd *abfd, char **argv, char **env));
+SIM_RC sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
+                           char * const *argv, char * const *env);
 
 
 /* Fetch LENGTH bytes of the simulated program's memory.  Start fetch
    at virtual address MEM and store in BUF.  Result is number of bytes
    read, or zero if error.  */
 
-int sim_read PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length));
+int sim_read (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length);
 
 
 /* Store LENGTH bytes from BUF into the simulated program's
    memory. Store bytes starting at virtual address MEM. Result is
    number of bytes write, or zero if error.  */
 
-int sim_write PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length));
+int sim_write (SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length);
 
 
 /* Fetch register REGNO storing its raw (target endian) value in the
@@ -188,26 +189,28 @@ int sim_write PARAMS ((SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length
    If LENGTH does not match the size of REGNO no data is transfered
    (the actual register size is still returned). */
 
-int sim_fetch_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf, int length));
+int sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length);
 
 
 /* Store register REGNO from the raw (target endian) value in BUF.
-   Return the actual size of the register or zero if REGNO is not
-   applicable.
 
-   Legacy implementations ignore LENGTH and always return -1.
+   Return the actual size of the register, any size not equal to
+   LENGTH indicates the register was not updated correctly.
 
-   If LENGTH does not match the size of REGNO no data is transfered
-   (the actual register size is still returned). */
+   Return a LENGTH of -1 to indicate the register was not updated
+   and an error has occurred.
 
-int sim_store_register PARAMS ((SIM_DESC sd, int regno, unsigned char *buf, int length));
+   Return a LENGTH of 0 to indicate the register was not updated
+   but no error has occurred. */
+
+int sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length);
 
 
 /* Print whatever statistics the simulator has collected.
 
    VERBOSE is currently unused and must always be zero.  */
 
-void sim_info PARAMS ((SIM_DESC sd, int verbose));
+void sim_info (SIM_DESC sd, int verbose);
 
 
 /* Run (or resume) the simulated program.
@@ -232,14 +235,14 @@ void sim_info PARAMS ((SIM_DESC sd, int verbose));
    continued.  A zero SIGRC value indicates that the program should
    continue as normal. */
 
-void sim_resume PARAMS ((SIM_DESC sd, int step, int siggnal));
+void sim_resume (SIM_DESC sd, int step, int siggnal);
 
 
 /* Asynchronous request to stop the simulation.
    A nonzero return indicates that the simulator is able to handle
    the request */
 
-int sim_stop PARAMS ((SIM_DESC sd));
+int sim_stop (SIM_DESC sd);
 
 
 /* Fetch the REASON why the program stopped.
@@ -258,7 +261,7 @@ int sim_stop PARAMS ((SIM_DESC sd));
    that information is not directly accessable via this interface.
 
    SIM_SIGNALLED: The program has been terminated by a signal. The
-   simulator has encountered target code that causes the the program
+   simulator has encountered target code that causes the program
    to exit with signal SIGRC.
 
    SIM_RUNNING, SIM_POLLING: The return of one of these values
@@ -266,14 +269,19 @@ int sim_stop PARAMS ((SIM_DESC sd));
 
 enum sim_stop { sim_running, sim_polling, sim_exited, sim_stopped, sim_signalled };
 
-void sim_stop_reason PARAMS ((SIM_DESC sd, enum sim_stop *reason, int *sigrc));
+void sim_stop_reason (SIM_DESC sd, enum sim_stop *reason, int *sigrc);
 
 
 /* Passthru for other commands that the simulator might support.
    Simulators should be prepared to deal with any combination of NULL
    or empty CMD. */
 
-void sim_do_command PARAMS ((SIM_DESC sd, char *cmd));
+void sim_do_command (SIM_DESC sd, const char *cmd);
+
+/* Complete a command based on the available sim commands.  Returns an
+   array of possible matches.  */
+
+char **sim_complete_command (SIM_DESC sd, const char *text, const char *word);
 
 #ifdef __cplusplus
 }