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.
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.
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.
I will learn more to find out.