The main aim of these changes is to support `ret` instructions (that are
indirect jumps), so that function calls can now work properly.
* Emit a dummy call to a `@newPC` function to record where a new
instruction in the original assembly started, what is its PC and its
size. The `Size` parameter for these function call is initially zero,
and it's updated later when a new instruction is met or the current
basic block is terminated. All these calls, before the final emission
of the IR are removed `InstructionTranslator::removeNewPCMarkers`.
* Transform translateMoveToPC into an LLVM pass
(`TranslateDirectBranchesPass`).
* Implement `getNextPC`, which returns the next program counter by
looking for a call to `@newpc` in the current basic block, and,
recursively, in all the basic blocks dominating the current one. This
function is used to force exploration of the basic block coming after
a direct jump, which is paritcularly useful in case of a function call.
* Introduce `translateIndirectJumps`, which translates all the leftover
writes to the PC, i.e. all the indirect ones, by diverting execution
to a large switch statement mapping addresses in the original program
to the corresponding basic blocks in the translated program.
* Introduce `function_call`, a simple test for function calls.
* Other minor changes and whitespace fixes.
* mmap on the PTC side before doing any translation
* Update usages of virtual addresses
* Refactor options to have --load-at and --entry
* Update tests according to the changes
* Implement an handler for PTC_INSTRUCTION_op_debug_insn_start
* Implement an handler for calls to helpers
* Implement an handler for all the remaining instructions
* Discover automatically path of the helpers module
* Import the IRReader module
* Remove support for predefined global variables
* Implement getByCPUStateOffset which returns or creates a global
variable from an offset in the CPUState structure
* Remove the VariableManager::createGlobal function
* Implement getTypeAtOffset which searches for the data type at the
specified offset, recursively exploring sub-structs
* Autodetect the CPUState structure by election on the struct parameters
of the helper functions
* CodeGenerator::translate returns void
* Multiplication should sign-extend, not zero-extend
* Fix wrong update of alloca insertion point
* Implement PTC_INSTRUCTION_op_mul{u,s}2_i{32,64} instructions
* Don't output a source line if it's identical to the last printed one
* Invoke DIBuilder::finalize as appropriate
* Fix off-by-one in line number computation
* Create the CodeGenerator class from most of the logic that was in the
Translate function.
* Extract debug information handling logic from the Translate function and move
it into the DebugManager class.
* Add include guards.
* Remove some dead code and add and fix documentation.
* Add support to specify a path for debug source
* Annotate generated LLVM with original assembly and PTC
* As debug source, use the same .ll as the compiled one
* Convert ptcdump.cpp to use streams and export more fine-grained functions
* Add documentation to ptcdump.h
* Create metadata for the original instruction when a
PTC_INSTRUCTION_op_debug_insn_start instruction is met.