sr, cause and config5 have 32 bit size irrespective of ABI
Details
Details
- Reviewers
clayborg tberghammer - Commits
- rG64322c0331ec: [LLDB][MIPS] Fix ReadRegisterValue for registers with constant 32 bit size…
rLLDB257447: [LLDB][MIPS] Fix ReadRegisterValue for registers with constant 32 bit size…
rL257447: [LLDB][MIPS] Fix ReadRegisterValue for registers with constant 32 bit size…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Please see inline comments
P.S.: Next time please upload the diff with full context (git diff -U999999999) as it is easier to review that way
source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp | ||
---|---|---|
1392 | You can't compare a string literal and a const char* like this (it will compare the pointers only). You have to use ::strcmp or use the ConstString class in some form. | |
1393–1395 | Reading these lines are very difficult. I think something like this would be much cleaner (I haven't fixed the string comparisons and haven't tested it): void* target_address = ((uint8_t*)®s) + offset + 4 * (arch.GetMachine() == llvm::Triple::mips); uint32_t target_size; if (reg_name == "sr" || reg_name == "cause" || reg_name == "config5") target_size = 4; else target_size = arch.GetFlags() & lldb_private::ArchSpec::eMIPSABI_O32 ? 4 : 8; value.SetBytes(target_address, target_size, arch.GetByteOrder()); |
You can't compare a string literal and a const char* like this (it will compare the pointers only). You have to use ::strcmp or use the ConstString class in some form.