This revision was automatically updated to reflect the committed changes. Closed by commit rLLDB355525: Adding test to cover the correct import of SourceLocation pertaining to a built… (authored by shafik, committed by ). Herald added a project: LLDB.
Repository: rLLDB LLDB CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58790/new/ https://reviews.llvm.org/D58790 Files: packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/Makefile packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/TestImportBuiltinFileID.py packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/main.m Index: packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/main.m =================================================================== --- packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/main.m +++ packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/main.m @@ -0,0 +1,6 @@ +#import <Cocoa/Cocoa.h> + +int main(int argc, const char * argv[]) { + + return 0; // break here +} Index: packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/Makefile =================================================================== --- packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/Makefile +++ packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../make + +OBJC_SOURCES := main.m + +include $(LEVEL)/Makefile.rules +LDFLAGS += -framework Cocoa Index: packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/TestImportBuiltinFileID.py =================================================================== --- packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/TestImportBuiltinFileID.py +++ packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/TestImportBuiltinFileID.py @@ -0,0 +1,27 @@ +""" +They may be cases where an expression will import SourceLocation and if the +SourceLocation ends up with a FileID that is a built-in we need to copy that +buffer over correctly. +""" + + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class TestImportBuiltinFileID(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessDarwin + @skipIfDarwinEmbedded + @add_test_categories(["gmodules"]) + def test_import_builtin_fileid(self): + self.build() + + lldbutil.run_to_source_breakpoint(self, '// break here', + lldb.SBFileSpec("main.m", False)) + + self.expect("expr int (*DBG_CGImageGetRenderingIntent)(void *) = ((int (*)(void *))CGImageGetRenderingIntent); DBG_CGImageGetRenderingIntent((void *)0x00000000000000);", + substrs=['$0 = 0'])
Index: packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/main.m =================================================================== --- packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/main.m +++ packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/main.m @@ -0,0 +1,6 @@ +#import <Cocoa/Cocoa.h> + +int main(int argc, const char * argv[]) { + + return 0; // break here +} Index: packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/Makefile =================================================================== --- packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/Makefile +++ packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../make + +OBJC_SOURCES := main.m + +include $(LEVEL)/Makefile.rules +LDFLAGS += -framework Cocoa Index: packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/TestImportBuiltinFileID.py =================================================================== --- packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/TestImportBuiltinFileID.py +++ packages/Python/lldbsuite/test/expression_command/import_builtin_fileid/TestImportBuiltinFileID.py @@ -0,0 +1,27 @@ +""" +They may be cases where an expression will import SourceLocation and if the +SourceLocation ends up with a FileID that is a built-in we need to copy that +buffer over correctly. +""" + + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class TestImportBuiltinFileID(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessDarwin + @skipIfDarwinEmbedded + @add_test_categories(["gmodules"]) + def test_import_builtin_fileid(self): + self.build() + + lldbutil.run_to_source_breakpoint(self, '// break here', + lldb.SBFileSpec("main.m", False)) + + self.expect("expr int (*DBG_CGImageGetRenderingIntent)(void *) = ((int (*)(void *))CGImageGetRenderingIntent); DBG_CGImageGetRenderingIntent((void *)0x00000000000000);", + substrs=['$0 = 0'])
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits