[lldb] [gdb-remote] Fix processing generic regnums
authorMichał Górny <mgorny@moritz.systems>
Fri, 29 Oct 2021 18:46:32 +0000 (20:46 +0200)
committerMichał Górny <mgorny@moritz.systems>
Fri, 29 Oct 2021 19:37:46 +0000 (21:37 +0200)
Fix regression in processing generic regnums that was introduced
in fa456505b80b0cf83647a1b26713e4d3b38eccc2 ("[lldb] [gdb-remote]
Refactor getting remote regs to use local vector").  Since then,
the "generic" field was wrongly interpreted as integer rather than
string constant.

Thanks to Ted Woodward for noticing and providing the correct code.

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

index a6f48b0..4f78ae4 100644 (file)
@@ -492,7 +492,7 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
           } else if (name.equals("dwarf")) {
             value.getAsInteger(0, reg_info.regnum_dwarf);
           } else if (name.equals("generic")) {
-            value.getAsInteger(0, reg_info.regnum_generic);
+            reg_info.regnum_generic = Args::StringToGenericRegister(value);
           } else if (name.equals("container-regs")) {
             SplitCommaSeparatedRegisterNumberString(value, reg_info.value_regs, 16);
           } else if (name.equals("invalidate-regs")) {