Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable debugging with LLDB (Xcode, Qt Creator, etc) v2 #785

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ auto add_42_to_subrange(auto& rng, cpp2::in<int> start, cpp2::in<int> end) -> vo
std::cout << i << "\n";
}

#line 10 "mixed-bounds-safety-with-assert-2.cpp2"
auto add_42_to_subrange(auto& rng, cpp2::in<int> start, cpp2::in<int> end) -> void
{
cpp2::Bounds.expects(cpp2::cmp_less_eq(0,start), "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ auto print_subrange(auto const& rng, cpp2::in<int> start, cpp2::in<int> end) ->
print_subrange(std::move(v), 1, 13);
}

#line 9 "mixed-bounds-safety-with-assert.cpp2"
auto print_subrange(auto const& rng, cpp2::in<int> start, cpp2::in<int> end) -> void{
cpp2::Bounds.expects(cpp2::cmp_less_eq(0,start), "");
cpp2::Bounds.expects(cpp2::cmp_less_eq(end,CPP2_UFCS_0(ssize, rng)), "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ auto insert_at(cpp2::in<int> where, cpp2::in<int> val) -> void;

std::vector<int> vec {};

#line 19 "mixed-captures-in-expressions-and-postconditions.cpp2"
auto insert_at(cpp2::in<int> where, cpp2::in<int> val) -> void

#line 22 "mixed-captures-in-expressions-and-postconditions.cpp2"
Expand Down
1 change: 1 addition & 0 deletions regression-tests/test-results/mixed-fixed-type-aliases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ auto test(auto const& x) -> void{
<< "\n";
}

#line 15 "mixed-fixed-type-aliases.cpp2"
[[nodiscard]] auto main(int const argc_, char** argv_) -> int{
auto const args = cpp2::make_args(argc_, argv_);
#line 16 "mixed-fixed-type-aliases.cpp2"
Expand Down
1 change: 1 addition & 0 deletions regression-tests/test-results/mixed-float-literals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ auto literals_cpp2() -> void{
// 1.E-10F;
}

#line 114 "mixed-float-literals.cpp2"
[[nodiscard]] auto main() -> int{
literals_cpp1();
literals_cpp2();
Expand Down
3 changes: 3 additions & 0 deletions regression-tests/test-results/mixed-forwarding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ CPP2_REQUIRES (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>)
#line 11 "mixed-forwarding.cpp2"
auto copy_from([[maybe_unused]] auto param1) -> void{}

#line 13 "mixed-forwarding.cpp2"
auto use([[maybe_unused]] auto const& param1) -> void{}

#line 16 "mixed-forwarding.cpp2"
Expand All @@ -58,6 +59,7 @@ requires (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>)
copy_from(t.first); // copies
copy_from(CPP2_FORWARD(t).second);// moves
}
#line 20 "mixed-forwarding.cpp2"
auto apply_explicit_forward(auto&& t) -> void
requires (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>)
#line 20 "mixed-forwarding.cpp2"
Expand All @@ -66,6 +68,7 @@ requires (std::is_same_v<CPP2_TYPEOF(t), std::pair<X,X>>)
copy_from(CPP2_FORWARD(t).second);// moves
}

#line 25 "mixed-forwarding.cpp2"
[[nodiscard]] auto main() -> int{
std::pair<X,X> t1 {1, 2};
apply_implicit_forward(t1);
Expand Down
1 change: 1 addition & 0 deletions regression-tests/test-results/mixed-hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ auto main() -> int {
return s;
}

#line 11 "mixed-hello.cpp2"
auto decorate(std::string& s) -> void{
s = "[" + s + "]";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ bool flip_a_coin() {
print_decorated(std::move(x.value()));
}

#line 18 "mixed-initialization-safety-3-contract-violation.cpp2"
auto fill(
cpp2::out<std::string> x,
cpp2::in<std::string> value,
Expand All @@ -64,5 +65,6 @@ auto fill(
x.construct(CPP2_UFCS(substr, value, 0, count));
}

#line 28 "mixed-initialization-safety-3-contract-violation.cpp2"
auto print_decorated(auto const& x) -> void { std::cout << ">> [" << x << "]\n"; }

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ auto print_decorated(auto const& x) -> void;
print_decorated(std::move(x.value()));
}

#line 16 "mixed-initialization-safety-3.cpp2"
auto fill(
cpp2::out<std::string> x,
cpp2::in<std::string> value,
Expand All @@ -59,6 +60,7 @@ auto fill(
x.construct(CPP2_UFCS(substr, value, 0, count));
}

#line 26 "mixed-initialization-safety-3.cpp2"
auto print_decorated(auto const& x) -> void { std::cout << ">> [" << x << "]\n"; }

#line 30 "mixed-initialization-safety-3.cpp2"
Expand Down
2 changes: 2 additions & 0 deletions regression-tests/test-results/mixed-inspect-templates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct my_type {};
();
}

#line 18 "mixed-inspect-templates.cpp2"
[[nodiscard]] auto fun2(auto const& v) -> std::string{
if (cpp2::is<std::vector>(v)) {return "std::vector"; }
if (cpp2::is<std::array>(v)) {return "std::array"; }
Expand All @@ -49,6 +50,7 @@ struct my_type {};
return "unknown";
}

#line 26 "mixed-inspect-templates.cpp2"
[[nodiscard]] auto main() -> int{
std::vector<int> vec {1, 2, 3};
std::array<int,4> arr {1, 2, 3, 4};
Expand Down
2 changes: 2 additions & 0 deletions regression-tests/test-results/mixed-inspect-values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ auto test(auto const& x) -> void;
#line 5 "mixed-inspect-values.cpp2"
[[nodiscard]] auto in_2_3(cpp2::in<int> x) -> bool { return cpp2::cmp_less_eq(2,x) && cpp2::cmp_less_eq(x,3); }

#line 7 "mixed-inspect-values.cpp2"
[[nodiscard]] auto main() -> int{
std::variant<double,std::string,double> v {};
v = "rev dodgson";
Expand All @@ -53,6 +54,7 @@ auto test(auto const& x) -> void;
test(3.14);
}

#line 31 "mixed-inspect-values.cpp2"
auto test(auto const& x) -> void{
auto forty_two {42};
std::cout << [&] () -> std::string { auto&& _expr = x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ auto calc() {
();
}

#line 14 "mixed-inspect-with-typeof-of-template-arg-list.cpp2"
[[nodiscard]] auto main() -> int{
return fun(42);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ auto try_pointer_stuff() -> void{
// to show -n
}

#line 21 "mixed-lifetime-safety-and-null-contracts.cpp2"
auto call_my_framework(char const* msg) -> void{
std::cout
<< "sending error to my framework... ["
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ bool flip_a_coin() {
print_and_decorate(*cpp2::assert_not_null(std::move(p.value())));
}

#line 21 "mixed-lifetime-safety-pointer-init-4.cpp2"
auto print_and_decorate(auto const& thing) -> void {
std::cout << ">> " << thing << "\n"; }

Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ bool flip_a_coin() {
return { std::move(i.value()), std::move(s.value()) };
}

#line 22 "mixed-multiple-return-values.cpp2"
auto do_print(cpp2::in<std::string> name, auto const& value) -> void {
std::cout << name << " is " << value << "\n"; }

5 changes: 5 additions & 0 deletions regression-tests/test-results/mixed-out-destruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,17 @@ int main() {

#line 22 "mixed-out-destruction.cpp2"
auto f00() -> void { C c {"f00"}; cpp2::deferred_init<X> x; f01(cpp2::out(&x));}
#line 23 "mixed-out-destruction.cpp2"
auto f01(cpp2::out<X> x) -> void{C c {"f01"}; x.construct();throw_1();}

#line 27 "mixed-out-destruction.cpp2"
auto f10() -> void { C c {"f10"}; cpp2::deferred_init<X> x; f11(cpp2::out(&x));}
#line 28 "mixed-out-destruction.cpp2"
auto f11(cpp2::out<X> x) -> void{C c {"f11"}; f12(cpp2::out(&x));}
#line 29 "mixed-out-destruction.cpp2"
auto f12(cpp2::out<X> x) -> void{C c {"f12"}; f13(cpp2::out(&x));throw_1();}
#line 30 "mixed-out-destruction.cpp2"
auto f13(cpp2::out<X> x) -> void{C c {"f13"}; f14(cpp2::out(&x));}
#line 31 "mixed-out-destruction.cpp2"
auto f14(cpp2::out<X> x) -> void{C c {"f14"}; x.construct();}

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ auto f(auto x_) -> void{
x.construct(42);
}

#line 15 "mixed-parameter-passing-generic-out.cpp2"
[[nodiscard]] auto main() -> int{
cpp2::deferred_init<int> a;
f(cpp2::out(&a));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ CPP2_REQUIRES (std::is_same_v<CPP2_TYPEOF(e), std::string>)
#line 6 "mixed-parameter-passing-with-forward.cpp2"
auto copy_from([[maybe_unused]] auto param1) -> void{}

#line 8 "mixed-parameter-passing-with-forward.cpp2"
auto parameter_styles(
[[maybe_unused]] cpp2::in<std::string> param1,
std::string b,
Expand Down Expand Up @@ -74,5 +75,6 @@ requires (std::is_same_v<CPP2_TYPEOF(e), std::string>)

}

#line 42 "mixed-parameter-passing-with-forward.cpp2"
[[nodiscard]] auto main() -> int{}

2 changes: 2 additions & 0 deletions regression-tests/test-results/mixed-parameter-passing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ auto parameter_styles(
#line 6 "mixed-parameter-passing.cpp2"
auto copy_from([[maybe_unused]] auto param1) -> void{}

#line 8 "mixed-parameter-passing.cpp2"
auto parameter_styles(
[[maybe_unused]] cpp2::in<std::string> param1,
std::string b,
Expand Down Expand Up @@ -66,5 +67,6 @@ auto parameter_styles(

}

#line 40 "mixed-parameter-passing.cpp2"
[[nodiscard]] auto main() -> int{}

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ auto insert_at(cpp2::in<int> where, cpp2::in<int> val) -> void;

std::vector<int> vec {};

#line 14 "mixed-postexpression-with-capture.cpp2"
auto insert_at(cpp2::in<int> where, cpp2::in<int> val) -> void

#line 17 "mixed-postexpression-with-capture.cpp2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ auto call([[maybe_unused]] auto const& param1, [[maybe_unused]] auto const& para
#line 2 "mixed-postfix-expression-custom-formatting.cpp2"
auto call([[maybe_unused]] auto const& param1, [[maybe_unused]] auto const& param2, [[maybe_unused]] auto const& param3, [[maybe_unused]] auto const& param4, [[maybe_unused]] auto const& param5) -> void{}

#line 4 "mixed-postfix-expression-custom-formatting.cpp2"
[[nodiscard]] auto test(auto const& a) -> std::string{
return call(a,
++*cpp2::assert_not_null(CPP2_UFCS(b, a, a.c)), "hello", /* polite
Expand All @@ -37,5 +38,6 @@ auto call([[maybe_unused]] auto const& param1, [[maybe_unused]] auto const& para
);
}

#line 15 "mixed-postfix-expression-custom-formatting.cpp2"
[[nodiscard]] auto main() -> int{}

1 change: 1 addition & 0 deletions regression-tests/test-results/mixed-type-safety-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ auto print(cpp2::in<std::string> msg, cpp2::in<bool> b) -> void;
auto print(cpp2::in<std::string> msg, auto const& x) -> void {
std::cout << msg << x << "\n"; }

#line 16 "mixed-type-safety-1.cpp2"
auto print(cpp2::in<std::string> msg, cpp2::in<bool> b) -> void
{
cpp2::deferred_init<char const*> bmsg;
Expand Down
1 change: 1 addition & 0 deletions regression-tests/test-results/pure2-bounds-safety-span.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ auto print_and_decorate(auto const& thing) -> void;
}
}

#line 14 "pure2-bounds-safety-span.cpp2"
auto print_and_decorate(auto const& thing) -> void {
std::cout << ">> " << thing << "\n"; }

12 changes: 12 additions & 0 deletions regression-tests/test-results/pure2-break-continue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ auto for_break_outer() -> void;
std::cout << "\nfor_break_outer:\n "; for_break_outer();
}

#line 20 "pure2-break-continue.cpp2"
auto while_continue_inner() -> void
{
auto i {0};
Expand All @@ -92,6 +93,7 @@ auto while_continue_inner() -> void
}
}

#line 36 "pure2-break-continue.cpp2"
auto while_continue_outer() -> void
{
auto i {0};
Expand All @@ -111,6 +113,7 @@ auto while_continue_outer() -> void
#line 50 "pure2-break-continue.cpp2"
}

#line 52 "pure2-break-continue.cpp2"
auto while_break_inner() -> void
{
auto i {0};
Expand All @@ -130,6 +133,7 @@ auto while_break_inner() -> void
}
}

#line 68 "pure2-break-continue.cpp2"
auto while_break_outer() -> void
{
auto i {0};
Expand All @@ -149,6 +153,7 @@ auto while_break_outer() -> void
#line 82 "pure2-break-continue.cpp2"
}

#line 84 "pure2-break-continue.cpp2"
auto do_continue_inner() -> void
{
auto i {0};
Expand All @@ -174,6 +179,7 @@ auto do_continue_inner() -> void
cpp2::cmp_less(i,3) && [&]{ ++i ; return true; }() );
}

#line 103 "pure2-break-continue.cpp2"
auto do_continue_outer() -> void
{
auto i {0};
Expand All @@ -199,6 +205,7 @@ auto do_continue_outer() -> void
cpp2::cmp_less(i,3) && [&]{ ++i ; return true; }() );
}

#line 122 "pure2-break-continue.cpp2"
auto do_break_inner() -> void
{
auto i {0};
Expand All @@ -224,6 +231,7 @@ auto do_break_inner() -> void
cpp2::cmp_less(i,3) && [&]{ ++i ; return true; }() );
}

#line 141 "pure2-break-continue.cpp2"
auto do_break_outer() -> void
{
auto i {0};
Expand All @@ -249,6 +257,7 @@ auto do_break_outer() -> void
cpp2::cmp_less(i,3) && [&]{ ++i ; return true; }() );
}

#line 160 "pure2-break-continue.cpp2"
auto for_continue_inner() -> void
{
std::vector vi {0, 1, 2};
Expand All @@ -270,6 +279,7 @@ auto for_continue_inner() -> void
} while (false); ++counter; }
}

#line 178 "pure2-break-continue.cpp2"
auto for_continue_outer() -> void
{
std::vector vi {0, 1, 2};
Expand All @@ -291,6 +301,7 @@ auto for_continue_outer() -> void
#line 194 "pure2-break-continue.cpp2"
}

#line 196 "pure2-break-continue.cpp2"
auto for_break_inner() -> void
{
std::vector vi {0, 1, 2};
Expand All @@ -312,6 +323,7 @@ auto for_break_inner() -> void
} while (false); ++counter; }
}

#line 214 "pure2-break-continue.cpp2"
auto for_break_outer() -> void
{
std::vector vi {0, 1, 2};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ auto main(int const argc_, char** argv_) -> int;
return *this;
#line 3 "pure2-bugfix-for-discard-precedence.cpp2"
}
#line 4 "pure2-bugfix-for-discard-precedence.cpp2"
[[nodiscard]] auto quantity::operator+(quantity const& that) & -> quantity { return quantity(number + that.number); }

#line 7 "pure2-bugfix-for-discard-precedence.cpp2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ auto main() -> int;

#line 2 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
Base::Base(){}
#line 3 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
Base::Base ([[maybe_unused]] Base const& that) { std::cout << "(out this, that)\n"; }
#line 3 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
auto Base::operator=([[maybe_unused]] Base const& that) -> Base& { std::cout << "(out this, that)\n";
Expand All @@ -60,6 +61,7 @@ auto main() -> int;
return *this;
#line 3 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
}
#line 4 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
Base::Base([[maybe_unused]] auto const& param2) { std::cout << "(implicit out this, _)\n"; }
#line 4 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
auto Base::operator=([[maybe_unused]] auto const& param2) -> Base& { std::cout << "(implicit out this, _)\n";
Expand All @@ -72,10 +74,12 @@ auto main() -> int;
: Base{ }
#line 9 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
{}
#line 10 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
Derived::Derived(Derived const& that)
: Base{ static_cast<Base const&>(that) }
#line 10 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
{}
#line 11 "pure2-bugfix-for-memberwise-base-assignment.cpp2"
auto Derived::operator=(Derived&& that) noexcept -> Derived& {
Base::operator= ( static_cast<Base&&>(that) );
return *this;
Expand Down
Loading