]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Constify gdbserver "monitor" commands
authorTom Tromey <tom@tromey.com>
Sat, 18 Apr 2020 19:25:51 +0000 (13:25 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 22 Jan 2026 15:46:32 +0000 (08:46 -0700)
I noticed that the gdbserver "monitor" commands should take a const
parameter.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdbserver/linux-low.cc
gdbserver/linux-low.h
gdbserver/server.cc
gdbserver/target.cc
gdbserver/target.h
gdbserver/thread-db.cc

index b12f7c08b317868773a0357123d944352c90fc7f..ca20a5bca1689af5ffdd9d72ea111154a49ea0f8 100644 (file)
@@ -6003,7 +6003,7 @@ linux_process_target::handle_new_gdb_connection ()
 }
 
 int
-linux_process_target::handle_monitor_command (char *mon)
+linux_process_target::handle_monitor_command (const char *mon)
 {
 #ifdef USE_THREAD_DB
   return thread_db_handle_monitor_command (mon);
index ae196f5767a4994ac7963ee6c6f74c1d0ce309cd..03e1120295507c7568e083084bd686e23c168868 100644 (file)
@@ -245,7 +245,7 @@ public:
 
   void handle_new_gdb_connection () override;
 
-  int handle_monitor_command (char *mon) override;
+  int handle_monitor_command (const char *mon) override;
 
   int core_of_thread (ptid_t ptid) override;
 
@@ -947,7 +947,7 @@ CORE_ADDR linux_get_pc_64bit (struct regcache *regcache);
 int thread_db_init (void);
 void thread_db_detach (struct process_info *);
 void thread_db_mourn (struct process_info *);
-int thread_db_handle_monitor_command (char *);
+int thread_db_handle_monitor_command (const char *);
 int thread_db_get_tls_address (thread_info *thread, CORE_ADDR offset,
                               CORE_ADDR load_module, CORE_ADDR *address);
 int thread_db_look_up_one_symbol (const char *name, CORE_ADDR *addrp);
index fcad2b973d52667087ec5a29f1651f4f35acefb6..674300f8ce03a0da32939de12e8f4c8d8c521478 100644 (file)
@@ -1714,7 +1714,7 @@ handle_general_monitor_debug (const char *mon)
 /* Handle monitor commands not handled by target-specific handlers.  */
 
 static void
-handle_monitor_command (char *mon, char *own_buf)
+handle_monitor_command (const char *mon, char *own_buf)
 {
   if (startswith (mon, "set debug "))
     {
index 5a2e96811b34dc3e931d7ed23577bfe3b8b59505..43ef421df74de207d782d2fdc982b5a870a04fcd 100644 (file)
@@ -550,7 +550,7 @@ process_stratum_target::handle_new_gdb_connection ()
 }
 
 int
-process_stratum_target::handle_monitor_command (char *mon)
+process_stratum_target::handle_monitor_command (const char *mon)
 {
   return 0;
 }
index d6ab83768d354524795fa3b3040dbfe303ebce71..82eab9d1243f3595dab5394860fee166611ad6b8 100644 (file)
@@ -288,7 +288,7 @@ public:
 
   /* The target-specific routine to process monitor command.
      Returns 1 if handled, or 0 to perform default processing.  */
-  virtual int handle_monitor_command (char *mon);
+  virtual int handle_monitor_command (const char *mon);
 
   /* Returns the core given a thread, or -1 if not known.  */
   virtual int core_of_thread (ptid_t ptid);
index 2370c139afa52b52d58e60a99b7f8425d2d1b19c..7f29788d7d79325af95c2c6606fae81051fdea87 100644 (file)
@@ -833,7 +833,7 @@ thread_db_mourn (struct process_info *proc)
    For any other command, return 0.  */
 
 int
-thread_db_handle_monitor_command (char *mon)
+thread_db_handle_monitor_command (const char *mon)
 {
   const char *cmd = "set libthread-db-search-path";
   size_t cmd_len = strlen (cmd);