mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-20 06:15:09 +08:00
* ada-lang.c (decode_packed_array_type): Avoid a seg fault
when the type is an anonymous pointer type. (ada_check_typedef): Avoid a seg fault when the type is null. * ada-typeprint.c (print_array_type): Add support for pointer to packed arrays.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2008-01-04 Jerome Guitton <guitton@adacore.com>
|
||||||
|
|
||||||
|
* ada-lang.c (decode_packed_array_type): Avoid a seg fault
|
||||||
|
when the type is an anonymous pointer type.
|
||||||
|
(ada_check_typedef): Avoid a seg fault when the type is null.
|
||||||
|
* ada-typeprint.c (print_array_type): Add support for pointer
|
||||||
|
to packed arrays.
|
||||||
|
|
||||||
2008-01-04 Paul N. Hilfinger <hilfinger@adacore.com>
|
2008-01-04 Paul N. Hilfinger <hilfinger@adacore.com>
|
||||||
|
|
||||||
* ada-exp.y: Allow '{type} ADDRESS' notation on left of assignment.
|
* ada-exp.y: Allow '{type} ADDRESS' notation on left of assignment.
|
||||||
|
@ -1809,13 +1809,21 @@ decode_packed_array_type (struct type *type)
|
|||||||
{
|
{
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct block **blocks;
|
struct block **blocks;
|
||||||
const char *raw_name = ada_type_name (ada_check_typedef (type));
|
char *raw_name = ada_type_name (ada_check_typedef (type));
|
||||||
char *name = (char *) alloca (strlen (raw_name) + 1);
|
char *name;
|
||||||
char *tail = strstr (raw_name, "___XP");
|
char *tail;
|
||||||
struct type *shadow_type;
|
struct type *shadow_type;
|
||||||
long bits;
|
long bits;
|
||||||
int i, n;
|
int i, n;
|
||||||
|
|
||||||
|
if (!raw_name)
|
||||||
|
raw_name = ada_type_name (desc_base_type (type));
|
||||||
|
|
||||||
|
if (!raw_name)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
name = (char *) alloca (strlen (raw_name) + 1);
|
||||||
|
tail = strstr (raw_name, "___XP");
|
||||||
type = desc_base_type (type);
|
type = desc_base_type (type);
|
||||||
|
|
||||||
memcpy (name, raw_name, tail - raw_name);
|
memcpy (name, raw_name, tail - raw_name);
|
||||||
@ -7269,6 +7277,9 @@ static_unwrap_type (struct type *type)
|
|||||||
struct type *
|
struct type *
|
||||||
ada_check_typedef (struct type *type)
|
ada_check_typedef (struct type *type)
|
||||||
{
|
{
|
||||||
|
if (type == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
CHECK_TYPEDEF (type);
|
CHECK_TYPEDEF (type);
|
||||||
if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM
|
if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM
|
||||||
|| !TYPE_STUB (type)
|
|| !TYPE_STUB (type)
|
||||||
|
@ -366,6 +366,9 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
|
|||||||
int bitsize;
|
int bitsize;
|
||||||
int n_indices;
|
int n_indices;
|
||||||
|
|
||||||
|
if (ada_is_packed_array_type (type))
|
||||||
|
type = ada_coerce_to_simple_array_type (type);
|
||||||
|
|
||||||
bitsize = 0;
|
bitsize = 0;
|
||||||
fprintf_filtered (stream, "array (");
|
fprintf_filtered (stream, "array (");
|
||||||
|
|
||||||
@ -374,8 +377,6 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
|
|||||||
fprintf_filtered (stream, "...");
|
fprintf_filtered (stream, "...");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ada_is_packed_array_type (type))
|
|
||||||
type = ada_coerce_to_simple_array_type (type);
|
|
||||||
if (type == NULL)
|
if (type == NULL)
|
||||||
{
|
{
|
||||||
fprintf_filtered (stream, _("<undecipherable array type>"));
|
fprintf_filtered (stream, _("<undecipherable array type>"));
|
||||||
@ -782,7 +783,17 @@ ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
|
|||||||
if (ada_is_aligner_type (type))
|
if (ada_is_aligner_type (type))
|
||||||
ada_print_type (ada_aligned_type (type), "", stream, show, level);
|
ada_print_type (ada_aligned_type (type), "", stream, show, level);
|
||||||
else if (ada_is_packed_array_type (type))
|
else if (ada_is_packed_array_type (type))
|
||||||
|
{
|
||||||
|
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||||
|
{
|
||||||
|
fprintf_filtered (stream, "access ");
|
||||||
|
print_array_type (TYPE_TARGET_TYPE (type), stream, show, level);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
print_array_type (type, stream, show, level);
|
print_array_type (type, stream, show, level);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
switch (TYPE_CODE (type))
|
switch (TYPE_CODE (type))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user