-/* Ada language support routines for GDB, the GNU debugger. Copyright
+/* Ada language support routines for GDB, the GNU debugger. Copyright (C)
1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004, 2005 Free
Software Foundation, Inc.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
#include "defs.h"
static int is_dynamic_field (struct type *, int);
static struct type *to_fixed_variant_branch_type (struct type *,
- const bfd_byte *,
+ const gdb_byte *,
CORE_ADDR, struct value *);
static struct type *to_fixed_array_type (struct type *, struct value *, int);
return ada_completer_word_break_characters;
}
+/* Print an array element index using the Ada syntax. */
+
+static void
+ada_print_array_index (struct value *index_value, struct ui_file *stream,
+ int format, enum val_prettyprint pretty)
+{
+ LA_VALUE_PRINT (index_value, stream, format, pretty);
+ fprintf_filtered (stream, " => ");
+}
+
/* Read the string located at ADDR from the inferior and store the
result into BUF. */
struct value *
value_from_contents_and_address (struct type *type,
- const bfd_byte *valaddr,
+ const gdb_byte *valaddr,
CORE_ADDR address)
{
struct value *v = allocate_value (type);
}
}
-static const bfd_byte *
-cond_offset_host (const bfd_byte *valaddr, long offset)
+static const gdb_byte *
+cond_offset_host (const gdb_byte *valaddr, long offset)
{
if (valaddr == NULL)
return NULL;
Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT. */
struct value *
-ada_value_primitive_packed_val (struct value *obj, const bfd_byte *valaddr,
+ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
long offset, int bit_offset, int bit_size,
struct type *type)
{
TARGET, starting at bit offset TARG_OFFSET. SOURCE and TARGET must
not overlap. */
static void
-move_bits (bfd_byte *target, int targ_offset, const bfd_byte *source,
+move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source,
int src_offset, int n)
{
unsigned int accum, mask;
else if (is_enumeral
&& TYPE_NAME (SYMBOL_TYPE (syms[i].sym)) != NULL)
{
- printf_unfiltered ("[%d] ", i + first_choice);
+ printf_unfiltered (("[%d] "), i + first_choice);
ada_print_type (SYMBOL_TYPE (syms[i].sym), NULL,
gdb_stdout, -1, 0);
printf_unfiltered (_("'(%s) (enumeral)\n"),
if (prompt == NULL)
prompt = ">";
- printf_unfiltered ("%s ", prompt);
+ printf_unfiltered (("%s "), prompt);
gdb_flush (gdb_stdout);
args = command_line_input ((char *) NULL, 0, annotation_suffix);
static struct value *
value_tag_from_contents_and_address (struct type *type,
- const bfd_byte *valaddr,
+ const gdb_byte *valaddr,
CORE_ADDR address)
{
int tag_byte_offset, dummy1, dummy2;
if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
&dummy1, &dummy2))
{
- const bfd_byte *valaddr1 = ((valaddr == NULL)
+ const gdb_byte *valaddr1 = ((valaddr == NULL)
? NULL
: valaddr + tag_byte_offset);
CORE_ADDR address1 = (address == 0) ? 0 : address + tag_byte_offset;
int
ada_which_variant_applies (struct type *var_type, struct type *outer_type,
- const bfd_byte *outer_valaddr)
+ const gdb_byte *outer_valaddr)
{
int others_clause;
int i;
struct type *
ada_template_to_fixed_record_type_1 (struct type *type,
- const bfd_byte *valaddr,
+ const gdb_byte *valaddr,
CORE_ADDR address, struct value *dval0,
int keep_dynamic_fields)
{
of 1. */
static struct type *
-template_to_fixed_record_type (struct type *type, const bfd_byte *valaddr,
+template_to_fixed_record_type (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct value *dval0)
{
return ada_template_to_fixed_record_type_1 (type, valaddr,
contains the necessary discriminant values. */
static struct type *
-to_record_with_fixed_variant_part (struct type *type, const bfd_byte *valaddr,
+to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct value *dval0)
{
struct value *mark = value_mark ();
shortcut and suspect the compiler should be altered. FIXME. */
static struct type *
-to_fixed_record_type (struct type *type0, const bfd_byte *valaddr,
+to_fixed_record_type (struct type *type0, const gdb_byte *valaddr,
CORE_ADDR address, struct value *dval)
{
struct type *templ_type;
indicated in the union's type name. */
static struct type *
-to_fixed_variant_branch_type (struct type *var_type0, const bfd_byte *valaddr,
+to_fixed_variant_branch_type (struct type *var_type0, const gdb_byte *valaddr,
CORE_ADDR address, struct value *dval)
{
int which;
ADDRESS or in VALADDR contains these discriminants. */
struct type *
-ada_to_fixed_type (struct type *type, const bfd_byte *valaddr,
+ada_to_fixed_type (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct value *dval)
{
type = ada_check_typedef (type);
/* The address of the aligned value in an object at address VALADDR
having type TYPE. Assumes ada_is_aligner_type (TYPE). */
-const bfd_byte *
-ada_aligned_value_addr (struct type *type, const bfd_byte *valaddr)
+const gdb_byte *
+ada_aligned_value_addr (struct type *type, const gdb_byte *valaddr)
{
if (ada_is_aligner_type (type))
return ada_aligned_value_addr (TYPE_FIELD_TYPE (type, 0),
NULL,
ada_get_gdb_completer_word_break_characters,
ada_language_arch_info,
+ ada_print_array_index,
LANG_MAGIC
};