This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] new GDB/MI command: -symbol-info-linetable


Elena,

Thank you for reviewing my changes and for the constructive feedback.
I have incorporated all your suggestions, as well as the one from Bob
Rossi who kindly informed me that the MI documentation had been merged
gdb/doc/gdb.texinfo, and this is where I added my new documentation.

Here is the updated ChangeLog:

2003-04-18  Thierry Schneider  <tpschneider1 at yahoo dot com>

         * mi-cmds.h (mi_cmd_symbol_list_lines): Add declaration.
         * mi-cmds.c (mi_cmds): Add entry for new MI command.
         * mi-cmd-symbol.c (mi_cmd_symbol_list_lines): New source file
         for all symbol-related commands.

2003-04-18  Thierry Schneider  <tpschneider1 at yahoo dot com>

         * gdb.texinfo (section GDB/MI Symbol Query): Add documentation
         for new MI command.

2003-04-18  Thierry Schneider  <tpschneider1 at yahoo dot com>

         * mi1-symbol.exp (-symbol-list-lines): New test file to
         validate all symbol-related commands

>  > I unfortunately do not have a valid FSF assignement on file, yet.
>  > I have sent my application to the FSF, and I am waiting for the papers
>  > to arrive by mail.
>  > 
> 
> I think this has been sorted out now, right?

Yes, I now have an FSF assignment on file.

Thierry S.

Attachment: all_diffs
Description: all_diffs

/* MI Command Set - symbol commands.
   Copyright 2003 Free Software Foundation, Inc.

   This file is part of GDB.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

#include "defs.h"
#include "mi-cmds.h"
#include "symtab.h"
#include "ui-out.h"

/* SYMBOL-LIST-LINES:

   Print the list of all pc addresses and lines of code for
   the provided (full or base) source file name.  The entries
   are sorted in ascending PC order. */

enum mi_cmd_result
mi_cmd_symbol_list_lines (char *command, char **argv, int argc)
{
  char *filename;
  struct symtab *s;
  int i;
  struct cleanup *cleanup_stack, *cleanup_tuple;

  if (argc != 1)
    error ("mi_cmd_symbol_list_lines: Usage: SOURCE_FILENAME");

  filename = argv[0];
  s = lookup_symtab (filename);

  if (s == NULL)
    error ("mi_cmd_symbol_list_lines: Unknown source file name.");

  /* Now, dump the associated line table.  The pc addresses are already
     sorted by increasing values in the symbol table, so no need to
     perform any other sorting. */

  cleanup_stack = make_cleanup_ui_out_list_begin_end (uiout, "lines");

  if (LINETABLE (s) != NULL && LINETABLE (s)->nitems > 0)
    for (i = 0; i < LINETABLE (s)->nitems; i++)
    {
      cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
      ui_out_field_core_addr (uiout, "pc", LINETABLE (s)->item[i].pc);
      ui_out_field_int (uiout, "line", LINETABLE (s)->item[i].line);
      do_cleanups (cleanup_tuple);
    }

  do_cleanups (cleanup_stack);

  return MI_CMD_DONE;
}

Attachment: mi1-symbol.exp
Description: mi1-symbol.exp


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]