This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug bpf/24953] foreach (v = v1,v2) syntax not behaving correctly in stapbpf
- From: "me at serhei dot io" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Tue, 03 Sep 2019 14:06:45 +0000
- Subject: [Bug bpf/24953] foreach (v = v1,v2) syntax not behaving correctly in stapbpf
- Auto-submitted: auto-generated
- References: <bug-24953-6586@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=24953
Serhei Makarov <me at serhei dot io> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |me at serhei dot io
Summary|foreach statement not |foreach (v = v1,v2) syntax
|retrieving correct array |not behaving correctly in
|values in stapbpf |stapbpf
--- Comment #3 from Serhei Makarov <me at serhei dot io> ---
Returning the keys (not the values) is expected behaviour for a simple foreach
statement.
https://sourceware.org/systemtap/langref/6_Statement_types.html#SECTION00076000000000000000
> The foreach statement loops over each element of a named global array, assigning the current key to VAR.
So that doesn't need to be changed.
The current foreach (v = v1, v2 in arr) behaviour in stapbpf is not correct,
however.
If you look at foreach_loop in staptree.h
https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=blob;f=staptree.h;h=27358085596b8e2bf2c6aa41785ffb067327a9c4;hb=HEAD#l758
there should be fields which specify where to store the value, and which are
ignored in bpf-translate.cxx.
--
You are receiving this mail because:
You are the assignee for the bug.