bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

ARM Simulator: support an environment variable and shell argument to drop into the debugger after a given number of instructions

RESOLVED FIXED in mozilla29

Status

()

Core
JavaScript Engine: JIT
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dougc, Assigned: dougc)

Tracking

unspecified
mozilla29
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
A convenient way to drop into the debugger helps debugging.  Breaking after a given number of instructions is also useful when debugging.

This patch adds the shell argument --arm-sim-stop-at and the environment variable ARM_SIM_STOP_AT.
(Assignee)

Comment 1

5 years ago
Created attachment 8367883 [details] [diff] [review]
Support an environment variable and shell argument to drop into the debugger after a given number of instructions
Attachment #8367883 - Flags: review?(jdemooij)
Comment on attachment 8367883 [details] [diff] [review]
Support an environment variable and shell argument to drop into the debugger after a given number of instructions

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

::: js/src/jit/arm/Simulator-arm.cpp
@@ +4013,5 @@
>          }
> +    } else {
> +        while (program_counter != end_sim_pc) {
> +            SimInstruction *instr = reinterpret_cast<SimInstruction *>(program_counter);
> +            if (icount_ == Simulator::StopSimAt) {

This looks good but I think we could avoid the duplication without hurting performance in the common no-limit case if we templatized execute, something like this:

template <bool HasInstructionLimit>
void
Simulator::execute()
{
    ...
    if (HasInstructionLimit && icount_ == Simulator::StopSimAt) {
        ...
    }
}

This way the compiler generates two copies of execute and will optimize the extra check away if HasInstructionLimit is false. The caller can check Simulator::StopSimAt and call execute with either HasInstructionLimit true or false.

What do you think?
Attachment #8367883 - Flags: review?(jdemooij)
(Assignee)

Comment 3

5 years ago
Created attachment 8368995 [details] [diff] [review]
Support an environment variable and shell argument to drop into the debugger after a given number of instructions

Rework to use a template.  Also account for instruction counts in the debugger.
Attachment #8367883 - Attachment is obsolete: true
Attachment #8368995 - Flags: review?(jdemooij)

Updated

5 years ago
Attachment #8368995 - Flags: review?(jdemooij) → review+
(Assignee)

Comment 4

5 years ago
Note this patch assumes that the patch in bug 966570 has been applied.  Both are ready to checkin.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/52f8f3e943d6
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.