This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
breakpoints/938: GDB is not able to set breakpoint to entry point (Fortran)
- From: sana at stl dot sarov dot ru
- To: gdb-gnats at sources dot redhat dot com
- Cc: miwako dot tokugawa at intel dot com
- Date: 16 Jan 2003 11:37:47 -0000
- Subject: breakpoints/938: GDB is not able to set breakpoint to entry point (Fortran)
- Reply-to: sana at stl dot sarov dot ru
>Number: 938
>Category: breakpoints
>Synopsis: GDB is not able to set breakpoint to entry point (Fortran)
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 16 03:38:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: sana@stl.sarov.ru
>Release: unknown-1.0
>Organization:
>Environment:
32-bit && 64-bit Linux
>Description:
GBD is not able to set breakpoint to entry point in fortran subroutine at all.
IDB sets such breakpoints correctly.
Example of test debug session for GDB:
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b wkprnt
Function "wkprnt" not defined.
(gdb)
Example of test debug session for IDB:
Reading symbolic information ...done
(idb) stop wkprnt
[#1: stop in subroutine wkprnt(integer*4) ]
(idb) r
On entry, wksize = 10
[1] stopped at [subroutine wkinit(integer*4):21 0x8049617]
21 print *, 'On entry, jpr = ',jpr
(idb)
Dump of debug information for Intel compiler is attached also.
>How-To-Repeat:
Test is attached or below.
implicit none
call wkinit(10)
call wkprnt(5)
end
subroutine wkinit(wksize)
implicit none
integer wksize^M, nsize
integer jpr
integer jprint
save jpr
jpr = wksize
print *, 'On entry, wksize = ',wksize
nsize = wksize
return
entry wkprnt(jprint)
print *, 'On entry, jpr = ',jpr
print *, 'On entry, jprint = ',jpr^Mint
if (jprint.eq.2) then
jpr = 1-jpr
else
jpr = jprint
endif
print *, 'jpr = ',jpr
return
end
Intel compiler should be used.
Command line is 'ifc -g test.f'.
If executable file is built by GCC then debugger's behaviour is the same.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="test.w"
Content-Disposition: inline; filename="test.w"
The section .debug_info contains:
Compilation Unit @ 0:
Length: 293
Version: 2
Abbrev Offset: 0
Pointer Size: 4
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_comp_dir : /home1/sana/trackers/GDB/tr31011
DW_AT_language : 8 (Fortran 90)
DW_AT_name : test.f
DW_AT_producer : EPC Fortran-95 Version F95 Intel:200200:131124
DW_AT_stmt_list : 0
<1><68>: Abbrev Number: 2 (DW_TAG_base_type)
DW_AT_byte_size : 0
DW_AT_encoding : 5 (signed)
DW_AT_name : void
<1><70>: Abbrev Number: 3 (DW_TAG_subprogram)
DW_AT_decl_line : 1
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_sibling : <94>
DW_AT_accessibility: 1 (public)
DW_AT_name : main.program
DW_AT_type : <68>
DW_AT_prototyped : 0
DW_AT_high_pc : 0x80495a6 134518182
DW_AT_low_pc : 0x8049548 134518088
DW_AT_external : 1
<1><94>: Abbrev Number: 4 (DW_TAG_subprogram)
DW_AT_decl_line : 6
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_sibling : <11a>
DW_AT_accessibility: 1 (public)
DW_AT_name : wkinit
DW_AT_type : <68>
DW_AT_prototyped : 0
DW_AT_high_pc : 0x80497ea 134518762
DW_AT_low_pc : 0x80495a6 134518182
DW_AT_external : 1
<2><b2>: Abbrev Number: 5 (DW_TAG_formal_parameter)
DW_AT_decl_line : 31
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_type : <11a>
DW_AT_variable_parameter: 1
DW_AT_name : wksize
DW_AT_location : 3 byte block: 75 74 6 (DW_OP_breg5: -12DW_OP_deref)
<2><c6>: Abbrev Number: 6 (DW_TAG_entry_point)
DW_AT_decl_line : 20
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_sibling : <f2>
DW_AT_name : wkprnt
DW_AT_type : <68>
DW_AT_low_pc : 0x8049645 134518341
<3><dd>: Abbrev Number: 5 (DW_TAG_formal_parameter)
DW_AT_decl_line : 31
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_type : <11a>
DW_AT_variable_parameter: 1
DW_AT_name : jprint
DW_AT_location : 3 byte block: 75 7c 6 (DW_OP_breg5: -4DW_OP_deref)
<2><f2>: Abbrev Number: 7 (DW_TAG_variable)
DW_AT_decl_line : 31
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_accessibility: 1 (public)
DW_AT_name : jpr
DW_AT_type : <11a>
DW_AT_location : 5 byte block: 3 80 4 8 8 (DW_OP_addr: 8080480)
DW_AT_external : 0
<2><106>: Abbrev Number: 7 (DW_TAG_variable)
DW_AT_decl_line : 31
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_accessibility: 1 (public)
DW_AT_name : nsize
DW_AT_type : <11a>
DW_AT_location : 2 byte block: 75 78 (DW_OP_breg5: -8)
DW_AT_external : 0
<1><11a>: Abbrev Number: 2 (DW_TAG_base_type)
DW_AT_byte_size : 4
DW_AT_encoding : 5 (signed)
DW_AT_name : integer
Contents of the .debug_abbrev section:
Number TAG
1 DW_TAG_compile_unit [has children]
DW_AT_comp_dir DW_FORM_string
DW_AT_language DW_FORM_data1
DW_AT_name DW_FORM_string
DW_AT_producer DW_FORM_string
DW_AT_stmt_list DW_FORM_data4
2 DW_TAG_base_type [no children]
DW_AT_byte_size DW_FORM_data1
DW_AT_encoding DW_FORM_data1
DW_AT_name DW_FORM_string
3 DW_TAG_subprogram [no children]
DW_AT_decl_line DW_FORM_data1
DW_AT_decl_column DW_FORM_data1
DW_AT_decl_file DW_FORM_data1
DW_AT_sibling DW_FORM_ref4
DW_AT_accessibility DW_FORM_data1
DW_AT_name DW_FORM_string
DW_AT_type DW_FORM_ref4
DW_AT_prototyped DW_FORM_flag
DW_AT_high_pc DW_FORM_addr
DW_AT_low_pc DW_FORM_addr
DW_AT_external DW_FORM_flag
4 DW_TAG_subprogram [has children]
DW_AT_decl_line DW_FORM_data1
DW_AT_decl_column DW_FORM_data1
DW_AT_decl_file DW_FORM_data1
DW_AT_sibling DW_FORM_ref4
DW_AT_accessibility DW_FORM_data1
DW_AT_name DW_FORM_string
DW_AT_type DW_FORM_ref4
DW_AT_prototyped DW_FORM_flag
DW_AT_high_pc DW_FORM_addr
DW_AT_low_pc DW_FORM_addr
DW_AT_external DW_FORM_flag
5 DW_TAG_formal_parameter [no children]
DW_AT_decl_line DW_FORM_data1
DW_AT_decl_column DW_FORM_data1
DW_AT_decl_file DW_FORM_data1
DW_AT_type DW_FORM_ref4
DW_AT_variable_parameter DW_FORM_flag
DW_AT_name DW_FORM_string
DW_AT_location DW_FORM_block1
6 DW_TAG_entry_point [has children]
DW_AT_decl_line DW_FORM_data1
DW_AT_decl_column DW_FORM_data1
DW_AT_decl_file DW_FORM_data1
DW_AT_sibling DW_FORM_ref4
DW_AT_name DW_FORM_string
DW_AT_type DW_FORM_ref4
DW_AT_low_pc DW_FORM_addr
7 DW_TAG_variable [no children]
DW_AT_decl_line DW_FORM_data1
DW_AT_decl_column DW_FORM_data1
DW_AT_decl_file DW_FORM_data1
DW_AT_accessibility DW_FORM_data1
DW_AT_name DW_FORM_string
DW_AT_type DW_FORM_ref4
DW_AT_location DW_FORM_block1
DW_AT_external DW_FORM_flag
Dump of debug contents of section .debug_line:
Length: 94
DWARF Version: 2
Prologue Length: 31
Minimum Instruction Length: 1
Initial value of 'is_stmt': 0
Line Base: -1
Line Range: 4
Opcode Base: 10
Opcodes:
Opcode 1 has 0 args
Opcode 2 has 1 args
Opcode 3 has 1 args
Opcode 4 has 1 args
Opcode 5 has 1 args
Opcode 6 has 0 args
Opcode 7 has 0 args
Opcode 8 has 0 args
Opcode 9 has 1 args
The Directory Table is empty.
The File Name Table:
Entry Dir Time Size Name
1 0 1042716590 596 test.f
Line Number Statements:
Extended opcode 2: set Address to 0x8049548
Copy
Special opcode 146: advance Address by 36 to 0x804956c and Line by 1 to 2
Special opcode 58: advance Address by 14 to 0x804957a and Line by 1 to 3
Special opcode 58: advance Address by 14 to 0x8049588 and Line by 1 to 4
Special opcode 123: advance Address by 30 to 0x80495a6 and Line by 2 to 6
Advance PC by 12 to 80495b2
Advance Line by 7 to 13
Copy
Special opcode 43: advance Address by 10 to 0x80495bc and Line by 2 to 15
Advance PC by 124 to 8049638
Advance Line by 2 to 17
Copy
Advance PC by 13 to 8049645
Advance Line by 3 to 20
Copy
Special opcode 50: advance Address by 12 to 0x8049651 and Line by 1 to 21
Advance PC by 124 to 80496cd
Advance Line by 1 to 22
Copy
Advance PC by 124 to 8049749
Advance Line by 1 to 23
Copy
Special opcode 42: advance Address by 10 to 0x8049753 and Line by 1 to 24
Special opcode 63: advance Address by 15 to 0x8049762 and Line by 2 to 26
Special opcode 43: advance Address by 10 to 0x804976c and Line by 2 to 28
Advance PC by 124 to 80497e8
Advance Line by 3 to 31
Copy
Extended opcode 2: set Address to 0x80497ea
Extended opcode 1: End of Sequence