This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap 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]

[Bug tapsets/10475] New: pointer-array confused about array element size


When the referenced type of a pointer is an indirect modifier (const, volatile,
etc.), loc2c fails to determine the byte size of the elements when you try to
use the pointer like an array.  For example, the kernel function do_filp_open
has a parameter "const char *pathname":

$ stap -p2 -ve 'probe kernel.function("do_filp_open"){ println($pathname[0]) }'
Pass 1: parsed user script and 58 library script(s) in 230usr/20sys/251real ms.
semantic error: confused about array element size: identifier '$pathname' at
<input>:1:48
        source: probe kernel.function("do_filp_open"){ println($pathname[0]) }
                                                               ^
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s) in
430usr/30sys/474real ms.
Pass 2: analysis failed.  Try again with another '--vp 01' option.

I believe this is because array_stride() is getting a DW_TAG_const_type die,
which doesn't directly have a byte size.  We need iterate down to the real type
which has a defined byte size.

-- 
           Summary: pointer-array confused about array element size
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: jistone at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10475

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


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