This is the mail archive of the gdb-cvs@sourceware.org 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]

gdb and binutils branch master updated. 87186c6a5ccf857d7f4e55478dda3aa06387c3c4


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  87186c6a5ccf857d7f4e55478dda3aa06387c3c4 (commit)
      from  bd040da1dbb7e6640440f306ddf993af98441851 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=87186c6a5ccf857d7f4e55478dda3aa06387c3c4

commit 87186c6a5ccf857d7f4e55478dda3aa06387c3c4
Author: Mihail-Marian Nistor <mihail.nistor@freescale.com>
Date:   Sat Dec 20 11:04:44 2014 -0500

    gdb/17394: cannot put breakpoint only in selected ASM file.
    
    This patch fixes a problem when trying to insert a breakpoint on
    a specific symbol defined in a specific file, eg:
    
        break foo.c:func
    
    This currently works for files in C/C++/Ada, etc, but doesn't always
    work for Asm files. Analysis of the problem showed that this related
    to a limitation in gas, which does not generate debug info for functions/
    symbols.  Thus, we have a symtab for the file ("info sources" shows
    the file), but it contains no symbols.
    
    When find_linespec_symbols is called in linespec_parse_basic, it calls
    find_function_symbols, which uses add_matching_symbols_to_info to
    collect all matching symbols.
    
    That function does [pardon any mangled formatting]:
    
      for (ix = 0; VEC_iterate (symtab_ptr, info->file_symtabs, ix, elt); ++ix)
        {
          if (elt == NULL)
            {
              iterate_over_all_matching_symtabs (info->state, name, VAR_DOMAIN,
                                                 collect_symbols, info,
                                                 pspace, 1);
              search_minsyms_for_name (info, name, pspace);
            }
          else if (pspace == NULL || pspace == SYMTAB_PSPACE (elt))
            {
              /* Program spaces that are executing startup should have
                 been filtered out earlier.  */
              gdb_assert (!SYMTAB_PSPACE (elt)->executing_startup);
              set_current_program_space (SYMTAB_PSPACE (elt));
              iterate_over_file_blocks (elt, name, VAR_DOMAIN,
                                        collect_symbols, info);
            }
        }
    
    This iterates over the symtabs. In the failing use case, ELT is
    non-NULL (points to the symtab for the .s file), so it calls
    iterate_over_file_blocks. Herein is where the problem exists: it is
    assumed that if NAME exists, it must exist in the given symtab -- a
    reasonable assumption for "normal" (non-asm) cases. It never searches
    minimal symbols (or in the global default symtab).
    
    This patch fixes the problem by doing so. It is important to note that
    iterating over minsyms is fairly expensive, so this patch only adds
    that extra search if the language is language_asm and
    iterate_over_file_blocks returns no symbols.
    
    gdb/ChangeLog:
    2014-12-20  Keith Seitz  <keiths@redhat.com>
                Mihail-Marian Nistor  <mihail.nistor@freescale.com>
    
            PR gdb/17394
            * linespec.c (struct collect_minsyms): Add new member `symtab'.
            (add_minsym): Handle cases where info.symtab is non-NULL.
            (search_minsyms_for_name): Add new parameter `symtab'.
            Handle limiting searches to a specific symtab.
            (add_matching_symtabs_to_info): Search through minimal symbols
            for language_asm files for which no new symbols are found.
    
    gdb/testsuite/ChangeLog:
    2014-12-20  Mihail-Marian Nistor  <mihail.nistor@freescale.com>
    
            PR gdb/17394
            * gdb.linespec/break-asm-file.c: New file.
            * gdb.linespec/break-asm-file.exp: New file.
            * gdb.linespec/break-asm-file0.s: New file.
            * gdb.linespec/break-asm-file1.s: New file.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                                 |   11 +
 gdb/linespec.c                                |   97 ++++++++---
 gdb/testsuite/ChangeLog                       |    8 +
 gdb/testsuite/gdb.linespec/break-asm-file.c   |   35 ++++
 gdb/testsuite/gdb.linespec/break-asm-file.exp |   55 ++++++
 gdb/testsuite/gdb.linespec/break-asm-file0.s  |  218 ++++++++++++++++++++++
 gdb/testsuite/gdb.linespec/break-asm-file1.s  |  244 +++++++++++++++++++++++++
 7 files changed, 644 insertions(+), 24 deletions(-)
 create mode 100644 gdb/testsuite/gdb.linespec/break-asm-file.c
 create mode 100644 gdb/testsuite/gdb.linespec/break-asm-file.exp
 create mode 100644 gdb/testsuite/gdb.linespec/break-asm-file0.s
 create mode 100644 gdb/testsuite/gdb.linespec/break-asm-file1.s


hooks/post-receive
-- 
gdb and binutils


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