2006-11-28 22:10:26 +00:00
|
|
|
/* Target description support for GDB.
|
|
|
|
|
|
|
|
Copyright (C) 2006
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Contributed by CodeSourcery.
|
|
|
|
|
|
|
|
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 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., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA. */
|
|
|
|
|
|
|
|
#ifndef TARGET_DESCRIPTIONS_H
|
|
|
|
#define TARGET_DESCRIPTIONS_H 1
|
|
|
|
|
|
|
|
struct target_desc;
|
|
|
|
|
|
|
|
/* Fetch the current target's description, and switch the 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. */
|
|
|
|
|
|
|
|
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. */
|
|
|
|
|
|
|
|
const struct target_desc *target_current_description (void);
|
|
|
|
|
|
|
|
/* Accessors for target descriptions. */
|
|
|
|
|
* Makefile.in (mips-tdep.o, target-descriptions.o): Update.
* target-descriptions.c (struct property): New.
(struct target_desc): Add properties member.
(tdesc_property, set_tdesc_property): New.
* target-descriptions.h (tdesc_property, set_tdesc_property):
Declare.
* mips-tdep.c (PROPERTY_GP32, PROPERTY_GP64): New constants.
(struct gdbarch_tdep): Add register_size_valid_p and register_size.
(mips_isa_regsize): Use them.
(mips_register_g_packet_guesses): New.
(mips_gdbarch_init): Call it. If a target description is supplied,
check for internal properties. Check for register size mismatches.
* remote.c (send_g_packet, process_g_packet): New functions, split
out from fetch_registers_using_g.
(fetch_registers_using_g): Use them.
(struct remote_g_packet_guess, remote_g_packet_guess_s)
(struct remote_g_packet_data, remote_g_packet_data_handle)
(remote_g_packet_data_init, register_remote_g_packet_guess)
(remote_read_description): New.
(init_remote_ops, init_remote_async_ops): Set to_read_description.
(_initialize_remote): Register remote_g_packet_data_handle.
* remote.h (register_remote_g_packet_guess): Declare.
2006-11-28 22:14:31 +00:00
|
|
|
/* Return the string value of a property named KEY, or NULL if the
|
|
|
|
property was not specified. */
|
|
|
|
|
|
|
|
const char *tdesc_property (const struct target_desc *,
|
|
|
|
const char *key);
|
|
|
|
|
2006-11-28 22:10:26 +00:00
|
|
|
/* Methods for constructing a target description. */
|
|
|
|
|
|
|
|
struct target_desc *allocate_target_description (void);
|
|
|
|
|
* Makefile.in (mips-tdep.o, target-descriptions.o): Update.
* target-descriptions.c (struct property): New.
(struct target_desc): Add properties member.
(tdesc_property, set_tdesc_property): New.
* target-descriptions.h (tdesc_property, set_tdesc_property):
Declare.
* mips-tdep.c (PROPERTY_GP32, PROPERTY_GP64): New constants.
(struct gdbarch_tdep): Add register_size_valid_p and register_size.
(mips_isa_regsize): Use them.
(mips_register_g_packet_guesses): New.
(mips_gdbarch_init): Call it. If a target description is supplied,
check for internal properties. Check for register size mismatches.
* remote.c (send_g_packet, process_g_packet): New functions, split
out from fetch_registers_using_g.
(fetch_registers_using_g): Use them.
(struct remote_g_packet_guess, remote_g_packet_guess_s)
(struct remote_g_packet_data, remote_g_packet_data_handle)
(remote_g_packet_data_init, register_remote_g_packet_guess)
(remote_read_description): New.
(init_remote_ops, init_remote_async_ops): Set to_read_description.
(_initialize_remote): Register remote_g_packet_data_handle.
* remote.h (register_remote_g_packet_guess): Declare.
2006-11-28 22:14:31 +00:00
|
|
|
void set_tdesc_property (struct target_desc *,
|
|
|
|
const char *key, const char *value);
|
|
|
|
|
2006-11-28 22:10:26 +00:00
|
|
|
#endif /* TARGET_DESCRIPTIONS_H */
|