Created attachment 319754 [details] see-array.f90 Description of problem: the new GDB 6.8 slated for 5.3 doesn't seem to be able to find variables in modules even when used with the new 4.3 compiler. Looking at the dwarf information it looks like it should be there and it should be able to find the variable. <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_producer : (indirect string, offset: 0x19): GNU F95 4.3.2 20080917 (Red Hat 4.3.2-6) DW_AT_language : 14 (Fortran 95) DW_AT_name : (indirect string, offset: 0x42): see-array.f90 DW_AT_comp_dir : (indirect string, offset: 0x60): /tmp DW_AT_low_pc : 0x80485b4 DW_AT_high_pc : 0x80486c1 DW_AT_stmt_list : 0 <1><25>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_byte_size : 4 DW_AT_encoding : 5 (signed) DW_AT_name : (indirect string, offset: 0x50): integer(kind=4) <1><2c>: Abbrev Number: 3 (DW_TAG_subprogram) DW_AT_external : 1 DW_AT_name : (indirect string, offset: 0x6a): test_pass DW_AT_decl_file : 1 DW_AT_decl_line : 5 DW_AT_low_pc : 0x80485b4 DW_AT_high_pc : 0x80486c1 DW_AT_frame_base : 0 (location list) DW_AT_calling_convention: 2 (program) DW_AT_sibling : <64> <2><45>: Abbrev Number: 4 (DW_TAG_lexical_block) DW_AT_low_pc : 0x80485f9 DW_AT_high_pc : 0x80486bf DW_AT_sibling : <5c> <3><52>: Abbrev Number: 5 (DW_TAG_lexical_block) DW_AT_low_pc : 0x804864d DW_AT_high_pc : 0x80486b1 <2><5c>: Abbrev Number: 6 (DW_TAG_imported_declaration) DW_AT_decl_file : 1 DW_AT_decl_line : 6 DW_AT_import : <6f> <1><64>: Abbrev Number: 7 (DW_TAG_module) DW_AT_name : (indirect string, offset: 0x0): module_test DW_AT_decl_file : 1 DW_AT_decl_line : 1 DW_AT_sibling : <88> <2><6f>: Abbrev Number: 8 (DW_TAG_variable) DW_AT_name : (indirect string, offset: 0x65): yzap DW_AT_decl_file : 1 DW_AT_decl_line : 2 DW_AT_type : <88> DW_AT_external : 1 DW_AT_declaration : 1 <2><7c>: Abbrev Number: 9 (DW_TAG_variable) DW_AT_specification: <6f> DW_AT_location : 5 byte block: 3 b0 99 4 8 (DW_OP_addr: 80499b0) <1><88>: Abbrev Number: 10 (DW_TAG_array_type) DW_AT_ordering : 1 (column major) DW_AT_type : <9f> DW_AT_sibling : <9f> <2><92>: Abbrev Number: 11 (DW_TAG_subrange_type) DW_AT_type : <25> DW_AT_upper_bound : 2 <2><98>: Abbrev Number: 11 (DW_TAG_subrange_type) DW_AT_type : <25> DW_AT_upper_bound : 2 <1><9f>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_byte_size : 4 DW_AT_encoding : 4 (float) DW_AT_name : (indirect string, offset: 0xc): real(kind=4) The way that I read that is that <2c> starts the program and that begins a lexical block <45>. Then we start a new lexical block <52> which contains an imported declaration <5c> that has the module declaration <64>. That module contains the variable yzap <6f> which can be found at the location specified in <7c>. So why can't gdb find it? Version-Release number of selected component (if applicable): gdb 6.8 How reproducible: gfortran43 -g -o see-array see-array.f90 -lm Steps to Reproduce: 1. gfortran43 -g -o see-array see-array.f90 -lm 2. gdb see-array 3. Actual results: Expected results: You should be able access variables within modules Additional info: This looks like the problem described in http://gcc.gnu.org/wiki/GfortranFAQ "# Name mangling: It seems not all names are accessible in gdb. Examples are local variables, say i, which show up as innn when tab-expanding i, but if you enter p innn, an error message is generated. # Module name mangling: Subroutine Mysub in module Mymod has the name __mymod__mysub. Same is valid for functions and globals. Note the double underscores and all lower caps. # arrays passed to routines with an interface, either explicit or via use and allocatable arrays are hard to examine, because what you see in gdb is the array descriptor. "
*** Bug 465704 has been marked as a duplicate of this bug. ***
*** Bug 497567 has been marked as a duplicate of this bug. ***
gdb-6.8.50.20090302-22.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/gdb-6.8.50.20090302-22.fc11
gdb-6.8.50.20090302-23.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/gdb-6.8.50.20090302-23.fc11
gdb-6.8.50.20090302-22.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
gdb-6.8.50.20090302-23.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
~~ Attention - RHEL 5.4 Beta Released! ~~ RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner! If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity. Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value. Questions can be posted to this bug or your customer or partner representative.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1361.html