Example #1
0
void CmdBreak::setClientOutput(DebuggerClient *client) {
  // Output an array of current breakpoints including exceptions
  client->setOutputType(DebuggerClient::OTValues);
  Array values;
  m_breakpoints = client->getBreakPoints();
  for (int i = 0; i < (int)m_breakpoints->size(); i++) {
    BreakPointInfoPtr bpi = m_breakpoints->at(i);
    Array breakpoint;
    breakpoint.set(s_id, bpi->index());
    breakpoint.set(s_state, bpi->state(false));
    if (bpi->m_interrupt == ExceptionThrown) {
      breakpoint.set(s_is_exception, true);
      breakpoint.set(s_exception_class, bpi->getExceptionClass());
    } else {
      breakpoint.set(s_is_exception, false);
      breakpoint.set(s_file, bpi->m_file);
      breakpoint.set(s_line1, bpi->m_line1);
      breakpoint.set(s_line2, bpi->m_line2);
      breakpoint.set(s_namespace, bpi->getNamespace());
      breakpoint.set(s_func, bpi->getFunction());
      breakpoint.set(s_class, bpi->getClass());
    }
    breakpoint.set(s_url, bpi->m_url);
    breakpoint.set(s_use_regex, bpi->m_regex);
    breakpoint.set(s_clause_type, bpi->m_check ? s_if : s_ampamp);
    breakpoint.set(s_clause, bpi->m_clause);
    breakpoint.set(s_desc, bpi->desc());
    values.append(breakpoint);
  }
  client->setOTValues(values);
}
Variant c_DebuggerClientCmdUser::t_getcurrentlocation() {
  TRACE(5, "c_DebuggerClientCmdUser::t_getcurrentlocation\n");
  BreakPointInfoPtr bpi = m_client->getCurrentLocation();
  if (!bpi) return Array::Create();
  ArrayInit ret(6);
  ret.set(s_file,      String(bpi->m_file));
  ret.set(s_line,      (int64_t)bpi->m_line1);
  ret.set(s_namespace, String(bpi->getNamespace()));
  ret.set(s_class,     String(bpi->getClass()));
  ret.set(s_function,  String(bpi->getFunction()));
  ret.set(s_text,      String(bpi->site()));
  return ret.create();
}
Example #3
0
Variant c_DebuggerClientCmdUser::t_getcurrentlocation() {
  INSTANCE_METHOD_INJECTION_BUILTIN(DebuggerClientCmdUser, DebuggerClientCmdUser::getcurrentlocation);
  BreakPointInfoPtr bpi = m_client->getCurrentLocation();
  Array ret(Array::Create());
  if (bpi) {
    ret.set("file",      String(bpi->m_file));
    ret.set("line",      (int64)bpi->m_line1);
    ret.set("namespace", String(bpi->getNamespace()));
    ret.set("class",     String(bpi->getClass()));
    ret.set("function",  String(bpi->getFunction()));
    ret.set("text",      String(bpi->site()));
  }
  return ret;
}