Comments (12)
I prefer the syntax
[[reko::register("D0",0,8)]]
[[reko::register("A1")]]
[[reko::stack]]
using namespaces to qualify the attribute and avoiding having to parse a string "0:8" when looking at byte slices.
It seems to me that specifying a byte slice (0,8) is redundant in
[[reko_partial_location(reg_D0,"0:8")]] BYTE SetTaskPri(...
since the function declaration already specifies the return type. Agree?
I should be able to write an implementation of this in a couple of days. Just want to make sure that we're in agreement on what the syntax is.
from reko.
As for syntax - yes, I realize that parametrization for other machines/environments will be much easier if register names are not hard-coded into attributes 😄
As for redundant slice..
- It's from auto-transformed code - might actually be redundant
- unlikely The function actually preserves the higher bits of D0 ?
when the support for this kind of attributes is 'in' we might steal boomerang's idea of allowing specifying full stack locations and have something like:
[[reko:memory("SP",-4)]]
from reko.
I've started implementing this on c2xml_attributes branch
from reko.
The token register
is a reserved keyword in C/C++. Please switch to reg
.
from reko.
Replaced 'register' with 'reg' in 52b3751
from reko.
I just checked in the C parser portion, following quite closely the C++11 spec section 7.6. In particular, the spec indicates that between [[reko::reg(
and )]]
, any list of balanced tokens is allowed. This means that the new class CAttribute
contains a list of tokens, and it is the job of the compiler/reko to interpret those tokens correctly. Right now, the interpretation is easy:
[[reko::reg( <StringConstant> )]]
for register declarations
[[reko::mem( <StringConstant> <Comma> (<Minus>) <Integer> )]]
for memory declarations
from reko.
Feature implemented in master
. Now all we have to do is make reko recognize the services as A6-based. That's a different issue . Please verify that you can build and run any tests you think appropriate, then close.
from reko.
Awesome 😄
I've fixed a few problems in the exec_functions header, but there is one feature missing -> handling the bit selection in reg attribute.
- I could remove the bit selection from the header, but that will remove some of the data decompilation might find useful ?
- Or I might extended attr handling to preserve the bit-range in Register_v1 class ?
from reko.
Leave the bits in the file; the current implementation of [[reko::reg]]
will just ignore them. Bit slice handling is should be handled generically by ApplicationBuilder
.
Reko has an internal issue, which is the representation of data in registers which may be smaller than the register size itself. On the x86 we are lucky because the processor has aliases for the smaller pieces of the register (rax, eax, ax, al) but many other architectures like m68k and PowerPC don't. I expect I will have to take a look at ApplicationBuilder
and its related classes to see what can be done.
In the meantime, can we consider this issue resolved? Attributes can now be specified, and we can add more, like [[noreturn]], which is a standard attribute that indicates that procedures don't return (think exit(int n)
).
from reko.
This fails
void f([[reko::reg("D0",0,4)]] int intNum);
with:
System.FormatException: [[reko::reg]] attribute expects a register name.
since GetArgumentKindFromAttributes
if (attr.Tokens.Count != 1 || attr.Tokens[0].Type != CTokenType.StringLiteral)
throw new FormatException("[[reko::reg]] attribute expects a register name.");
kind = new Register_v1 { Name = (string)attr.Tokens[0].Value };
from reko.
Fixed now.
from reko.
The file is parsed correctly now
from reko.
Related Issues (20)
- Multidimensional array can not be reconstructed if memory accesses are done at another statements
- cannot build solution HOT 8
- RISC-V: Missing instructions from H and Q extensions HOT 1
- RISC-V: missing c.slli64, c.srai64, c.srli64 hint instructions HOT 1
- Unable to cast object of type 'Reko.ImageLoaders.Omf.OmfLoader' to type 'Reko.Core.Loading.ImageLoader' HOT 3
- no binary output after building on Ubuntu HOT 2
- Disassembly view now corrupts at the start of some procedures. MASTER: WindowsDecompiler HOT 2
- Crash at 'reconstruct data types' HOT 2
- can not open csky elf HOT 2
- Several bugs found: incorrect function argument order, double type value, and strings HOT 2
- Unexpected argument order when decompiling program
- Reko fails to recover floating-point code
- Reko doesn't generate any decompiled code
- Problems with type inference around `printf`
- No string literals are generated
- incomplete control flow recovery HOT 1
- reko crash during "Finish Decompilation" step with Alone in the Dark HOT 3
- MASTER - WINDOWS Decompiler - popup of target call is empty
- MASTER - M68K switch statement fail
- To run this application, you must install .NET Core. HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reko.