[all-commits] [llvm/llvm-project] 53c45d: Change last-ditch magic address in IRMemoryMap::Fi...

Jason Molenda via All-commits all-commits at lists.llvm.org
Mon Nov 14 09:54:18 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 53c45df5ed1b8ac606f7388cec025aaba0dee9ba
      https://github.com/llvm/llvm-project/commit/53c45df5ed1b8ac606f7388cec025aaba0dee9ba
  Author: Jason Molenda <jason at molenda.com>
  Date:   2022-11-14 (Mon, 14 Nov 2022)

  Changed paths:
    M lldb/source/Expression/DWARFExpression.cpp
    M lldb/source/Expression/IRMemoryMap.cpp
    A lldb/test/API/lang/c/high-mem-global/Makefile
    A lldb/test/API/lang/c/high-mem-global/TestHighMemGlobal.py
    A lldb/test/API/lang/c/high-mem-global/main.c

  Log Message:
  -----------
  Change last-ditch magic address in IRMemoryMap::FindSpace

When we cannot allocate memory in the inferior process, the IR
interpreter's IRMemoryMap::FindSpace will create an lldb local
buffer and assign it an address range in the inferior address
space.  When the interpreter sees an address in that range, it
will read/write from the local buffer instead of the target.  If
this magic address overlaps with actual data in the target, the
target cannot be accessed through expressions.

Instead of using a high memory address that is validly addressable,
this patch uses an address that cannot be accessed on 64-bit systems
that don't actually use all 64 bits of the virtual address.

Differential Revision: https://reviews.llvm.org/D137682
rdar://96248287




More information about the All-commits mailing list