Skip to content

Commit 28b33ec

Browse files
sam-f0F0Michaelf0alex
authored
LLEF 2.0 (#50)
--------- Co-authored-by: F0Michael <[email protected]> Co-authored-by: f0alex <[email protected]>
1 parent d860ced commit 28b33ec

40 files changed

+2098
-390
lines changed

.github/workflows/style.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: F0 style checking
2+
run-name: Running style checks on ${{ github.ref_name }} following push by ${{ github.actor }}
3+
4+
on: push
5+
jobs:
6+
Check-isort:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
- name: python-isort
12+
uses: isort/[email protected]
13+
with:
14+
configuration: "--check-only --profile black --diff --verbose"
15+
# Check-mypy:
16+
# runs-on: ubuntu-latest
17+
# steps:
18+
# - name: Checkout
19+
# uses: actions/checkout@v3
20+
# - name: python-mypy
21+
# uses: jpetrucciani/mypy-check@master
22+
# with:
23+
# path: '.'
24+
# mypy_flags: '--config-file .mypy.ini'
25+
Check-black:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
- name: python-black
31+
uses: psf/black@stable
32+
with:
33+
options: "--check --line-length=120"
34+
src: "."
35+
Check-flake8:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v3
40+
- name: Set up Python environment
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: "3.11"
44+
- name: flake8 Lint
45+
uses: py-actions/[email protected]
46+
with:
47+
max-line-length: "120"
48+
path: "."
49+
ignore: "E203,W503"
50+
# Check-pydocstyle:
51+
# runs-on: ubuntu-latest
52+
# steps:
53+
# - name: Checkout
54+
# uses: actions/checkout@v3
55+
# - name: pydocstyle
56+
# uses: foundryzero/[email protected]
57+
# with:
58+
# path: "."
59+
60+
# Check-pylint:
61+
# runs-on: ubuntu-latest
62+
# steps:
63+
# - name: Checkout
64+
# uses: actions/checkout@v3
65+
# - name: pylint
66+
# uses: foundryzero/[email protected]
67+
# with:
68+
# match: "binder_trace/**/*.py"
69+
# requirements_file: "binder_trace/requirements.txt"
70+
71+
Check-tox:
72+
runs-on: ubuntu-latest
73+
strategy:
74+
matrix:
75+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
76+
77+
steps:
78+
- uses: actions/checkout@v3
79+
- name: Set up Python ${{ matrix.python-version }}
80+
uses: actions/setup-python@v4
81+
with:
82+
python-version: ${{ matrix.python-version }}
83+
- name: Install dependencies
84+
run: |
85+
python -m pip install --upgrade pip
86+
python -m pip install tox tox-gh-actions
87+
- name: Test with tox
88+
run: tox

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
__pycache__/
1+
__pycache__/
2+
.venv/

.isort.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[settings]
2+
line_length = 120
3+
profile = black

.mypy.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Global options:
2+
3+
[mypy]
4+
follow_imports = silent
5+
ignore_missing_imports = True
6+
show_column_numbers = True
7+
pretty = True
8+
strict = True

.pydocstyle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pydocstyle]
2+
match = (?!test_).*\.py

.pylintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[FORMAT]
2+
max-line-length=120

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,21 @@ Settings are stored in a file `.llef` located in your home directory formatted a
5959

6060
##### Available Settings
6161

62-
| Setting | Type | Description |
63-
| ------------------ | ------- | -------------------------------------------------- |
64-
| color_output | Boolean | Enable/disable color terminal output |
65-
| register_coloring | Boolean | Enable/disable register coloring |
66-
| show_legend | Boolean | Enable/disable legend output |
67-
| show_registers | Boolean | Enable/disable registers output |
68-
| show_stack | Boolean | Enable/disable stack output |
69-
| show_code | Boolean | Enable/disable code output |
70-
| show_threads | Boolean | Enable/disable threads output |
71-
| show_trace | Boolean | Enable/disable trace output |
72-
| force_arch | String | Force register display architecture (experimental) |
73-
| rebase_addresses | Boolean | Enable/disable address rebase output |
74-
| rebase_offset | Int | Set the rebase offset (default 0x100000) |
75-
| show_all_registers | Boolean | Enable/disable extended register output |
62+
| Setting | Type | Description |
63+
| ----------------------- | ------- | -------------------------------------------------- |
64+
| color_output | Boolean | Enable/disable color terminal output |
65+
| register_coloring | Boolean | Enable/disable register coloring |
66+
| show_legend | Boolean | Enable/disable legend output |
67+
| show_registers | Boolean | Enable/disable registers output |
68+
| show_stack | Boolean | Enable/disable stack output |
69+
| show_code | Boolean | Enable/disable code output |
70+
| show_threads | Boolean | Enable/disable threads output |
71+
| show_trace | Boolean | Enable/disable trace output |
72+
| force_arch | String | Force register display architecture (experimental) |
73+
| rebase_addresses | Boolean | Enable/disable address rebase output |
74+
| rebase_offset | Int | Set the rebase offset (default 0x100000) |
75+
| show_all_registers | Boolean | Enable/disable extended register output |
76+
| enable_darwin_heap_scan | Boolean | Enable/disable more accurate heap scanning for Darwin-based platforms. Uses the Darwin malloc introspection API, executing code in the address space of the target application using LLDB's evaluation engine. |
7677

7778
#### llefcolorsettings
7879
Allows setting LLEF GUI colors:

arch/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Arch module __init__.py"""
2+
23
from typing import Type
34

45
from lldb import SBTarget
@@ -7,10 +8,11 @@
78
from arch.arm import Arm
89
from arch.base_arch import BaseArch
910
from arch.i386 import I386
10-
from arch.x86_64 import X86_64
1111
from arch.ppc import PPC
12+
from arch.x86_64 import X86_64
1213
from common.constants import MSG_TYPE
13-
from common.util import extract_arch_from_triple, print_message
14+
from common.output_util import print_message
15+
from common.util import extract_arch_from_triple
1416

1517
# macOS devices running arm chips identify as arm64.
1618
# aarch64 and arm64 backends have been merged, so alias arm64 to aarch64.
@@ -23,7 +25,7 @@
2325
"aarch64": Aarch64,
2426
"arm64": Aarch64,
2527
"arm64e": Aarch64,
26-
"powerpc": PPC
28+
"powerpc": PPC,
2729
}
2830

2931

arch/aarch64.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,4 @@ class Aarch64(BaseArch):
6868
"m": 0xF,
6969
}
7070

71-
flag_registers = [
72-
FlagRegister("cpsr", _cpsr_register_bit_masks)
73-
]
71+
flag_registers = [FlagRegister("cpsr", _cpsr_register_bit_masks)]

arch/arm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,4 @@ class Arm(BaseArch):
4747
"t": 0x20,
4848
}
4949

50-
flag_registers = [
51-
FlagRegister("cpsr", _cpsr_register_bit_masks)
52-
]
50+
flag_registers = [FlagRegister("cpsr", _cpsr_register_bit_masks)]

0 commit comments

Comments
 (0)