public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/10475] New: pointer-array confused about array element size
@ 2009-08-03 21:13 jistone at redhat dot com
  2009-08-03 21:13 ` [Bug tapsets/10475] " jistone at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: jistone at redhat dot com @ 2009-08-03 21:13 UTC (permalink / raw)
  To: systemtap

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug tapsets/10475] pointer-array confused about array element size
  2009-08-03 21:13 [Bug tapsets/10475] New: pointer-array confused about array element size jistone at redhat dot com
@ 2009-08-03 21:13 ` jistone at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: jistone at redhat dot com @ 2009-08-03 21:13 UTC (permalink / raw)
  To: systemtap



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|systemtap at sources dot    |jistone at redhat dot com
                   |redhat dot com              |
             Status|NEW                         |ASSIGNED


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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-03 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 21:13 [Bug tapsets/10475] New: pointer-array confused about array element size jistone at redhat dot com
2009-08-03 21:13 ` [Bug tapsets/10475] " jistone at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).