gdb: remove arguments from inferior_created observable
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 2 Oct 2020 14:46:38 +0000 (10:46 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 2 Oct 2020 14:46:38 +0000 (10:46 -0400)
I noticed that non of the listeners of the inferior_created observable
used either of the arguments.  Remove them.  This in turn allows
removing the target parameter of post_create_inferior.

Tested only by rebuilding.

gdb/ChangeLog:

* observable.h <inferior_created>: Remove parameters.  Update all
listeners.
* inferior.h (post_create_inferior): Remove target parameter.
Update all callers.

Change-Id: I8944cefdc4447ed5347dc927b75abf1e7a0e27e6

15 files changed:
gdb/ChangeLog
gdb/bsd-uthread.c
gdb/corelow.c
gdb/dummy-frame.c
gdb/infcmd.c
gdb/inferior.h
gdb/infrun.c
gdb/jit.c
gdb/linux-thread-db.c
gdb/m68k-linux-tdep.c
gdb/observable.h
gdb/ravenscar-thread.c
gdb/symfile-mem.c
gdb/tracectf.c
gdb/tracefile-tfile.c

index 9dd2123d60e64417275f4693d3f6bd93ab6f664e..8788c60899f7f4a34d10eeccd842a7e16f6d40ee 100644 (file)
@@ -1,3 +1,10 @@
+2020-10-02  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * observable.h <inferior_created>: Remove parameters.  Update all
+       listeners.
+       * inferior.h (post_create_inferior): Remove target parameter.
+       Update all callers.
+
 2020-10-02  Nitika Achra  <Nitika.Achra@amd.com>
 
        * dwarf2/macro.c (dwarf_decode_macro_bytes): Handle DW_MACRO_define_strx
index 144e8b920fa9f62096d1f76d3e2c427f2d3f7310..e83707fd7c50bedae5a0ab75ef33d2301c3dd114 100644 (file)
@@ -263,7 +263,7 @@ bsd_uthread_deactivate (void)
 }
 
 static void
-bsd_uthread_inferior_created (struct target_ops *ops, int from_tty)
+bsd_uthread_inferior_created ()
 {
   bsd_uthread_activate (NULL);
 }
index de15895c80b5634602ac56bf642f3549c65cf962..e82c183eae5a32748338edb97b00c1b5bdcd828c 100644 (file)
@@ -516,7 +516,7 @@ core_target_open (const char *arg, int from_tty)
   if (exec_bfd == nullptr)
     locate_exec_from_corefile_build_id (core_bfd, from_tty);
 
-  post_create_inferior (target, from_tty);
+  post_create_inferior (from_tty);
 
   /* Now go through the target stack looking for threads since there
      may be a thread_stratum target loaded on top of target core by
index d47cfd2d9a2dd57e0c035021978cc4c2d9675cb7..1952d2eb6f305a040fbc1bc5db8b609e5bde871f 100644 (file)
@@ -273,7 +273,7 @@ find_dummy_frame_dtor (dummy_frame_dtor_ftype *dtor, void *dtor_data)
    them up at least once whenever we start a new inferior.  */
 
 static void
-cleanup_dummy_frames (struct target_ops *target, int from_tty)
+cleanup_dummy_frames ()
 {
   while (dummy_frame_stack != NULL)
     remove_dummy_frame (&dummy_frame_stack);
index 81ce36dafe2690fae1d299d1cba821c147f4e014..d8f95977a18c82f1d2aee635221e2d1e6c5d275d 100644 (file)
@@ -279,7 +279,7 @@ strip_bg_char (const char *args, int *bg_char_p)
    should be stopped.  */
 
 void
-post_create_inferior (struct target_ops *target, int from_tty)
+post_create_inferior (int from_tty)
 {
 
   /* Be sure we own the terminal in case write operations are performed.  */ 
@@ -347,7 +347,7 @@ post_create_inferior (struct target_ops *target, int from_tty)
      if the now pushed target supports hardware watchpoints.  */
   breakpoint_re_set ();
 
-  gdb::observers::inferior_created.notify (target, from_tty);
+  gdb::observers::inferior_created.notify ();
 }
 
 /* Kill the inferior if already running.  This function is designed
@@ -520,7 +520,7 @@ run_command_1 (const char *args, int from_tty, enum run_how run_how)
 
   /* Pass zero for FROM_TTY, because at this point the "run" command
      has done its thing; now we are setting up the running program.  */
-  post_create_inferior (current_top_target (), 0);
+  post_create_inferior (0);
 
   /* Queue a pending event so that the program stops immediately.  */
   if (run_how == RUN_STOP_AT_FIRST_INSN)
@@ -2432,7 +2432,7 @@ setup_inferior (int from_tty)
   /* Take any necessary post-attaching actions for this platform.  */
   target_post_attach (inferior_ptid.pid ());
 
-  post_create_inferior (current_top_target (), from_tty);
+  post_create_inferior (from_tty);
 }
 
 /* What to do after the first program stops after attaching.  */
