This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch libstdc++] Add xmethods for std::vector and std::unique_ptr

>>>>> "Siva" == Siva Chandra <> writes:

Siva> +# Load the xmethods.
Siva> +from libstdcxx.v6.xmethods import register_libstdcxx_xmethods
Siva> +register_libstdcxx_xmethods (gdb.current_objfile ())

I don't think any addition to the hook file should be needed.

Siva> +        # The object to be returned is the 0-th element in the tuple _m_t.
Siva> +        # The following retrieves the 0-th element of this tuple.
Siva> +        _m_t_base = _m_t[_m_t.type.fields()[0]] # std::tuple has a single base
Siva> +                                                # class and no data members.
Siva> +        for f in _m_t_base.type.fields():
Siva> +            # The object is embedded in the _Head_base<> base class of
Siva> +            # _m_t_base.
Siva> +            if f.is_base_class and'std::_Head_base<') == 0:
Siva> +                _head_base = _m_t_base[f]

Did you investigate sharing any code with the printers?
If so, why did you choose not to?
If not, could you please look into that?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]