Skip to content

[lldb] Change MemoryRegionInfo::SetIsShadowStack into a "builder" method - #189565

Merged
DavidSpickett merged 1 commit into
llvm:mainfrom
DavidSpickett:lldb-mem1
Mar 31, 2026
Merged

[lldb] Change MemoryRegionInfo::SetIsShadowStack into a "builder" method#189565
DavidSpickett merged 1 commit into
llvm:mainfrom
DavidSpickett:lldb-mem1

Conversation

@DavidSpickett

@DavidSpickett DavidSpickett commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Meaning a method on an object, which returns a reference to self.

I am doing this because it was pointed out to me that MemoryRegionInfo has lots of construction paramaters, and most of the time, we want the default value for most of the things.

So now we can do:
MemoryRegionInfo(...); // Shadow stack is "don't know".
MemoryRegionInfo(...).SetIsShadowStack(eNo) // Shadow stack is "no".

Which removes one parameter from every use of the constructor.

Along the way I realised that the shadow stack "ss" flag is only tested by the Guarded Control Stack tests, which only run on specific Arm hardware. I've added a new "ss" test to LinuxProcMapsTest, which will run on any system.

Meaning a method on an object, which returns a reference to self.

I am doing this because it was pointed out to me that MemoryRegionInfo
has lots of construction paramaters, and most of the time, we want the
default value for most of the things.

So now we can do:
MemoryRegionInfo(...); // Shadow stack is "don't know".
MemoryRegionInfo(...).SetIsShadowStack(eNo) // Shadow stack is "no".

Which removes one parameter from every use of the constructor.

Along the way I realised that the shadow stack "ss" flag is only
tested by the Guarded Control Stack tests, which only run on
specific Arm hardware. I've added a new "ss" test to LinuxProcMapsTest,
which will run on any system.
@DavidSpickett DavidSpickett added the skip-precommit-approval PR for CI feedback, not intended for review label Mar 31, 2026
@llvmbot llvmbot added the lldb label Mar 31, 2026
@DavidSpickett
DavidSpickett enabled auto-merge (squash) March 31, 2026 08:49
@DavidSpickett
DavidSpickett merged commit a8a6594 into llvm:main Mar 31, 2026
12 of 13 checks passed
@DavidSpickett
DavidSpickett deleted the lldb-mem1 branch March 31, 2026 10:08
zwu-2025 pushed a commit to zwu-2025/llvm-project that referenced this pull request May 17, 2026
…hod (llvm#189565)

Meaning a method on an object, which returns a reference to self.

I am doing this because it was pointed out to me that MemoryRegionInfo
has lots of construction paramaters, and most of the time, we want the
default value for most of the things.

So now we can do:
MemoryRegionInfo(...); // Shadow stack is "don't know".
MemoryRegionInfo(...).SetIsShadowStack(eNo) // Shadow stack is "no".

Which removes one parameter from every use of the constructor.

Along the way I realised that the shadow stack "ss" flag is only tested
by the Guarded Control Stack tests, which only run on specific Arm
hardware. I've added a new "ss" test to LinuxProcMapsTest, which will
run on any system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lldb skip-precommit-approval PR for CI feedback, not intended for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants