Hi all,
Hi Bill.
Iâve been looking at the linenumbers element in struct program as a means of getting offsets for a given line number. Since a program can be made up of multiple files through includes, I need to make sure that when I look through the entries, that Iâm only comparing line numbers that come from the file Iâm interested in. The initial file marker entry appears correctly, however, when the file changes, a new marker entry doesnât seem to be inserted in the array. I see that the line numbers jump correctly, but there is no other indication that the source of the lines has changed.
Is this intentional, or am I missing something?
Hereâs an example tracing through a program with a file included within a function definition.
[...]
Hard to say; can you provide a hex dump of the line number table?
A trivial test case gives that #line directives seem to work in both Pike 8.0 and 8.1:
| Pike v8.0 release 702 running Hilfe v3.5 (Incremental Pike Frontend) | > program p = compile_string("#line 17 "foo"\nint foo(){\n error("Bang!\n");\n}\n", "bar"); | > object o = p(); | > o->foo(); | Bang! | foo:18: bar()->foo()
| Pike v8.1 release 13 running Hilfe v3.5 (Incremental Pike Frontend) | > program p = compile_string("#line 17 "foo"\nint foo(){\n error("Bang!\n");\n}\n", "bar"); | > object o = p(); | > o->foo(); | Bang! | foo:18: bar()->foo()
What version of Pike are you using?
Is the output from the cpp()-pass correct? Maybe I broke cpp() during the Pike 8.1 cpp-rewrite.
/grubba