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

Add Heap class #1318

Merged
merged 4 commits into from
Oct 23, 2022
Merged

Add Heap class #1318

merged 4 commits into from
Oct 23, 2022

Conversation

CptGibbon
Copy link
Contributor

@CptGibbon CptGibbon commented Oct 22, 2022

Add a Heap class to the heap inspection code, plus:

  • Rename the existing Heap class to GlibcMemoryAllocator and the BaseHeap class to MemoryAllocator, which I think is more descriptive.
  • Integrate the new Heap class into the heap command.

Hopefully this is the last heap-related class pwndbg needs for now, along with the recent Chunk, Arena & Bins classes.
This is a bare-bones implementation for now, just enough to for use in the heap command and there is some redundancy with existing classes & functions, which I plan to iron out in subsequent PRs. The end goal is to move most of the existing heap logic into the heap classes.

@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2022

Codecov Report

Merging #1318 (505aa24) into dev (5a323b4) will decrease coverage by 0.16%.
The diff coverage is 18.18%.

@@            Coverage Diff             @@
##              dev    #1318      +/-   ##
==========================================
- Coverage   55.04%   54.87%   -0.17%     
==========================================
  Files         156      153       -3     
  Lines       19397    19387      -10     
  Branches     1804     1815      +11     
==========================================
- Hits        10677    10639      -38     
- Misses       8276     8298      +22     
- Partials      444      450       +6     
Impacted Files Coverage Δ
pwndbg/commands/heap.py 77.98% <0.00%> (+0.44%) ⬆️
pwndbg/heap/ptmalloc.py 55.53% <16.66%> (-1.11%) ⬇️
pwndbg/heap/heap.py 54.54% <100.00%> (ø)
pwndbg/gdblib/config.py 68.88% <0.00%> (-10.53%) ⬇️
pwndbg/commands/vmmap.py 43.15% <0.00%> (-1.18%) ⬇️
pwndbg/lib/memory.py 93.15% <0.00%> (-0.28%) ⬇️
pwndbg/glibc.py 75.43% <0.00%> (ø)
pwndbg/disasm/arch.py 78.94% <0.00%> (ø)
pwndbg/color/memory.py 100.00% <0.00%> (ø)
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@disconnect3d disconnect3d left a comment

Choose a reason for hiding this comment

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

👍, we can merge it now though I'd love if we could include additional comments to the logic we have here ;p

@disconnect3d disconnect3d merged commit 125a060 into pwndbg:dev Oct 23, 2022
@CptGibbon CptGibbon deleted the add-heap-class branch October 24, 2022 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants