This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

breakpoints/941: GDB is not able to perform operation DW_OP_deref for address.


>Number:         941
>Category:       breakpoints
>Synopsis:       GDB is not able to perform operation DW_OP_deref for address.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 16 22:48:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     sana@stl.sarov.ru
>Release:        unknown-1.0
>Organization:
>Environment:
32-bit && 64-bit Linux
>Description:
Debugger does not perform correctly operation DW_OP_deref if operand is determined by operation DW_OP_addr.
LDB works correctly in this case.

In attached regression test variable wksize has the following location expression:

 <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     : <123>  
     DW_AT_accessibility: 1     (public)
     DW_AT_name        : wkinit 
     DW_AT_type        : <68>   
     DW_AT_prototyped  : 0      
     DW_AT_high_pc     : 0x80497f6 134518774    
     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        : <123>  
     DW_AT_variable_parameter: 1        
     DW_AT_name        : wksize 
     DW_AT_location    : 6 byte block: 3 a0 4 8 8 6     (DW_OP_addr: 80804a0; DW_OP_deref; )

Example of debug session for GDB:

This GDB was configured as "i386-redhat-linux"...
(gdb) b wkinit
Breakpoint 1 at 0x80495b1: file test.f, line 13.
(gdb) r
Starting program: /home1/sana/trackers/GDB/tr31013/a.out 

Breakpoint 1, wkinit (wksize=Cannot access memory at address 0xc807fc68
) at test.f:13
13            jpr = wksize
Current language:  auto; currently fortran
(gdb) x /2 80804a0
Invalid number "80804a0".
(gdb) x /2 0x80804a0
0x80804a0 <EPC_GLA36>:  0x08073e14      0x00000000
(gdb) x /2 0x8073e14
0x8073e14 <EPC_GLA24>:  0x0000000a      0x00000000
(gdb) 

We can see that debug information is correct (wksize is DW_OP_addr 0x80804a0 DW_OP_deref)

Example of debug session for LDB:

Linux Application Debugger for 32-bit applications, Version 6.0 Beta, Build 20020114.
Copyright (c) 2001-2002 Intel Corporation. All Rights Reserved.

(ldb) b wkinit
Breakpoint 1 at 0x80495b1: file test.f, line 13.
(ldb) r
Starting program: a.out

Breakpoint 1, wkinit (wksize=10) at test.f:13
13            jpr = wksize
(ldb) p wksize
$1 = 10
(ldb) 
>How-To-Repeat:
Regression 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 -save test.f'.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="test.f"
Content-Disposition: inline; filename="test.f"

      implicit none
      call wkinit(10)
      call wkprnt(5)
      end

      subroutine wkinit(wksize)
      implicit none
      integer wksize
, 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
int
      if (jprint.eq.2) then
        jpr = 1-jpr
      else
        jpr = jprint
      endif
      print *, 'jpr = ',jpr
      return

      end



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]