[all-commits] [llvm/llvm-project] 71cf97: Reland "[lldb] Don't send invalid region addresses...

David Spickett via All-commits all-commits at lists.llvm.org
Mon Oct 5 03:50:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 71cf97e95b8c888367284d1d12925f79b38034eb
      https://github.com/llvm/llvm-project/commit/71cf97e95b8c888367284d1d12925f79b38034eb
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2020-10-05 (Mon, 05 Oct 2020)

  Changed paths:
    M lldb/source/Commands/CommandObjectMemory.cpp
    M lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
    M lldb/test/API/functionalities/memory-region/TestMemoryRegion.py

  Log Message:
  -----------
  Reland "[lldb] Don't send invalid region addresses to lldb server"

This reverts commit c65627a1fe3be7521fc232d633bb6df577f55269.

The test immediately after the new invalid symbol test was
failing on Windows. This was because when we called
VirtualQueryEx to get the region info for 0x0,
even if it succeeded we would call GetLastError.

Which must have picked up the last error that was set while
trying to lookup "not_an_address". Which happened to be 2.
("The system cannot find the file specified.")

To fix this only call GetLastError when we know VirtualQueryEx
has failed. (when it returns 0, which we were also checking for anyway)

Also convert memory region to an early return style
to make the logic clearer.

Reviewed By: labath, stella.stamenova

Differential Revision: https://reviews.llvm.org/D88229




More information about the All-commits mailing list