public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/5955] New: declaration of global variables with semicolon gives semantic error.
@ 2008-03-18 11:54 srinivasa at in dot ibm dot com
  2008-05-13 10:34 ` [Bug translator/5955] " ananth at in dot ibm dot com
  2008-05-14 12:26 ` fche at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: srinivasa at in dot ibm dot com @ 2008-03-18 11:54 UTC (permalink / raw)
  To: systemtap

Environment: 2.6.24 kernel, systemtap 20080315 snapshot and elfutils-0.130

stap throws up the semantic error messages when global variables are declared
with semicolon.
==========================
[root@llm27lp1 obj]# cat a.stp
        global array;

        probe syscall.open {
                array[pid()]++;
        }
        ...................
        ................


==========================
[root@llm27lp1 obj]# ./stap -vvv a.stp
SystemTap translator/driver (version 0.6.2/0.128 built 2008-03-18)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stapNDhJHA"
parse error: expected 'probe', 'global', 'function', or '%{'
        saw: operator ';' at a.stp:1:14
1 parse error(s).
Searched
'/home/systemtap/tmp/stap_testing_200803181128/install/share/systemtap/tapset/ppc64/*.stp',
found 1
Searched
'/home/systemtap/tmp/stap_testing_200803181128/install/share/systemtap/tapset/*.stp',
found 37
Pass 1: parsed user script and 38 library script(s) in 960usr/10sys/1077real ms.
Pass 1: parse failed.  Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stapNDhJHA
=====================================

As systemtap allows semicolon at the end of statements(eventhough if it is not
required), it should also allow semicolon at the end of global declaration
statement. A C-programmer(kernel developer to be precise) may commit this
mistake frequently.

-- 
           Summary: declaration of global variables with semicolon gives
                    semantic error.
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: srinivasa at in dot ibm dot com


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

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

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

* [Bug translator/5955] declaration of global variables with semicolon gives semantic error.
  2008-03-18 11:54 [Bug translator/5955] New: declaration of global variables with semicolon gives semantic error srinivasa at in dot ibm dot com
@ 2008-05-13 10:34 ` ananth at in dot ibm dot com
  2008-05-14 12:26 ` fche at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: ananth at in dot ibm dot com @ 2008-05-13 10:34 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From ananth at in dot ibm dot com  2008-05-13 06:07 -------
Created an attachment (id=2734)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=2734&action=view)
code fix + doc update

Here are the test results with and without the patch:

Without patch
make installcheck:
		=== systemtap Summary ===

# of expected passes		478
# of unexpected failures	13
# of expected failures		185
# of unknown successes		1
# of known failures		3
# of untested testcases 	20
make[2]: *** [check-DEJAGNU] Error 1
make[2]: Leaving directory `/home/ananth/data/systap/systemtap-12may/testsuite'

make[1]: *** [installcheck-local] Error 2
make[1]: Leaving directory `/home/ananth/data/systap/systemtap-12may/testsuite'

make: *** [installcheck] Error 2


With patch
make installcheck:
		=== systemtap Summary ===

# of expected passes		479
# of unexpected failures	12
# of expected failures		185
# of unknown successes		1
# of known failures		3
# of untested testcases 	20
make[2]: *** [check-DEJAGNU] Error 1
make[2]: Leaving directory
`/home/ananth/data/systap/systemtap-12may/testsuite'
make[1]: *** [installcheck-local] Error 2
make[1]: Leaving directory
`/home/ananth/data/systap/systemtap-12may/testsuite'
make: *** [installcheck] Error 2

Frank,
Is the patch to the NEWS file sufficient documentation update?

Ananth

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Attachment #2732 is|0                           |1
           obsolete|                            |


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

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

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

* [Bug translator/5955] declaration of global variables with semicolon gives semantic error.
  2008-03-18 11:54 [Bug translator/5955] New: declaration of global variables with semicolon gives semantic error srinivasa at in dot ibm dot com
  2008-05-13 10:34 ` [Bug translator/5955] " ananth at in dot ibm dot com
@ 2008-05-14 12:26 ` fche at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fche at redhat dot com @ 2008-05-14 12:26 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2008-05-13 10:34 -------
Looks a new test case should be added to confirm that the new syntax works for
all the declaration cases:

global a;
global c, d;
global e[1], f;
global g=5;
global h="hello world";


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com
         AssignedTo|systemtap at sources dot    |ananth at in dot ibm dot com
                   |redhat dot com              |
             Status|NEW                         |ASSIGNED


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

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

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

end of thread, other threads:[~2008-05-13 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-18 11:54 [Bug translator/5955] New: declaration of global variables with semicolon gives semantic error srinivasa at in dot ibm dot com
2008-05-13 10:34 ` [Bug translator/5955] " ananth at in dot ibm dot com
2008-05-14 12:26 ` fche 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).