Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,5 @@
LEVEL = ../../../make
C_SOURCES := main.c
include $(LEVEL)/Makefile.rules

View File

@ -0,0 +1,30 @@
"""
Test the output of `frame diagnose` for an array access
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestArray(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_array(self):
TestBase.setUp(self)
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
substrs=['stopped'])
self.expect(
"frame diagnose",
"Crash diagnosis was accurate",
substrs=["a[10]"])

View File

@ -0,0 +1,9 @@
struct Foo {
int b;
int c;
};
int main() {
struct Foo *a = 0;
return a[10].c;
}

View File

@ -0,0 +1,5 @@
LEVEL = ../../../make
CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules

View File

@ -0,0 +1,27 @@
"""
Test the output of `frame diagnose` for dereferencing a bad reference
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestBadReference(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_bad_reference(self):
TestBase.setUp(self)
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
substrs=['stopped'])
self.expect("frame diagnose", "Crash diagnosis was accurate", "f->b")

View File

@ -0,0 +1,22 @@
struct Bar {
int c;
int d;
};
struct Foo {
int a;
struct Bar &b;
};
struct Foo *GetAFoo() {
static struct Foo f = { 0, *((Bar*)0) };
return &f;
}
int GetSum(struct Foo *f) {
return f->a + f->b.d;
}
int main() {
return GetSum(GetAFoo());
}

View File

@ -0,0 +1,5 @@
LEVEL = ../../../make
C_SOURCES := main.c
include $(LEVEL)/Makefile.rules

View File

@ -0,0 +1,30 @@
"""
Test the output of `frame diagnose` for a subexpression of a complicated expression
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDiagnoseDereferenceArgument(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_dereference_argument(self):
TestBase.setUp(self)
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
substrs=['stopped'])
self.expect(
"frame diagnose",
"Crash diagnosis was accurate",
"f->b->d")

View File

@ -0,0 +1,26 @@
struct Bar {
int c;
int d;
};
struct Foo {
int a;
struct Bar *b;
};
struct Foo *GetAFoo() {
static struct Foo f = { 0, 0 };
return &f;
}
int SumTwoIntegers(int x, int y) {
return x + y;
}
int GetSum(struct Foo *f) {
return SumTwoIntegers(f->a, f->b->d ? 0 : 1);
}
int main() {
return GetSum(GetAFoo());
}

View File

@ -0,0 +1,5 @@
LEVEL = ../../../make
C_SOURCES := main.c
include $(LEVEL)/Makefile.rules

View File

@ -0,0 +1,30 @@
"""
Test the output of `frame diagnose` for dereferencing a function argument
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDiagnoseDereferenceArgument(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_dereference_argument(self):
TestBase.setUp(self)
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
substrs=['stopped'])
self.expect(
"frame diagnose",
"Crash diagnosis was accurate",
"f->b->d")

View File

@ -0,0 +1,22 @@
struct Bar {
int c;
int d;
};
struct Foo {
int a;
struct Bar *b;
};
struct Foo *GetAFoo() {
static struct Foo f = { 0, 0 };
return &f;
}
int GetSum(struct Foo *f) {
return f->a + f->b->d;
}
int main() {
return GetSum(GetAFoo());
}

View File

@ -0,0 +1,5 @@
LEVEL = ../../../make
CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules

View File

@ -0,0 +1,33 @@
"""
Test the output of `frame diagnose` for dereferencing a function's return value
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDiagnoseDereferenceFunctionReturn(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
@expectedFailureAll(oslist=['macosx'], archs=['i386'], bugnumber="rdar://28656408")
def test_diagnose_dereference_function_return(self):
TestBase.setUp(self)
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
substrs=['stopped'])
self.expect(
"frame diagnose",
"Crash diagnosis was accurate",
substrs=[
"GetAFoo",
"->b"])

View File

@ -0,0 +1,12 @@
struct Foo {
int a;
int b;
};
struct Foo *GetAFoo() {
return 0;
}
int main() {
return GetAFoo()->b;
}

View File

@ -0,0 +1,5 @@
LEVEL = ../../../make
CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules

View File

@ -0,0 +1,30 @@
"""
Test the output of `frame diagnose` for dereferencing `this`
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDiagnoseDereferenceThis(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_dereference_this(self):
TestBase.setUp(self)
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
substrs=['stopped'])
self.expect(
"frame diagnose",
"Crash diagnosis was accurate",
"this->a")

View File

@ -0,0 +1,15 @@
struct Foo {
int a;
int b;
int Sum() { return a + b; }
};
struct Foo *GetAFoo() {
return (struct Foo*)0;
}
int main() {
struct Foo *foo = GetAFoo();
return foo->Sum();
}

View File

@ -0,0 +1,5 @@
LEVEL = ../../../make
CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules

View File

@ -0,0 +1,27 @@
"""
Test the output of `frame diagnose` for calling virtual methods
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDiagnoseInheritance(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_diagnose_inheritance(self):
TestBase.setUp(self)
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
substrs=['stopped'])
self.expect("frame diagnose", "Crash diagnosis was accurate", "d")

Some files were not shown because too many files have changed in this diff Show More