Closed Bug 1309178 Opened 8 years ago Closed 8 years ago

ARM simulator: add disassembler calls

Categories

(Core :: JavaScript Engine: JIT, defect, P2)

ARM
All
defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: lth, Assigned: lth)

Details

Attachments

(1 file)

When we crash in a MOZ_CRASH, as for an alignment fault, it is useful to be sitting in GDB and just calling the simulator's disassembler for the offending instruction.  This bug adds lightweight infrastructure around that.
A static 'disassemble()' method and some instance 'disasm()' methods, with instructions for use.
Attachment #8799704 - Flags: review?(bbouvier)
Comment on attachment 8799704 [details] [diff] [review]
bug1309178-disasm-hooks.patch

Review of attachment 8799704 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, I didn't know we already had an ARM disassembler...

::: js/src/jit/arm/Simulator-arm.cpp
@@ +449,5 @@
> +
> +void
> +Simulator::disasm(SimInstruction* instr, size_t m, size_t n)
> +{
> +    disassemble(reinterpret_cast<SimInstruction*>(reinterpret_cast<uint8_t*>(instr)-m*4), n);

nit: spaces please!

Also, isn't sizeof(SimInstruction) == sizeof(uint8_t*)? (at least true for a real ARM32 instruction) If so, this could be rewritten disassemble(instr - m, n); (and we could static_assert sizes are the same)
Attachment #8799704 - Flags: review?(bbouvier) → review+
Note, the patch for this landed but the bug number was incorrectly recorded in the commit message due to an editing error during final amendation (that's right, blame 'vi'):

https://hg.mozilla.org/integration/mozilla-inbound/rev/c659503d33ce1cbda585c18e138c0978b46ad7f4
Bug 1309180: Add interactive disasm calls to ARM simulator. r=bbouvier
Pushed by ihsiao@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b3e5f283589
Add interactive disasm calls to ARM simulator. r=bbouvier
https://hg.mozilla.org/mozilla-central/rev/5b3e5f283589
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: