Exemplo n.º 1
0
Arquivo: py-frame.c Projeto: abidh/gdb
static PyObject *
frapy_str (PyObject *self)
{
  char *s;
  PyObject *result;
  struct ui_file *strfile;

  strfile = mem_fileopen ();
  fprint_frame_id (strfile, ((frame_object *) self)->frame_id);
  s = ui_file_xstrdup (strfile, NULL);
  result = PyString_FromString (s);
  xfree (s);

  return result;
}
Exemplo n.º 2
0
static int
frscm_print_frame_smob (SCM self, SCM port, scm_print_state *pstate)
{
    frame_smob *f_smob = (frame_smob *) SCM_SMOB_DATA (self);
    struct ui_file *strfile;
    char *s;

    gdbscm_printf (port, "#<%s ", frame_smob_name);

    strfile = mem_fileopen ();
    fprint_frame_id (strfile, f_smob->frame_id);
    s = ui_file_xstrdup (strfile, NULL);
    gdbscm_printf (port, "%s", s);
    ui_file_delete (strfile);
    xfree (s);

    scm_puts (">", port);

    scm_remember_upto_here_1 (self);

    /* Non-zero means success.  */
    return 1;
}