Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory: Allow info proc mapping on older gdb #1073

Closed
wants to merge 2 commits into from
Closed

Conversation

Grazfather
Copy link
Collaborator

This works now that we assume rwx if the Perms column is missing

@Grazfather Grazfather mentioned this pull request Feb 23, 2024
4 tasks
Copy link

🤖 Coverage update for 677eb7f 🔴

Old New
Commit 0fca698 677eb7f
Score 71.7996% 71.5476% (-0.252)

Copy link

🤖 Coverage update for 677eb7f 🔴

Old New
Commit 0fca698 677eb7f
Score 71.7996% 71.5942% (-0.2054)

Copy link

🤖 Coverage update for 3827a67 🔴

Old New
Commit 0fca698 3827a67
Score 71.7996% 71.5476% (-0.252)

Copy link

🤖 Coverage update for 3827a67 🔴

Old New
Commit 0fca698 3827a67
Score 71.7996% 71.5559% (-0.2437)

This works now that we assume rwx if the Perms column is missing
Copy link

github-actions bot commented Mar 9, 2024

🤖 Coverage update for a78117e 🟢

Old New
Commit cdaf158 a78117e
Score 71.5257% 71.5448% (0.0191)

Copy link

github-actions bot commented Mar 9, 2024

🤖 Coverage update for a78117e 🟢

Old New
Commit cdaf158 a78117e
Score 71.5257% 71.553% (0.0273)

Copy link
Owner

@hugsy hugsy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks backward-compat with older GDB ☹️

@@ -10590,9 +10590,6 @@ def parse_procfs_maps(cls) -> Generator[Section, None, None]:
@classmethod
def parse_gdb_info_proc_maps(cls) -> Generator[Section, None, None]:
"""Get the memory mapping from GDB's command `maintenance info sections` (limited info)."""
if GDB_VERSION < (11, 0):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's what you meant to do: on older versions, Perms is not exposed at all by GDB even on live process, for which we can know the permissions from procfs

However, removing this - and because parse_gdb_info_proc_maps is the first to be invoked when parsing mem mapping - it'll end up giving rwx to everything, which the unittest failures show quickly.

image

The reason it was mocked for version higher than 11 was to restore support for coredumps where this info is missing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@Grazfather Grazfather closed this Mar 10, 2024
@Grazfather Grazfather deleted the info_proc branch March 10, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants