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

feat(kernel): Add dmesg-like command #1732

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft

Conversation

theguy147
Copy link
Contributor

image

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2023

Codecov Report

Merging #1732 (3118dc6) into dev (b5a1219) will decrease coverage by 0.08%.
The diff coverage is 36.58%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##              dev    #1732      +/-   ##
==========================================
- Coverage   58.63%   58.56%   -0.08%     
==========================================
  Files         175      177       +2     
  Lines       21269    21351      +82     
  Branches     1900     1910      +10     
==========================================
+ Hits        12472    12505      +33     
- Misses       8193     8243      +50     
+ Partials      604      603       -1     
Impacted Files Coverage Δ
pwndbg/gdblib/kernel/log.py 22.85% <22.85%> (ø)
pwndbg/commands/kdmesg.py 45.65% <45.65%> (ø)
pwndbg/commands/__init__.py 75.39% <100.00%> (+0.06%) ⬆️

... and 1 file with indirect coverage changes

@disconnect3d
Copy link
Member

Hmm:

____________________ ERROR collecting tests/test_cymbol.py _____________________
ImportError while importing test module '/pwndbg/tests/gdb-tests/tests/test_cymbol.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.6/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_cymbol.py:3: in <module>
    import pwndbg.commands.cymbol
../../pwndbg/__init__.py:12: in <module>
    load_commands()
../../pwndbg/commands/__init__.py:644: in load_commands
    import pwndbg.commands.kdmesg
../../pwndbg/commands/kdmesg.py:3: in <module>
    from typing import Filter
E   ImportError: cannot import name 'Filter'

@theguy147
Copy link
Contributor Author

I guess I was confused by the mypy hints. Previously I had the return type as a Generator but mypy complained that it is actually a Filter and therefore I just assumed that such a type is included in typing. Anyhow, I reverted the commit now.

disconnect3d added a commit that referenced this pull request May 24, 2023
This is an attempt to mitigate: "Unit tests / qemu-tests (pull_request) Cancelled after 20m" that occurs in #1732
disconnect3d added a commit that referenced this pull request May 24, 2023
This is an attempt to mitigate: "Unit tests / qemu-tests (pull_request) Cancelled after 20m" that occurs in #1732
@disconnect3d
Copy link
Member

Can you rebase to latest dev? There's a commit increasing qemu-tests CI to 30min, maybe it will work then..

@theguy147
Copy link
Contributor Author

latest dev introduces the following mypy error:

pwndbg/exception.py:16: error: Name "pdb" already defined (possibly by an import)  [no-redef]

don't currently have the time to investigate - might be a couple of days. but this PR is anyway not ready yet so no rush from my side. Also when I have some time I wanted to find out why the runtime of the qemu tests have exploded with the commit which introduces filtering capability of the dmesg command (which is actually not even tested yet... so shouldn't affect the test time yet)

@gsingh93
Copy link
Member

pwndbg/exception.py:16: error: Name "pdb" already defined (possibly by an import) [no-redef]

Can you see if upgrading mypy fixes this for you? I recently upgraded the dependencies, try running this:

pip install -U -r dev-requirements.txt

@disconnect3d
Copy link
Member

Can we just merge this? It seems that this works (?)?

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

4 participants