index 70edf21b34bc859f123b6546ce602daa8f856a05..d016161fb05194b95933b80cb2dc80655c6297a1 100644 (file)
@@ -196,7 +196,7 @@ extern ptid_t gdb_startup_inferior (pid_t pid, int num_traps);
 
 extern void setup_inferior (int from_tty);
 
-extern void post_create_inferior (struct target_ops *, int);
+extern void post_create_inferior (int from_tty);
 
 extern void attach_command (const char *, int);
 
index daf10417842fecde9f066a4c767f34ab452745ea..a150585bd5adf7f18dce9ff532d02f92ea626eee 100644 (file)
@@ -3185,7 +3185,7 @@ start_remote (int from_tty)
   /* Now that the inferior has stopped, do any bookkeeping like
      loading shared libraries.  We want to do this before normal_stop,
      so that the displayed frame is up to date.  */
-  post_create_inferior (current_top_target (), from_tty);
+  post_create_inferior (from_tty);
 
   normal_stop ();
 }
index 5634c9e2b5d318b670afbb1a1fd1b714edaf3f50..9298ac0f4877a87e57b35792f5af73132c65d409 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -1232,7 +1232,7 @@ jit_inferior_init (struct gdbarch *gdbarch)
 /* inferior_created observer.  */
 
 static void
-jit_inferior_created (struct target_ops *ops, int from_tty)
+jit_inferior_created ()
 {
   jit_inferior_created_hook ();
 }
index 878e7bd183f600c4e5235f1efae6a24e08b8165f..c625cefead2f662875ead99180383ba8da605cbf 100644 (file)
@@ -1310,7 +1310,7 @@ check_pid_namespace_match (void)
    This handles the case of debugging statically linked executables.  */
 
 static void
-thread_db_inferior_created (struct target_ops *target, int from_tty)
+thread_db_inferior_created ()
 {
   check_pid_namespace_match ();
   check_for_thread_db ();
index dcc7e089608e2045c41831476a0752f4ddc8b31c..e4fc2faecb208eed0d165c58a6fcd59208c3fd13 100644 (file)
@@ -211,7 +211,7 @@ struct m68k_linux_sigtramp_info
 static int target_is_uclinux;
 
 static void
-m68k_linux_inferior_created (struct target_ops *objfile, int from_tty)
+m68k_linux_inferior_created ()
 {
   /* Record that we will need to re-evaluate whether we are running on a
      uClinux or normal GNU/Linux target (see m68k_linux_get_sigtramp_info).  */
index da0a9b12f74caab06a11bafa0e78f5f654937f01..d9d0f149f6f520275c97465893932bd2a39978dd 100644 (file)
@@ -87,8 +87,7 @@ extern observable<> executable_changed;
    instruction.  For 'attach' and 'core', gdb calls this observer
    immediately after connecting to the inferior, and before any
    information on the inferior has been printed.  */
-extern observable<struct target_ops */* target */,
-                 int /* from_tty */> inferior_created;
+extern observable<> inferior_created;
 
 /* The status of process record for inferior inferior in gdb has
    changed.  The process record is started if STARTED is true, and
index cc94ff8e1ea37729f9a5f932bdea023f6a9892a3..a7c59ad325a36fa5609e8ce8e9531997f79c952d 100644 (file)
@@ -657,7 +657,7 @@ ravenscar_thread_target::xfer_partial (enum target_object object,
 /* Observer on inferior_created: push ravenscar thread stratum if needed.  */
 
 static void
-ravenscar_inferior_created (struct target_ops *target, int from_tty)
+ravenscar_inferior_created ()
 {
   const char *err_msg;
 
index 78096fcbae19e9691da3e5aa6c6726dfebd7db83..5f212e10323f10360f4a361e8abcf81b85f0c9fa 100644 (file)
@@ -157,7 +157,7 @@ add_symbol_file_from_memory_command (const char *args, int from_tty)
    This function is called via the inferior_created observer.  */
 
 static void
-add_vsyscall_page (struct target_ops *target, int from_tty)
+add_vsyscall_page ()
 {
   struct mem_range vsyscall_range;
 
index 2c9a7495bfad0c1b48850e27a835424b4c51be91..0c4f66dd5816fc1a6e5bd6ab5139643118e58f44 100644 (file)
@@ -1175,7 +1175,7 @@ ctf_target_open (const char *dirname, int from_tty)
   merge_uploaded_trace_state_variables (&uploaded_tsvs);
   merge_uploaded_tracepoints (&uploaded_tps);
 
-  post_create_inferior (&ctf_ops, from_tty);
+  post_create_inferior (from_tty);
 }
 
 /* This is the implementation of target_ops method to_close.  Destroy
index fd7bab822a1223f3929044c705a35b0a6ee3b58b..9cf68c5cb6ec9204b41cb384674bb8a61e0816f6 100644 (file)
@@ -571,7 +571,7 @@ tfile_target_open (const char *arg, int from_tty)
 
   merge_uploaded_tracepoints (&uploaded_tps);
 
-  post_create_inferior (&tfile_ops, from_tty);
+  post_create_inferior (from_tty);
 }
 
 /* Interpret the given line from the definitions part of the trace
This page took 0.049418 seconds and 4 git commands to generate.