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

Long call stacks don't display properly, loop initial elements infinitely #308

Closed
HolyBlackCat opened this issue Jan 11, 2022 · 6 comments · Fixed by #312
Closed

Long call stacks don't display properly, loop initial elements infinitely #308

HolyBlackCat opened this issue Jan 11, 2022 · 6 comments · Fixed by #312

Comments

@HolyBlackCat
Copy link

When the stack is long, only a part of it is displayed initially. There's an empty line below, that, when clicked, should supposedly show more stack elements.

But it doesn't work. When I click it, instead of showing the next stack elements, it instead duplicates the already visible elements.

E.g. if I see lines A B C and click 'more', it displays A B C A B C, then A B C A B C A B C, and so on.

I'm using the extension with GDB. bt in the debug console works properly.

Before clicking:

pic

After clicking:

pic

Compare with the output of bt:

bt
#0  0x000000000030296c in fmt::v8::detail::buffer<char>::try_reserve (this=0x7fffffffc950, new_capacity=79) at ../_dependencies/imp-re_deps_22-01/include/fmt/core.h:817
#1  0x0000000000302b0f in fmt::v8::detail::buffer<char>::append<char> (this=0x7fffffffc950, begin=0x24b750 <Strings::impl::Format::format_string_storage<MultiArray<2, unsigned char>::unsafe_at(Math::Vector::vec<2, long>)::{lambda()#1}::operator()() const::{lambda()#1}>+72> ".NSt7__debug6vectorIhSaIhEEE", end=0x24b751 <typeinfo name for std::__debug::vector<unsigned char, std::allocator<unsigned char> >> "NSt7__debug6vectorIhSaIhEEE") at ../_dependencies/imp-re_deps_22-01/include/fmt/format.h:580
#2  0x0000000000306a85 in fmt::v8::detail::copy_str<char, char const*> (begin=0x24b750 <Strings::impl::Format::format_string_storage<MultiArray<2, unsigned char>::unsafe_at(Math::Vector::vec<2, long>)::{lambda()#1}::operator()() const::{lambda()#1}>+72> ".NSt7__debug6vectorIhSaIhEEE", end=0x24b751 <typeinfo name for std::__debug::vector<unsigned char, std::allocator<unsigned char> >> "NSt7__debug6vectorIhSaIhEEE", out=...) at ../_dependencies/imp-re_deps_22-01/include/fmt/core.h:1491
#3  0x000000000030d10d in fmt::v8::detail::copy_str_noinline<char, char const*, fmt::v8::appender> (begin=0x24b750 <Strings::impl::Format::format_string_storage<MultiArray<2, unsigned char>::unsafe_at(Math::Vector::vec<2, long>)::{lambda()#1}::operator()() const::{lambda()#1}>+72> ".NSt7__debug6vectorIhSaIhEEE", end=0x24b751 <typeinfo name for std::__debug::vector<unsigned char, std::allocator<unsigned char> >> "NSt7__debug6vectorIhSaIhEEE", out=...) at ../_dependencies/imp-re_deps_22-01/include/fmt/format.h:431
#4  0x000000000030db8e in fmt::v8::detail::write<char, fmt::v8::appender> (out=..., value=...) at ../_dependencies/imp-re_deps_22-01/include/fmt/format.h:1860
#5  0x000000000030e3b1 in fmt::v8::detail::vformat_to<char>(fmt::v8::detail::buffer<char>&, fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<std::conditional<std::is_same<fmt::v8::type_identity<char>::type, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<fmt::v8::type_identity<char>::type> > >::type, fmt::v8::type_identity<char>::type> >, fmt::v8::detail::locale_ref)::format_handler::on_text(char const*, char const*) (this=0x7fffffffc760, begin=0x24b750 <Strings::impl::Format::format_string_storage<MultiArray<2, unsigned char>::unsafe_at(Math::Vector::vec<2, long>)::{lambda()#1}::operator()() const::{lambda()#1}>+72> ".NSt7__debug6vectorIhSaIhEEE", end=0x24b751 <typeinfo name for std::__debug::vector<unsigned char, std::allocator<unsigned char> >> "NSt7__debug6vectorIhSaIhEEE") at ../_dependencies/imp-re_deps_22-01/include/fmt/format.h:2663
#6  0x000000000030ef5e in fmt::v8::detail::parse_format_string<false, char, fmt::v8::detail::vformat_to<char>(fmt::v8::detail::buffer<char>&, fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<std::conditional<std::is_same<fmt::v8::type_identity<char>::type, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<fmt::v8::type_identity<char>::type> > >::type, fmt::v8::type_identity<char>::type> >, fmt::v8::detail::locale_ref)::format_handler>(fmt::v8::basic_string_view<char>, fmt::v8::detail::vformat_to<char>(fmt::v8::detail::buffer<char>&, fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<std::conditional<std::is_same<fmt::v8::type_identity<char>::type, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<fmt::v8::type_identity<char>::type> > >::type, fmt::v8::type_identity<char>::type> >, fmt::v8::detail::locale_ref)::format_handler&&)::writer::operator()(char const*, char const*) (this=0x7fffffffc8f0, pbegin=0x24b750 <Strings::impl::Format::format_string_storage<MultiArray<2, unsigned char>::unsafe_at(Math::Vector::vec<2, long>)::{lambda()#1}::operator()() const::{lambda()#1}>+72> ".NSt7__debug6vectorIhSaIhEEE", pend=0x24b751 <typeinfo name for std::__debug::vector<unsigned char, std::allocator<unsigned char> >> "NSt7__debug6vectorIhSaIhEEE") at ../_dependencies/imp-re_deps_22-01/include/fmt/core.h:2413
#7  0x0000000000301412 in fmt::v8::detail::parse_format_string<false, char, fmt::v8::detail::vformat_to<char>(fmt::v8::detail::buffer<char>&, fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<std::conditional<std::is_same<fmt::v8::type_identity<char>::type, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<fmt::v8::type_identity<char>::type> > >::type, fmt::v8::type_identity<char>::type> >, fmt::v8::detail::locale_ref)::format_handler>(fmt::v8::basic_string_view<char>, fmt::v8::detail::vformat_to<char>(fmt::v8::detail::buffer<char>&, fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<std::conditional<std::is_same<fmt::v8::type_identity<char>::type, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<fmt::v8::type_identity<char>::type> > >::type, fmt::v8::type_identity<char>::type> >, fmt::v8::detail::locale_ref)::format_handler&&) (format_str=..., handler=...) at ../_dependencies/imp-re_deps_22-01/include/fmt/core.h:2428
#8  fmt::v8::detail::vformat_to<char> (buf=
warning: RTTI symbol not found for class 'fmt::v8::basic_memory_buffer<char, 500ul, std::allocator<char> >'
..., fmt=..., args=..., loc=...) at ../_dependencies/imp-re_deps_22-01/include/fmt/format.h:2706
#9  0x0000000000518843 in fmt::v8::vformat[abi:cxx11](fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >) ()
#10 0x00000000003c3594 in fmt::v8::format<Math::Vector::vec<2, long>&, Math::Vector::vec<2, long>&> (fmt=..., args=..., args=...) at ../_dependencies/imp-re_deps_22-01/include/fmt/core.h:2886
#11 MultiArray<2, unsigned char>::unsafe_at (this=0x2326800, pos=...) at src/utils/multiarray.h:54
#12 0x00000000003b703d in MultiArray<2, unsigned char>::safe_nonthrowing_at (this=0x2326800, pos=...) at src/utils/multiarray.h:77
#13 0x00000000003b48ce in GameUtils::TilesToEdges::Convert (params=...) at src/gameutils/tiles_to_edges.cpp:139
#14 0x000000000036bd66 in States::World::World (this=0x2311320) at src/game/states/world.cpp:54
#15 0x000000000036ba42 in Poly::Storage<States::Base, Refl::Polymorphic::impl::Data::BaseData<States::Base>::PolyStorageData>::Low::Unique::make<States::World> () at src/utils/poly_storage.h:145
#16 0x000000000036b92d in Poly::Storage<States::Base, Refl::Polymorphic::impl::Data::BaseData<States::Base>::PolyStorageData>::Low::make<States::World> (out_ptr=0x0) at src/utils/poly_storage.h:236
#17 0x000000000036b8f9 in Poly::Storage<States::Base, Refl::Polymorphic::impl::Data::BaseData<States::Base>::PolyStorageData>::Storage<States::World, , void>(Poly::derived_tag<States::World>) (this=0x7fffffffdb70) at src/utils/poly_storage.h:287
#18 0x000000000036b8cf in Refl::Polymorphic::impl::Data::BaseData<States::Base>::RegisterClass<States::World>()::{lambda()#1}::operator()() const (this=0x0) at src/reflection/poly_storage_support.h:223
#19 0x000000000036b89b in Refl::Polymorphic::impl::Data::BaseData<States::Base>::RegisterClass<States::World>()::{lambda()#1}::__invoke() () at src/reflection/poly_storage_support.h:223
#20 0x00000000003553ea in Refl::Polymorphic::impl::Data::BaseData<States::Base>::ConstructFromIndex (index=0) at src/reflection/poly_storage_support.h:258
#21 0x0000000000355363 in Refl::Polymorphic::impl::Data::ConstructFromIndex<States::Base> (index=0) at src/reflection/poly_storage_support.h:299
#22 0x0000000000354e5a in Refl::Polymorphic::ConstructFromIndex<States::Base> (index=0) at src/reflection/poly_storage_support.h:426
#23 0x00000000003569b0 in Refl::Polymorphic::ConstructFromName<States::Base> (name=0x7fffffffdbe8 "World") at src/reflection/poly_storage_support.h:434
#24 0x0000000000356430 in Refl::Polymorphic::ConstructFromName<States::Base> (name="World") at src/reflection/poly_storage_support.h:438
#25 0x0000000000350e63 in Refl::Interface_Polymorphic<Poly::Storage<States::Base, Refl::Polymorphic::impl::Data::BaseData<States::Base>::PolyStorageData> >::FromString (this=0x7fffffffdc78, object=..., input=..., options=..., state=...) at src/reflection/poly_storage_support.h:484
#26 0x0000000000350992 in Refl::Shorthands::FromString<Poly::Storage<States::Base, Refl::Polymorphic::impl::Data::BaseData<States::Base>::PolyStorageData> > (object=..., input=..., options=...) at src/reflection/interface_basic.h:286
#27 0x00000000003507cf in GameUtils::State::Manager<States::Base>::SetState (this=0x7fffffffe008, state_str="World{}") at src/gameutils/state.h:63
#28 0x00000000003236da in Application::Init (this=0x7fffffffdfe8) at src/game/main.cpp:111
#29 0x0000000000321828 in main () at src/game/main.cpp:118

