memory region displays the top-level section name, which for MachO is the segment name. The segment name alone is not much use, it's very coarse grained. This changes memory region to display the segment and section names for MachO images. For example, display __DATA,__const instead of only __DATA.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I see now this isn't valid as written. The address range and rwx permissions printed by memory region are for the segment not the section. I think it would be helpful to print the section too, but as this change is written now, it could appear that all the info is for the section, when it's really for the segment. Maybe a better change would be to print a second line with an address range for the section, and the section's name.
lldb/test/API/functionalities/memory-region/TestMemoryRegion.py | ||
---|---|---|
76 | Doesn't lldbutil.run_break_set_by_symbol() do the "file" and "run" already and this run command runs it a second time? |
lldb/source/Commands/CommandObjectMemory.cpp | ||
---|---|---|
1695 | Why did section_sp->GetName(); return the Segment name in the original code? Is that a bug? |
lldb/source/Commands/CommandObjectMemory.cpp | ||
---|---|---|
1695 | The original code is traversing the parent chain of sections, which for mach-o ends up on the segment. Now that I have learned the address range printed is for the segment, then it makes sense why the segment name alone is printed. | |
lldb/test/API/functionalities/memory-region/TestMemoryRegion.py | ||
76 | I will learn more to find out. |
clang-format not found in user’s local PATH; not linting file.