This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/FreeBSDRemote] Check for regset support early [WIP]
Needs ReviewPublic

Authored by mgorny on Nov 13 2020, 7:15 AM.

Details

Summary

@labath, I'm trying to copy the logic from Linux here but for some reason unsupported regsets are now reported as 'unknown' instead of not all. Any clue what I'm doing wrong?

Diff Detail

Event Timeline

mgorny requested review of this revision.Nov 13 2020, 7:15 AM
mgorny created this revision.

Hmm, if I add GetUserRegisterCount() override, then registers start disappearing. Except that wrong registers disappear.

My guess is that this is because of the extra debug registers that you're exposing. You'll notice that Get(User)RegisterSetCount returns just a number, and this means that it is not really possible to selectively disable register sets -- all you can do is disable the ones that come last.

We ran into a similar problem on arm with @omjavaid.

For the time being, we may be able to work around this by making the debug registers come earlier in the list (after ensuring they work on linux). Or we could hide them on BSDs as well...

My guess is that this is because of the extra debug registers that you're exposing. You'll notice that Get(User)RegisterSetCount returns just a number, and this means that it is not really possible to selectively disable register sets -- all you can do is disable the ones that come last.

We ran into a similar problem on arm with @omjavaid.

For the time being, we may be able to work around this by making the debug registers come earlier in the list (after ensuring they work on linux). Or we could hide them on BSDs as well...

Register sets are stored in statically which means we have to honor the order as @labath pointed out. Ideally register sets array should be a dynamic list with all currently available registerset inserted in the list.