2012-09-26 Jan Kratochvil <jan.kratochvil@redhat.com>

Tom Tromey  <tromey@redhat.com>
	* dwarf2read.c (read_common_block): Rewrite.
	(new_symbol_full): Handle DW_TAG_common_block.
	* f-lang.c (head_common_list, find_common_for_function):
	Remove.
	* f-lang.h (struct common_entry, struct saved_f77_common,
	SAVED_F77_COMMON, SAVED_F77_COMMON_PTR, COMMON_ENTRY,
	COMMON_ENTRY_PTR, head_common_list, find_common_for_function,
	BLANK_COMMON_NAME_LOCAL): Remove.
	(struct common_block): New.
	* f-valprint.c (list_all_visible_commons): Remove.
	(info_common_command_for_block): New function.
	(info_common_command): Use it.
	* stack.c (iterate_over_block_locals): Special case for
	COMMON_BLOCK_DOMAIN.
	* symtab.h (enum domain_enum_tag) <COMMON_BLOCK_DOMAIN>: New
	constant.
	(struct general_symbol_info) <value.common_block>: New field.
	(SYMBOL_VALUE_COMMON_BLOCK): New define.
gdb/testsuite
2012-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
	* gdb.fortran/common-block.exp: New file.
	* gdb.fortran/common-block.f90: New file.
This commit is contained in:
Tom Tromey 2012-09-26 19:38:32 +00:00
parent 965f07a88d
commit 4357ac6c6f
10 changed files with 327 additions and 175 deletions

View file

@ -349,27 +349,3 @@ _initialize_f_language (void)
add_language (&f_language_defn);
}
SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON */
/* This routine finds the first encountred COMMON block named "name"
that belongs to function funcname. */
SAVED_F77_COMMON_PTR
find_common_for_function (const char *name, const char *funcname)
{
SAVED_F77_COMMON_PTR tmp;
tmp = head_common_list;
while (tmp != NULL)
{
if (strcmp (tmp->name, name) == 0
&& strcmp (tmp->owning_function, funcname) == 0)
return (tmp);
else
tmp = tmp->next;
}
return (NULL);
}