[cfe-dev] Line info for call expressions

Adrian Prantl aprantl at apple.com
Thu Mar 12 11:51:45 PDT 2015


Currently the following example:

1 {
2   foo(
3     bar(),
4     baz());
5 }

will get codegen’d into something like (in pseudo-IR):

%arg0 = call @bar, !dbg (line: 3)
%arg1 = call @baz, !dbg (line: 4)
call @foo(%arg0, %arg1), !dbg(line: 2)

which leads to a weird debugging experience. When developers set a breakpoint at line 2, they don’t generally expect line 3 and 4 to already have executed. It sounds like a solution would be to associate call expressions with the location of the closing parenthesis instead, so the breakpoint could fall through to line 3 and single-stepping behaves as expected.

The downside would be that this might break some existing debuggers’ stepping expectations.

What do you think?

-- adrian



More information about the cfe-dev mailing list