Xcode - Breakpoints don't work with incremental LTO

Originator:macmade
Number:rdar://29208438 Date Originated:11-Nov-2016 00:13 AM
Status:Duplicate Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
## Description

When using incremental link-time optimisation in Xcode, breakpoints won’t trigger…

The program will execute as if no breakpoints were set.

This only happen when LTO is set to incremental.
Targets without LTO or with the old monolithic LTO are not affected.

This is always reproductible, no matter which language is used.

## Steps to reproduce

Attached is an example Xcode project which demonstrates the issue.

It only consist of a `main.m` file, with a “hello, world”.

Try putting a breakpoint somewhere in the `main` function.

Now there’re two schemes you need to test:

	LTO - With link-time optimisation.
	Breakpoint won’t trigger.
	
	NO-LTO - Without link-time optimisation.
	Breakpoint will be hit as expected.

## Expected Results

The breakpoint should be hit with both schemes.

## Actual Results

Breakpoint is not hit when using the scheme with incremental LTO.

## Configuration

The issue always occurs when using incremental LTO.

## Xcode Version/Build & OS X Version/Build

macOS Sierra 10.12.2 Beta (16C41B)
Xcode version 8.1 (8B62)

Note that the issue is also reproductible with Xcode version 8.2 beta (8C23)

Comments

Duplicate of 28529594 (Closed)

Attached project

https://github.com/macmade/rdar-29208438


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!