Hi Grubba…
I’m using 8.1 freshly compiled from master. The results of cpp() look good, but when I throw an error the file name is incorrect (it shows the line number of the included file, but the filename of the file that contains the #include directive.)
Example (note the file inclusion within whee()):
Pike v8.1 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
cpp(Stdio.read_file("./bpt.pike"), "./bpt.pike");
(1) Result: "#line 1 "./bpt.pike"\n" "object debugger;\n" "int main () {\n" " \n" " program p = this_program;\n" " add_breakpoint(p, 22);\n" "\n" " \n" " call_out(doit, 5);\n" " return -1;\n" "}\n" "\n" "void doit() {\n" " \n" " mixed res = whee("rad");\n" " werror("***\n*** result: %O\n***\n", res);\n" "}\n" "\n" "int whee(string w) {\n" " werror("foo\n");\n" "#line 1 "/Users/hww3/bpt.h"\n" "int x = 0;\n" "error("gee!\n");\n" "\n" "#line 20 "./bpt.pike"\n" "\n" " string q = "wq";\n" " q+="21";\n" " q+="22";\n" "werror("bar " + w + "\n");\n" " return 27;\n" "}\n"
compile_file("./bpt.pike");
(2) Result: bpt.pike
compile_file("./bpt.pike")()->whee("");
foo gee! ./bpt.pike:2: bpt.pike()->whee(“")
Here’s what line numbers look like:
(lldb) p prog->num_linenumbers (size_t) $0 = 66 (lldb) parray/x 66 prog->linenumbers (char *) $1 = 0x0000000101e351d0 "\x7f" { (char) [0] = 0x7f (char) [1] = 0x00 (char) [2] = 0x00 (char) [3] = 0x00 (char) [4] = 0x24 (char) [5] = 0x02 (char) [6] = 0x81 (char) [7] = 0x00 (char) [8] = 0xa9 (char) [9] = 0x02 (char) [10] = 0x36 (char) [11] = 0x01 (char) [12] = 0x81 (char) [13] = 0x00 (char) [14] = 0xa8 (char) [15] = 0x03 (char) [16] = 0x81 (char) [17] = 0x00 (char) [18] = 0x93 (char) [19] = 0x01 (char) [20] = 0x22 (char) [21] = 0x01 (char) [22] = 0x74 (char) [23] = 0x02 (char) [24] = 0x81 (char) [25] = 0x00 (char) [26] = 0xa9 (char) [27] = 0x02 (char) [28] = 0x45 (char) [29] = 0x01 (char) [30] = 0x81 (char) [31] = 0x00 (char) [32] = 0xa5 (char) [33] = 0x01 (char) [34] = 0x81 (char) [35] = 0x00 (char) [36] = 0xc5 (char) [37] = 0x02 (char) [38] = 0x81 (char) [39] = 0x00 (char) [40] = 0xd3 (char) [41] = 0x01 (char) [42] = 0x4c (char) [43] = 0xee (char) [44] = 0x72 (char) [45] = 0x01 (char) [46] = 0x50 (char) [47] = 0x13 (char) [48] = 0x81 (char) [49] = 0x00 (char) [50] = 0x99 (char) [51] = 0x01 (char) [52] = 0x81 (char) [53] = 0x00 (char) [54] = 0x88 (char) [55] = 0x01 (char) [56] = 0x81 (char) [57] = 0x00 (char) [58] = 0x8f (char) [59] = 0x01 (char) [60] = 0x81 (char) [61] = 0x00 (char) [62] = 0xab (char) [63] = 0x01 (char) [64] = 0x29 (char) [65] = 0x01 }