forked from bdcht/amoco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ppc32 (e200) architecture * add support for COFF executable format * add parser for gdb trace files * improve structs subpackage
- Loading branch information
Showing
34 changed files
with
2,787 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.