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 bpf/24953] foreach (v = v1,v2) syntax not behaving correctly in stapbpf


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.

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