Some architectures do not have a flag register (like riscv).
In this case, we should set it to baton.m_register_values.end() to avoid nullptr exception.
Details
Details
- Reviewers
DavidSpickett - Commits
- rG95e2949a5352: [LLDB] Fix possible nullptr exception
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM. Skimming the code I think what happens is it will try to read the flags from the context, fail and return 0xF...F. Then nothing for riscv is going to read that value so no harm done by not having a flags register.
Testing wise I assume that without this any attempt to run a single step crashes? So if they now pass, it's covered.
Something I noticed going through this is that MIPS returns sr as its flags register, when I would have said that MIPS doesn't have flags either (and I worked on MIPS for a while so I think I'd remember). Even so I think you're doing the right thing here by not providing a flags register at all.