This is an archive of the discontinued LLVM Phabricator instance.

[lldb] on s390x fix override issue
ClosedPublic

Authored by kwk on Jul 10 2020, 11:50 AM.

Details

Summary

This fixes an override issue by marking a function as const so that the
signature maps to the signature of the function in the base class.

The overridden function was changed in revision 7fa7b81bcbd040d036f9a4155486ccebc3c13be7 by @omjavaid .

This is the original error:

In file included from /root/llvm/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp:11:
/root/llvm/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h:79:10: error: 'size_t lldb_private::process_linux::NativeRegisterContextLinux_s390x::GetGPRSize()' marked 'override', but does not override
   79 |   size_t GetGPRSize() override { return sizeof(m_regs); }
      |          ^~~~~~~~~~

Diff Detail

Event Timeline

kwk created this revision.Jul 10 2020, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2020, 11:50 AM
kwk edited the summary of this revision. (Show Details)Jul 10 2020, 11:50 AM
kwk added reviewers: tstellar, serge-sans-paille.
kwk edited the summary of this revision. (Show Details)Jul 10 2020, 11:56 AM

Looks obviously good to me.

This revision is now accepted and ready to land.Jul 10 2020, 12:07 PM

Possible followup: shouldn't all the other Get* be flagged as const too?

kwk added a comment.Jul 10 2020, 12:11 PM

Possible followup: shouldn't all the other Get* be flagged as const too?

Thank you @serge-sans-paille . You're right but I'm unsure if all getters are actually const or not. And I think one needs to figure this out for all overrides as well. And right now I don't want to break another arch ;)

This revision was automatically updated to reflect the committed changes.