@brownts
Copy link
Collaborator

brownts commented Jan 15, 2022

Hi @HolyBlackCat, I just looked quickly in the code base and didn't see that the Stack Trace functionality was taking into consideration the startFrame parameter that could be sent as an argument in the StackTraceRequest. My suspicion would be that the editor is using this value to request the next set of stack frames and since it's being ignored by this extension, the extension is just fetching the top stack frames again.

@GitMensch
Copy link
Collaborator

GitMensch commented Feb 25, 2022

@brownts Can you do anything about this without increasing the dap-version too much (I did not check if the startFrame is already part of 1.40)?

@brownts
Copy link
Collaborator

brownts commented Feb 26, 2022

@brownts Can you do anything about this without increasing the dap-version too much (I did not check if the startFrame is already part of 1.40)?

@GitMensch, I looked in the specification and startFrame was introduced in 1.8.x as an optional attribute, so shouldn't be a problem fixing this and staying compatible with 1.40. By the way, is there something documented that indicates this extension is trying to stay compatible with version 1.40 of the specification? I didn't notice anything, and this was the first I had heard of it.

@GitMensch
Copy link
Collaborator

It is an explicit version so I assume the compatibility is intended by @WebFreak001 - but it would be good to know it and I agree maybe also documented.
Note: I know of different environments that use old vscode installations, I guess that those would not work with a newer dap because those depend on a newer version of vscode (again: just guessing).

@WebFreak001
Copy link
Owner

I like to support a few older VSCode versions, but we can upgrade the dependency and the engine version as well. I'd just like to support versions from the past 6 months or so, as the extension is also pretty stable and I want to give other editors which use this debug adapter (I think there was something with theia and some cloud IDE) time to update.

@GitMensch
Copy link
Collaborator

That sounds good. For my main test environment there's "kind of" a 12 month update rule (when not for security issues) [which currently relates to vscode 1.55, newer versions would mean I would have less options to test (and mostly not use it, which would be no problem in general). That is expected to be "newest one" in 1-2 months again (I'm hoping for full IDE'd memory support in native debug and that needs the newest version in any case).
Is there an option with TS and vscode to say "if this class/function is available at runtime use it, otherwise not"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants