예제 #1
0
파일: py-frame.c 프로젝트: 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;
}
예제 #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;
}