================
@@ -93,12 +93,16 @@ size_t ProcessWasm::ReadMemory(lldb::addr_t vm_addr, void 
*buf, size_t size,
   case WasmAddressType::Memory:
   case WasmAddressType::Object:
     return ProcessGDBRemote::ReadMemory(vm_addr, buf, size, error);
-  case WasmAddressType::Invalid:
-    error.FromErrorStringWithFormat(
-        "Wasm read failed for invalid address 0x%" PRIx64, vm_addr);
-    return 0;
+  default:
----------------
adrian-prantl wrote:

My understanding of the language doesn't go deep enough. Would this have the 
same effect, but keep the missing-case-in-switch warning?

```
case WasmAddressType::Object:
    return ProcessGDBRemote::ReadMemory(vm_addr, buf, size, error);
}
   error.FromErrorStringWithFormatv(
      "Wasm read failed for invalid address {0:x} (type = {1:x}, module = "
      "{2:x}, offset = {3:x})",
      vm_addr, wasm_addr.GetType(), wasm_addr.GetModuleID(),
      wasm_addr.GetOffset());
  return 0;
```


https://github.com/llvm/llvm-project/pull/176464
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to