Comments (3)
Recomputing offsets on the fly is not going to happen. ToString is just a debug helper. If you need to print the instructions for debugging purpose, you can pay the price of recomputing the offsets.
from cecil.
If it's not going to happen, so be it.
It's a shame though. Debugging (by which I mean stepping though code in a debugger, not tracing) is very difficult without a ToString(). And branch instructions are unreadable without a correct offset (and that means correct all the time, not just after I fixed them).
To be precise, the offsets don't need to be correct per se, as long as Instruction.Previous.Offset < Instruction.Offset < Instruction.Next.Offset. The index in the collection would be just fine for this purpose, but that is not available in Instruction.ToString().
Anyway, I forked the code. Turns out the offset fixup in InstructionCollection is actually very easy and fast. Looks like I might spend a lot of time merging. But I'm sure I'll still win by being able to debug efficiently.
Thanks anyway.
from cecil.
Of course it's easy, of course it's fast, it's just not necessary for a non debugging scenario. Anyway, this enhancement ticket is about getting an Instruction.ToString, which is in now.
from cecil.
Related Issues (20)
- Unity 2022 Queue.Clear Resolve returns null.
- No way to sign a netstandard assembly from a .NET >=6 app? HOT 1
- Specified method is not supported. HOT 1
- .NET Framework 4.8.1 - Failed to resolve assembly: netstandard, Version=2.0.0.0 HOT 3
- Easiest way to map document paths in portable [embedded] PDBs?
- Stack overflow when running tests
- Failed to extract SQLite.SQLiteException
- Exception when writing assembly with a null call instruction HOT 1
- Link in README goes to betting site HOT 2
- Problem with weawing
- Possible ArgumentOutOfRangeException when there are 65535 params in metadata table HOT 3
- how to modify PrivateImplementationDetails
- Remove link in the about section in this repo HOT 1
- Mono.ArgumentNullOrEmptyException When trying to write embedded symbols assembly to stream
- How can I set constant value to an enum field when creating a new enum
- How can i read uncompiled CS files HOT 2
- Bug: PInvoke information is not saved to assembly properly
- failed to add arguments to attributes that accepts objects HOT 1
- Type parameter constraint in patched class breaks on newer Mono.Cecil version HOT 6
- Add the ability to create Instructions without the appropriate operand type HOT 1
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 cecil.