Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
  * add ppc32 (e200) architecture
  * add support for COFF executable format
  * add parser for gdb trace files
  * improve structs subpackage
  • Loading branch information
bdcht committed Nov 20, 2023
1 parent ed579ea commit 24f0b38
Show file tree
Hide file tree
Showing 34 changed files with 2,787 additions and 73 deletions.
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: requirements.txt
14 changes: 9 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
Amoco
=====

.. image:: https://travis-ci.org/bdcht/amoco.svg?branch=release
:target: https://travis-ci.org/bdcht/amoco

.. image:: http://readthedocs.org/projects/amoco/badge/?version=latest
:target: http://amoco.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status


+-----------+--------------------------------------------------+
| Status: | Under Development |
+-----------+--------------------------------------------------+
Expand Down Expand Up @@ -56,7 +52,7 @@ User documentation and API can be found at
`http://amoco.readthedocs.io/en/latest/index.html`

.. image:: https://github.com/bdcht/amoco/blob/release/doc/gui_load.png
:width: 100%
:width: 800

Todo
====
Expand Down Expand Up @@ -92,6 +88,13 @@ Please see `LICENSE`_.
Changelog
=========

- `v2.9.9`_

* add ppc32 (e200) architecture
* add support for COFF executable format
* add parser for gdb trace files
* improve structs subpackage

- `v2.9.8`_

* update to PySide6 (Qt6)
Expand Down Expand Up @@ -394,6 +397,7 @@ Changelog
.. _sqlalchemy: http://www.sqlalchemy.org
.. _QDarkStyleSheet: https://github.com/ColinDuquesnoy/QDarkStyleSheet
.. _LICENSE: https://github.com/bdcht/amoco/blob/release/LICENSE
.. _v2.9.9: https://github.com/bdcht/amoco/releases/tag/v2.9.9
.. _v2.9.8: https://github.com/bdcht/amoco/releases/tag/v2.9.8
.. _v2.9.7: https://github.com/bdcht/amoco/releases/tag/v2.9.7
.. _v2.9.6: https://github.com/bdcht/amoco/releases/tag/v2.9.6
Expand Down
Empty file added amoco/arch/ppc32/__init__.py
Empty file.
34 changes: 34 additions & 0 deletions amoco/arch/ppc32/asm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-

# This code is part of Amoco
# Copyright (C) 2022 Axel Tillequin (bdcht3@gmail.com)
# published under GPLv2 license

from .env import *

from amoco.cas.utils import *

# ------------------------------------------------------------------------------
# helpers and decorators :
def _push_(fmap, _x):
fmap[sp] = fmap[sp] - _x.length
fmap[mem(sp, _x.size)] = _x


def _pop_(fmap, _l):
fmap[_l] = fmap(mem(sp, _l.size))
fmap[sp] = fmap[sp] + _l.length


def __npc(i_xxx):
def npc(ins, fmap):
fmap[pc] = fmap(pc) + ins.length
i_xxx(ins, fmap)

return npc


def trap(ins, fmap, trapname):
fmap.internals["trap"] = trapname


30 changes: 30 additions & 0 deletions amoco/arch/ppc32/cpu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-

from amoco.arch.ppc32.asm import *

# expose "microarchitecture" (instructions semantics)
uarch = dict(filter(lambda kv: kv[0].startswith("i_"), locals().items()))

# import specifications:
from amoco.arch.core import instruction, disassembler

instruction_ppc32 = type("instruction_ppc32", (instruction,), {})
instruction_ppc32.set_uarch(uarch)

from amoco.arch.ppc32.formats import PPC_full

instruction_ppc32.set_formatter(PPC_full)

# define disassembler:
from amoco.arch.ppc32 import spec_booke as spec

endian = lambda: -1

disassemble = disassembler([spec], iclass=instruction_ppc32,endian=endian)


def PC():
return pc

def get_data_endian():
return -1 # BE
30 changes: 30 additions & 0 deletions amoco/arch/ppc32/cpu_e200.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-

from amoco.arch.ppc32.e200.asm import *

# expose "microarchitecture" (instructions semantics)
uarch = dict(filter(lambda kv: kv[0].startswith("i_"), locals().items()))

# import specifications:
from amoco.arch.core import instruction, disassembler

instruction_e200 = type("instruction_e200", (instruction,), {})
instruction_e200.set_uarch(uarch)

from amoco.arch.ppc32.e200.formats import PPC_full

instruction_e200.set_formatter(PPC_full)

# define disassembler:
from amoco.arch.ppc32.e200 import spec_vle

endian = lambda: -1

disassemble = disassembler([spec_vle], iclass=instruction_e200,endian=endian)


def PC():
return pc

def get_data_endian():
return -1 # BE
Empty file.
Loading

0 comments on commit 24f0b38

Please sign in to comment.