aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-01-21 16:46:12 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-01-21 16:46:12 +0000
commit5a352474f94fb3d8b8d81cd5000eb2d10ad7c656 (patch)
tree45479d53cf38bc535f3b1a06be98f81fd33edaca /gdb
parent822b8bf46be64f9055e3d4b944323881f102fd8d (diff)
downloadgdb-5a352474f94fb3d8b8d81cd5000eb2d10ad7c656.zip
gdb-5a352474f94fb3d8b8d81cd5000eb2d10ad7c656.tar.gz
gdb-5a352474f94fb3d8b8d81cd5000eb2d10ad7c656.tar.bz2
gdb/
Fix gdb.fortran/common-block.exp crash in PIE mode. * dwarf2read.c (new_symbol_full) <DW_TAG_common_block>: Use LOC_COMMON_BLOCK. * f-valprint.c (info_common_command_for_block): Expect LOC_COMMON_BLOCK in gdb_assert. * symtab.h (struct general_symbol_info): Update comment for the common_block member. (domain_enum): Extend comment for the COMMON_BLOCK_DOMAIN member. (enum address_class): New member LOC_COMMON_BLOCK.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/dwarf2read.c2
-rw-r--r--gdb/f-valprint.c2
-rw-r--r--gdb/symtab.h9
4 files changed, 21 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3e52b40..bc73b97 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2013-01-21 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix gdb.fortran/common-block.exp crash in PIE mode.
+ * dwarf2read.c (new_symbol_full) <DW_TAG_common_block>: Use
+ LOC_COMMON_BLOCK.
+ * f-valprint.c (info_common_command_for_block): Expect
+ LOC_COMMON_BLOCK in gdb_assert.
+ * symtab.h (struct general_symbol_info): Update comment for the
+ common_block member.
+ (domain_enum): Extend comment for the COMMON_BLOCK_DOMAIN member.
+ (enum address_class): New member LOC_COMMON_BLOCK.
+
2013-01-18 David Blaikie <dblaikie@gmail.com>
* MAINTAINERS (Write After Approval): Add "David Blaikie".
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 7a58c45..364e6af 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -16071,7 +16071,7 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
list_to_add = &global_symbols;
break;
case DW_TAG_common_block:
- SYMBOL_CLASS (sym) = LOC_STATIC;
+ SYMBOL_CLASS (sym) = LOC_COMMON_BLOCK;
SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;
add_symbol_to_list (sym, cu->list_in_scope);
break;
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 22cca83..d01d6ec 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -427,7 +427,7 @@ info_common_command_for_block (struct block *block, const char *comname,
struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym);
size_t index;
- gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC);
+ gdb_assert (SYMBOL_CLASS (sym) == LOC_COMMON_BLOCK);
if (comname && (!SYMBOL_LINKAGE_NAME (sym)
|| strcmp (comname, SYMBOL_LINKAGE_NAME (sym)) != 0))
diff --git a/gdb/symtab.h b/gdb/symtab.h
index c334a3a..b992266 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -120,7 +120,7 @@ struct general_symbol_info
CORE_ADDR address;
- /* A common block. Used with COMMON_BLOCK_DOMAIN. */
+ /* A common block. Used with LOC_COMMON_BLOCK. */
struct common_block *common_block;
@@ -414,7 +414,8 @@ typedef enum domain_enum_tag
LABEL_DOMAIN,
- /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN. */
+ /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN.
+ They also always use LOC_COMMON_BLOCK. */
COMMON_BLOCK_DOMAIN
} domain_enum;
@@ -533,6 +534,10 @@ enum address_class
/* The variable's address is computed by a set of location
functions (see "struct symbol_computed_ops" below). */
LOC_COMPUTED,
+
+ /* The variable uses general_symbol_info->value->common_block field.
+ It also always uses COMMON_BLOCK_DOMAIN. */
+ LOC_COMMON_BLOCK,
};
/* The methods needed to implement LOC_COMPUTED. These methods can