SCRYMAMEReferenceMachinecpu_info

MAMEMachine

cpu_info

List each cpu as the debugger sees it: visible, ignored or suspended, its program counter, and the breakpoints and watches set on it.

cpu_info(cpu="")

Try it

On Gridlee, a free ROM from mamedev.org, stopped at reset, right after start.
Ask

Which cpus does this machine have, and which one is the debugger showing?

Call
cpu_info()
Reply 1 of 4 fields
{
  "cpus": [
    {
      "cpu": ":maincpu",
      "visible": true,
      "ignored": false,
      "suspended": false,
      "pc": {"reg": "PC", "value": "0x0000f000"},
      "declarations": {"breakpoints": 0, "watches": 0, "regpoints": 0}
    }
  ]
}

Gridlee has one cpu, :maincpu. It is the visible one, which a call that names no cpu acts on; it sits at 0xf000 and nothing is set on it yet.

The whole reply
JSON
{
  "summary": "cpu_info: 1 cpu, :maincpu visible",
  "status": "ok",
  "cpus": [
    {
      "cpu": ":maincpu",
      "visible": true,
      "ignored": false,
      "suspended": false,
      "pc": {"reg": "PC", "value": "0x0000f000"},
      "declarations": {"breakpoints": 0, "watches": 0, "regpoints": 0}
    }
  ],
  "cpu": {"available": false, "why": "no cpu was named, so the rows are every cpu's"}
}

Arguments

cpu string, default ""
The tag of one cpu: only its row comes back and only its pc is read. Left empty, every cpu is listed.

What comes back

cpus
One row per cpu: its tag cpu, visible, ignored, suspended, its program counter pc, and declarations, the count of what is set on it.
cpu
The full tag of the cpu you named; with none named, an object that says so.
All 2 reply fields
  • cpu (string or object)
  • cpus (array)

What it refuses

Why it works this way

Answering runs nothing and makes no cpu visible: the flags come from the debugger's own listings and each pc is read as a register. visible marks the cpu that a call naming none acts on, and a stop moves it. ignored means breakpoints and watches on that cpu have no effect.

A pc is unavailable, with the reason, while the program runs, and for every cpu but the first where MAME's gdbstub serves one cpu. A cpu the board itself holds in reset or halted shows nowhere: telling would mean moving the machine.

More on why
  • declarations counts breakpoints, watches and regpoints, armed or not. A regpoint is MAME's registerpoint, a stop on a condition over registers.
  • A watch on an io port counts; one on a debugger expression belongs to no cpu and is not counted.
  • suspended is the debugger's own suspend.
  • Rows follow the debugger's cpulist, then any other cpu a saved breakpoint or watch names; of such a cpu only the counts are read.
The contract your client receives
Text
What the debugger sees of each cpu now: visibility, ignored or suspended, program counter,
and how many breakpoints, watches and registerpoints are declared on it. Moves nothing;
answers on a running machine.

Arguments: `cpu`, a tag in either spelling (`subcpu` or `:subcpu`), narrows the rows.

Refused: a tag no row names (`unknown_ref`); no machine (`no_session`); a broken session
(`session_broken`).

Reply: `cpus` (each `cpu`, `visible`, `ignored`, `suspended`, `pc`, `declarations`), `cpu`.

Reference: REFERENCE.md, The session.
Tools