Skip to content

Commit 24f0b38

Browse files
committed
Squashed commit of the following:
* add ppc32 (e200) architecture * add support for COFF executable format * add parser for gdb trace files * improve structs subpackage
1 parent ed579ea commit 24f0b38

34 files changed

+2787
-73
lines changed

.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the version of Python and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.10"
13+
14+
# Build documentation in the docs/ directory with Sphinx
15+
sphinx:
16+
configuration: doc/conf.py
17+
18+
# We recommend specifying your dependencies to enable reproducible builds:
19+
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20+
python:
21+
install:
22+
- requirements: requirements.txt

README.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
Amoco
33
=====
44

5-
.. image:: https://travis-ci.org/bdcht/amoco.svg?branch=release
6-
:target: https://travis-ci.org/bdcht/amoco
7-
85
.. image:: http://readthedocs.org/projects/amoco/badge/?version=latest
96
:target: http://amoco.readthedocs.io/en/latest/?badge=latest
107
:alt: Documentation Status
118

12-
139
+-----------+--------------------------------------------------+
1410
| Status: | Under Development |
1511
+-----------+--------------------------------------------------+
@@ -56,7 +52,7 @@ User documentation and API can be found at
5652
`http://amoco.readthedocs.io/en/latest/index.html`
5753

5854
.. image:: https://github.com/bdcht/amoco/blob/release/doc/gui_load.png
59-
:width: 100%
55+
:width: 800
6056

6157
Todo
6258
====
@@ -92,6 +88,13 @@ Please see `LICENSE`_.
9288
Changelog
9389
=========
9490

91+
- `v2.9.9`_
92+
93+
* add ppc32 (e200) architecture
94+
* add support for COFF executable format
95+
* add parser for gdb trace files
96+
* improve structs subpackage
97+
9598
- `v2.9.8`_
9699

97100
* update to PySide6 (Qt6)
@@ -394,6 +397,7 @@ Changelog
394397
.. _sqlalchemy: http://www.sqlalchemy.org
395398
.. _QDarkStyleSheet: https://github.com/ColinDuquesnoy/QDarkStyleSheet
396399
.. _LICENSE: https://github.com/bdcht/amoco/blob/release/LICENSE
400+
.. _v2.9.9: https://github.com/bdcht/amoco/releases/tag/v2.9.9
397401
.. _v2.9.8: https://github.com/bdcht/amoco/releases/tag/v2.9.8
398402
.. _v2.9.7: https://github.com/bdcht/amoco/releases/tag/v2.9.7
399403
.. _v2.9.6: https://github.com/bdcht/amoco/releases/tag/v2.9.6

amoco/arch/ppc32/__init__.py

Whitespace-only changes.

amoco/arch/ppc32/asm.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This code is part of Amoco
4+
# Copyright (C) 2022 Axel Tillequin (bdcht3@gmail.com)
5+
# published under GPLv2 license
6+
7+
from .env import *
8+
9+
from amoco.cas.utils import *
10+
11+
# ------------------------------------------------------------------------------
12+
# helpers and decorators :
13+
def _push_(fmap, _x):
14+
fmap[sp] = fmap[sp] - _x.length
15+
fmap[mem(sp, _x.size)] = _x
16+
17+
18+
def _pop_(fmap, _l):
19+
fmap[_l] = fmap(mem(sp, _l.size))
20+
fmap[sp] = fmap[sp] + _l.length
21+
22+
23+
def __npc(i_xxx):
24+
def npc(ins, fmap):
25+
fmap[pc] = fmap(pc) + ins.length
26+
i_xxx(ins, fmap)
27+
28+
return npc
29+
30+
31+
def trap(ins, fmap, trapname):
32+
fmap.internals["trap"] = trapname
33+
34+

amoco/arch/ppc32/cpu.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from amoco.arch.ppc32.asm import *
4+
5+
# expose "microarchitecture" (instructions semantics)
6+
uarch = dict(filter(lambda kv: kv[0].startswith("i_"), locals().items()))
7+
8+
# import specifications:
9+
from amoco.arch.core import instruction, disassembler
10+
11+
instruction_ppc32 = type("instruction_ppc32", (instruction,), {})
12+
instruction_ppc32.set_uarch(uarch)
13+
14+
from amoco.arch.ppc32.formats import PPC_full
15+
16+
instruction_ppc32.set_formatter(PPC_full)
17+
18+
# define disassembler:
19+
from amoco.arch.ppc32 import spec_booke as spec
20+
21+
endian = lambda: -1
22+
23+
disassemble = disassembler([spec], iclass=instruction_ppc32,endian=endian)
24+
25+
26+
def PC():
27+
return pc
28+
29+
def get_data_endian():
30+
return -1 # BE

amoco/arch/ppc32/cpu_e200.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from amoco.arch.ppc32.e200.asm import *
4+
5+
# expose "microarchitecture" (instructions semantics)
6+
uarch = dict(filter(lambda kv: kv[0].startswith("i_"), locals().items()))
7+
8+
# import specifications:
9+
from amoco.arch.core import instruction, disassembler
10+
11+
instruction_e200 = type("instruction_e200", (instruction,), {})
12+
instruction_e200.set_uarch(uarch)
13+
14+
from amoco.arch.ppc32.e200.formats import PPC_full
15+
16+
instruction_e200.set_formatter(PPC_full)
17+
18+
# define disassembler:
19+
from amoco.arch.ppc32.e200 import spec_vle
20+
21+
endian = lambda: -1
22+
23+
disassemble = disassembler([spec_vle], iclass=instruction_e200,endian=endian)
24+
25+
26+
def PC():
27+
return pc
28+
29+
def get_data_endian():
30+
return -1 # BE

amoco/arch/ppc32/e200/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)