gdb: remove copy_inferior_target_desc_info
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 3 Feb 2023 14:21:25 +0000 (09:21 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 3 Feb 2023 16:06:26 +0000 (11:06 -0500)
This function is now trivial, we can just copy inferior::tdesc_info
where needed.

Change-Id: I25185e2cd4ba1ef24a822d9e0eebec6e611d54d6

gdb/inferior.c
gdb/infrun.c
gdb/target-descriptions.c
gdb/target-descriptions.h

index dfe523664de0b00592c83b90f3c166476076b67c..65863440b9c0f2cb189c371501c00ebd1ac78b0a 100644 (file)
@@ -962,7 +962,7 @@ clone_inferior_command (const char *args, int from_tty)
       /* If the original inferior had a user specified target
         description, make the clone use it too.  */
       if (target_desc_info_from_user_p (&inf->tdesc_info))
-       copy_inferior_target_desc_info (inf, orginf);
+       inf->tdesc_info = orginf->tdesc_info;
 
       clone_program_space (pspace, orginf->pspace);
 
index edfb5ab0a91f47b1e4f86814f22eae1abbdc8a1a..87ab73c47a4f55329e98876e79ee25b096082322 100644 (file)
@@ -478,7 +478,7 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
          child_inf->attach_flag = parent_inf->attach_flag;
          copy_terminal_info (child_inf, parent_inf);
          child_inf->gdbarch = parent_inf->gdbarch;
-         copy_inferior_target_desc_info (child_inf, parent_inf);
+         child_inf->tdesc_info = parent_inf->tdesc_info;
 
          child_inf->symfile_flags = SYMFILE_NO_READ;
 
@@ -546,7 +546,7 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
       child_inf->attach_flag = parent_inf->attach_flag;
       copy_terminal_info (child_inf, parent_inf);
       child_inf->gdbarch = parent_inf->gdbarch;
-      copy_inferior_target_desc_info (child_inf, parent_inf);
+      child_inf->tdesc_info = parent_inf->tdesc_info;
 
       if (has_vforked)
        {
index 0561a8098c5c6c98f8a419a2c356b5be6ece3461..6defd5bbe8632cdd816529f0d6d0551484f1091d 100644 (file)
@@ -459,17 +459,6 @@ target_desc_info_from_user_p (struct target_desc_info *info)
   return info != nullptr && !info->filename.empty ();
 }
 
-/* See target-descriptions.h.  */
-
-void
-copy_inferior_target_desc_info (struct inferior *destinf, struct inferior *srcinf)
-{
-  struct target_desc_info *src = &srcinf->tdesc_info;
-  struct target_desc_info *dest = &destinf->tdesc_info;
-
-  *dest = *src;
-}
-
 /* The string manipulated by the "set tdesc filename ..." command.  */
 
 static std::string tdesc_filename_cmd_string;
index c337c177c8e805f631c39e924a83d39419f43ff6..b835e144c6809d6d2ef43081076b20acb55f237c 100644 (file)
@@ -48,13 +48,6 @@ void target_clear_description (void);
 
 const struct target_desc *target_current_description (void);
 
-/* Copy inferior target description data.  Used for example when
-   handling (v)forks, where child's description is the same as the
-   parent's, since the child really is a copy of the parent.  */
-
-void copy_inferior_target_desc_info (struct inferior *destinf,
-                                    struct inferior *srcinf);
-
 /* Returns true if INFO indicates the target description had been
    supplied by the user.  */