Only resetting the foreground or background colors results in generating wrong colors in the TUI.
The workaround is to avoid the sequences that only reset the colors and replace them with a full reset sequence. It resets other styling attributes like bold too but it's better than having wrong colors.
Refs #2654
* Create an authoritative list of architectures that Pwndbg supports. Add test to ensure some important mappings exist - add i8086 pwnlib mapping
* make pwnlib mapping 'none' by default
* Update pwndbg/dbg/gdb/__init__.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* Update pwndbg/lib/arch.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* Update pwndbg/lib/arch.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* More type safety with the list of supported types, handle iwmmxt, iwmmxt2, and xscale manually
---------
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* lldb: port version and bugreport commands + refactor
Port `version` and `bugreport` commands to LLDB.
Additionally, refactor them to provide better information and be less
bloated.
* fix lint
* fix lint
* fix lint
* lldb: add support for attaching via `attach <pid|name>`
This commit adds support for the `attach <pid|name>` command so that it
can attach to a pid or full process name similarly to as in LLDB.
Please note that this LLDB command is a bit confusing.
It may seem it is an alias for `process attach` as in here:
```
(lldb) attach -n -w htop
error: 'process attach' doesn't take any arguments.
```
However, in practice it is not. It is an alias for `_regexp-attach`:
```
(lldb) help attach
Attach to process by ID or name. Expects 'raw' input (see 'help raw-input'.)
Syntax: _regexp-attach <pid> | <process-name>
'attach' is an abbreviation for '_regexp-attach'
```
...which has its own problems:
1) it does not perform any regexp match in practice. passing `hto.*`,
`hto?` or `hto[p]` will not attach to `htop`. One must pass the full process name like `htop`.
2) it can work without arguments, which is stupid and we should not
support it?:
```
(lldb) _regexp-attach
There is a running process, detach from it and attach?: [Y/n] y
Process 56358 detached
Process 56358 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007ff8118bedd2 libsystem_kernel.dylib`__select + 10
libsystem_kernel.dylib`__select:
-> 0x7ff8118bedd2 <+10>: jae 0x7ff8118beddc ; <+20>
0x7ff8118bedd4 <+12>: movq %rax, %rdi
0x7ff8118bedd7 <+15>: jmp 0x7ff8118b737b ; cerror
0x7ff8118beddc <+20>: retq
```
* fixup
* Update pwndbg/dbg/lldb/repl/__init__.py
Co-authored-by: Matt. <dark.ryu.550@gmail.com>
---------
Co-authored-by: Matt. <dark.ryu.550@gmail.com>
* Support for loongarch64. Add Loongarch64 register set definition, make a ManualPwndbgInstruction to define an instruction without a Capstone object underlying it, and detect Loongarch64 on GDB
* Update pwndbg/aglib/disasm/instruction.py
* Use Python Protocols to create an interface that the two PwndbgInstruction implementations conform to + make suggested changes
---------
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
- select a matching lexer based on filename only
- dramatically speeds up time of the first `context` when there is debug
source code that needs to be highlighted (3-4x speedup, from 0.8s to
0.2s on my machine)
- the only chance that a lexer can be selected wrong is when a plugin lexer
has the same filename pattern as a built-in lexer (in which case the
built-in lexer will always be used)