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

"'function' object has no attribute '_reset'" in pwndbg/pwndbg/color/syntax_highlight.py #1756

Closed
sci-42ver opened this issue Jun 4, 2023 · 4 comments
Labels

Comments

@sci-42ver
Copy link

sci-42ver commented Jun 4, 2023

Description

using latest dev branch, with set syntax-highlight-style solarized-light param, above error will be thrown

$ gdb ~/matrix-matrix-multiply/build/src/dgemm -ex 'start' -ex ''
pwndbg: loaded 141 pwndbg commands and 42 shell commands. Type pwndbg [--shell | --all] [filter] for a list.
pwndbg: created $rebase, $ida GDB functions (can be used with print/break)
Traceback (most recent call last):
  File "/home/czg/pwndbg/pwndbg/gdblib/config.py", line 93, in __get_set_string_gdb_gte_9
    trigger()
  File "/home/czg/pwndbg/pwndbg/color/syntax_highlight.py", line 37, in check_style
    get_highlight_source._reset()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'function' object has no attribute '_reset'
/home/czg/.gdbinit:19: Error in sourced command file:
Error occurred in Python: 'function' object has no attribute '_reset'

when I read $ git log -p pwndbg/commands/context.py I found nothing about _reset, but the error only exists after I upgrade python from 3.10 to 3.11.3 and pwndbg recently.

@sci-42ver sci-42ver added the bug label Jun 4, 2023
@disconnect3d
Copy link
Member

The _reset was a method to clear a cache for a given function; this method name was changed with recent caching rewrite.

@disconnect3d
Copy link
Member

This should be changed as:

- get_highlight_source._reset()
+ get_highlight_source.cache.clear()

@disconnect3d
Copy link
Member

Fwiw there are no other instances of this issue (after fixing this one):

dc@dev-vps:~/pwndbg$ rg '\._reset'
dc@dev-vps:~/pwndbg$

@disconnect3d
Copy link
Member

This has been fixed in #1757

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants