[PATCH] [WIP] Use dynamic alloca for stack variables in ASan.

Kuba Brecka kuba.brecka at gmail.com
Tue Dec 2 16:38:22 PST 2014


Hi,
I've tried this patch to see if it solves the missing debugging information issues that we're struggling with. I can confirm that most of the "regular" cases (regular local variables) are solved by this patch. However, there's still a few cases that don't work, for example __block variables:

    #import <Foundation/Foundation.h>
    int main(int argc, const char * argv[]) {
        __block int x = 7;
        printf("%d\n", x); // break here, cannot read value of 'x'
        return 0;
    }

... or accessing variables from within a block:

    #import <Foundation/Foundation.h>
    int main(int argc, const char * argv[]) {
        int x = 7;
        ^{
            printf("%d\n", x); // break here, 'x' shows value of 0 instead of 7
        }();
        return 0;
    }

Note that these two are broken in all other proposed solutions as well.

Anyway, I'm glad to see the progress, and we can surely focus on the regular (not blocks related) cases first.

http://reviews.llvm.org/D6465






More information about the llvm-commits mailing list