aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-descriptions.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-11-09 01:47:20 +0000
committerPedro Alves <palves@redhat.com>2012-11-09 01:47:20 +0000
commit6ecd47299a08f30181d8c3386c0271393b92a8d0 (patch)
treea5af2b4b1caa26f395d346d1859f55e6ae0264b0 /gdb/target-descriptions.h
parent090fa3d5ebe38e690aad34d8efbdaf0b15365eff (diff)
downloadgdb-6ecd47299a08f30181d8c3386c0271393b92a8d0.zip
gdb-6ecd47299a08f30181d8c3386c0271393b92a8d0.tar.gz
gdb-6ecd47299a08f30181d8c3386c0271393b92a8d0.tar.bz2
gdb/
2012-11-09 Pedro Alves <palves@redhat.com> * gdbarch.sh (target_gdbarch) <gdbarch.h>: Reimplement as macro. (get_target_gdbarch) <gdbarch.h>: New function. (startup_gdbarch) <gdbarch.h>: Declare. <gdbarch.c> (target_gdbarch): Delete. <gdbarch.c> (deprecated_target_gdbarch_select_hack): Set the current inferior's gdbarch. <gdbarch.c> (get_target_gdbarch): New function. * inferior.c: Include target-descriptions.h. (free_inferior): Free target description info. (add_inferior_with_spaces): Set the inferior's initial architecture. (clone_inferior_command): Copy the original inferior's target description if it was user specified. (initialize_inferiors): Add comment. * inferior.h (struct target_desc_info): Forward declare. (struct inferior) <gdbarch>: New field. * linux-nat.c: Include target-descriptions.h. (linux_child_follow_fork): Copy the parent's architecture and target description to the child. * target-descriptions.c: Include inferior.h. (struct target_desc_info): New structure, holding the equivalents of ... (target_desc_fetched, current_target_desc) (target_description_filename): ... these removed globals. (get_tdesc_info, target_desc_info_from_user_p) (copy_inferior_target_desc_info, target_desc_info_free): New. (target_desc_fetched, current_target_desc) (target_description_filename): Reimplemented as convenience macros. (tdesc_filename_cmd_string): New global. (set_tdesc_filename_cmd): Copy the string manipulated by the "set tdescs filename ..." commands to the per-inferior equivalent. (show_tdesc_filename_cmd): Get the value to show from the per-inferior description filename. (_initilize_target_descriptions): Change the "set/show tdesc filename" commands' variable. * target-descriptions.h (struct target_desc, struct target_desc_info) (struct inferior): Forward declare. (target_find_description, target_clear_description) (target_current_description): Adjust comments. (copy_inferior_target_desc_info, target_desc_info_free) (target_desc_info_from_user_p). Declare. gdb/testsuite/ 2012-11-09 Pedro Alves <palves@redhat.com> * gdb.multi/multi-arch.exp: New.
Diffstat (limited to 'gdb/target-descriptions.h')
-rw-r--r--gdb/target-descriptions.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h
index 6a09a90..f0841d1 100644
--- a/gdb/target-descriptions.h
+++ b/gdb/target-descriptions.h
@@ -28,23 +28,45 @@ struct tdesc_type;
struct tdesc_reg;
struct target_desc;
struct target_ops;
+struct target_desc;
+/* An inferior's target description info is stored in this opaque
+ object. There's one such object per inferior. */
+struct target_desc_info;
+struct inferior;
-/* Fetch the current target's description, and switch the current
+/* Fetch the current inferior's description, and switch its current
architecture to one which incorporates that description. */
void target_find_description (void);
-/* Discard any description fetched from the current target, and switch
- the current architecture to one with no target description. */
+/* Discard any description fetched from the target for the current
+ inferior, and switch the current architecture to one with no target
+ description. */
void target_clear_description (void);
-/* Return the global current target description. This should only be
- used by gdbarch initialization code; most access should be through
- an existing gdbarch. */
+/* Return the current inferior's target description. This should only
+ be used by gdbarch initialization code; most access should be
+ through an existing gdbarch. */
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);
+
+/* Free a target_desc_info object. */
+
+void target_desc_info_free (struct target_desc_info *tdesc_info);
+
+/* Returns true if INFO indicates the target description had been
+ supplied by the user. */
+
+int target_desc_info_from_user_p (struct target_desc_info *info);
+
/* Record architecture-specific functions to call for pseudo-register
support. If tdesc_use_registers is called and gdbarch_num_pseudo_regs
is greater than zero, then these should be called as well.