enum mi_cmd_result
mi_cmd_file_list_exec_source_files (char *command, char **argv, int argc)
{
  struct symtab *s;
  struct partial_symtab *ps;
  struct objfile *objfile;

  if (!mi_valid_noargs ("mi_cmd_file_list_exec_source_files", argc, argv))
    error (_("mi_cmd_file_list_exec_source_files: Usage: No args"));

  /* Print the table header */
  ui_out_begin (uiout, ui_out_type_list, "files");

  /* Look at all of the symtabs */
  ALL_SYMTABS (objfile, s)
  {
    ui_out_begin (uiout, ui_out_type_tuple, NULL);

    ui_out_field_string (uiout, "file", s->filename);

    /* Extract the fullname if it is not known yet */
    symtab_to_fullname (s);

    if (s->fullname)
      ui_out_field_string (uiout, "fullname", s->fullname);

    ui_out_end (uiout, ui_out_type_tuple);
  }
/* A callback for map_partial_symbol_filenames.  */
static void
print_partial_file_name (const char *filename, const char *fullname,
			 void *ignore)
{
  ui_out_begin (uiout, ui_out_type_tuple, NULL);

  ui_out_field_string (uiout, "file", filename);

  if (fullname)
    ui_out_field_string (uiout, "fullname", fullname);

  ui_out_end (uiout, ui_out_type_tuple);
}
Esempio n. 3
0
void
mi_cmd_file_list_exec_source_files (char *command, char **argv, int argc)
{
  struct ui_out *uiout = current_uiout;
  struct symtab *s;
  struct objfile *objfile;

  if (!mi_valid_noargs ("-file-list-exec-source-files", argc, argv))
    error (_("-file-list-exec-source-files: Usage: No args"));

  /* Print the table header.  */
  ui_out_begin (uiout, ui_out_type_list, "files");

  /* Look at all of the symtabs.  */
  ALL_SYMTABS (objfile, s)
  {
    ui_out_begin (uiout, ui_out_type_tuple, NULL);

    ui_out_field_string (uiout, "file", symtab_to_filename_for_display (s));
    ui_out_field_string (uiout, "fullname", symtab_to_fullname (s));

    ui_out_end (uiout, ui_out_type_tuple);
  }
  /* Look at all of the psymtabs */
  ALL_PSYMTABS (objfile, ps)
  {
    if (!ps->readin)
      {
	ui_out_begin (uiout, ui_out_type_tuple, NULL);

	ui_out_field_string (uiout, "file", ps->filename);

	/* Extract the fullname if it is not known yet */
	psymtab_to_fullname (ps);

	if (ps->fullname)
	  ui_out_field_string (uiout, "fullname", ps->fullname);

	ui_out_end (uiout, ui_out_type_tuple);
      }
  }