r198461 - Debug info: Ensure that the last stop point in a function is still within

Adrian Prantl aprantl at apple.com
Fri Jan 3 15:58:02 PST 2014

On Jan 3, 2014, at 15:53, Eric Christopher <echristo at gmail.com> wrote:

> There's not enough information in the commit message, the comments, or the test cases to know what's broken or fixed here. Why is forcing the block the correct solution here? What is it working around?

Let’s use this as an example:

> ==============================================================================
> --- cfe/trunk/test/CodeGenObjC/arc-linetable.m (original)
> +++ cfe/trunk/test/CodeGenObjC/arc-linetable.m Fri Jan  3 17:34:30 2014

- (int)testNoSideEffect:(NSString *)foo {
  int x = 1;
  return 1; // Return expression

Before this fix, a user would set a breakpoint at the return expression and then attempt to print x and it would fail, because the instruction that is at that line would be in the DW_TAG_subprogram lexical scope (instead of the lexical scope of the function body compound statement which contains x).

Since the compound statement is ended before we emit the cleanups and return block those instructions end up in the wrong scope.

-- adrian

More information about the cfe-commits mailing list