diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-10-24 23:17:43 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-10-24 23:17:43 -0700 |
commit | e0a0484c9faf561ab53f915ad9573c0803966faf (patch) | |
tree | ca8e96c69de592e9b88171c2e921ad3c9a70b362 /subx/012elf.cc | |
parent | 6f37250dd9d81c812fb5eddd747d237d94fff9b2 (diff) | |
download | mu-e0a0484c9faf561ab53f915ad9573c0803966faf.tar.gz |
4723
Fix CI.
Diffstat (limited to 'subx/012elf.cc')
-rw-r--r-- | subx/012elf.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/subx/012elf.cc b/subx/012elf.cc index 28064a1e..3f8187ba 100644 --- a/subx/012elf.cc +++ b/subx/012elf.cc @@ -138,6 +138,15 @@ const int STACK_SEGMENT = 0x0b000000; const int AFTER_STACK = 0x0b000ffc; // forget final word because of the off-by-one with INITIAL_SEGMENT_SIZE; const int ARGV_DATA_SEGMENT = 0x0c000000; :(code) +void dump_stack() { + cerr << "stack:\n"; + for (uint32_t a = AFTER_STACK-4; a > Reg[ESP].u; a -= 4) + cerr << " 0x" << HEXWORD << a << " => 0x" << HEXWORD << read_mem_u32(a) << '\n'; + cerr << " 0x" << HEXWORD << Reg[ESP].u << " => 0x" << HEXWORD << read_mem_u32(Reg[ESP].u) << " <=== ESP\n"; + for (uint32_t a = Reg[ESP].u-4; a > Reg[ESP].u-40; a -= 4) + cerr << " 0x" << HEXWORD << a << " => 0x" << HEXWORD << read_mem_u32(a) << '\n'; +} + inline uint32_t u32_in(uint8_t* p) { return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24; } |