~ubuntu-branches/debian/jessie/gdb/jessie

« back to all changes in this revision

Viewing changes to gdb/xcoffread.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Jacobowitz
  • Date: 2010-03-20 01:21:29 UTC
  • mfrom: (1.3.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100320012129-t7h25y8zgr8c2369
Tags: 7.1-1
* New upstream release, including:
  - PIE support (Closes: #346409).
  - C++ improvements, including static_cast<> et al, namespace imports,
    and bug fixes in printing virtual base classes.
  - Multi-program debugging.  One GDB can now debug multiple programs
    at the same time.
  - Python scripting improvements, including gdb.parse_and_eval.
  - Updated MIPS Linux signal frame layout (Closes: #570875).
  - No internal error stepping over _dl_debug_state (Closes: #569551).
* Update to Standards-Version: 3.8.4 (no changes required).
* Include more relevant (and smaller) docs in the gdbserver package
  (Closes: #571132).
* Do not duplicate documentation in gdb64, gdb-source, and libgdb-dev.
* Fix crash when switching into TUI mode (Closes: #568489).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Read AIX xcoff symbol tables and convert to internal format, for GDB.
2
2
   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
3
 
   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009
4
 
   Free Software Foundation, Inc.
 
3
   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009,
 
4
   2010 Free Software Foundation, Inc.
5
5
   Derived from coffread.c, dbxread.c, and a lot of hacking.
6
6
   Contributed by IBM Corporation.
7
7
 
2048
2048
 
2049
2049
  sort_pst_symbols (pst);
2050
2050
 
2051
 
  /* If there is already a psymtab or symtab for a file of this name,
2052
 
     remove it.  (If there is a symtab, more drastic things also
2053
 
     happen.)  This happens in VxWorks.  */
2054
 
  free_named_symtabs (pst->filename);
2055
 
 
2056
2051
  if (num_includes == 0
2057
2052
      && number_dependencies == 0
2058
2053
      && pst->n_global_syms == 0
2606
2601
                  namestring = gdbarch_static_transform_name
2607
2602
                                 (gdbarch, namestring);
2608
2603
 
2609
 
                add_psymbol_to_list (namestring, p - namestring,
 
2604
                add_psymbol_to_list (namestring, p - namestring, 1,
2610
2605
                                     VAR_DOMAIN, LOC_STATIC,
2611
2606
                                     &objfile->static_psymbols,
2612
2607
                                     0, symbol.n_value,
2617
2612
                symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
2618
2613
                /* The addresses in these entries are reported to be
2619
2614
                   wrong.  See the code that reads 'G's for symtabs. */
2620
 
                add_psymbol_to_list (namestring, p - namestring,
 
2615
                add_psymbol_to_list (namestring, p - namestring, 1,
2621
2616
                                     VAR_DOMAIN, LOC_STATIC,
2622
2617
                                     &objfile->global_psymbols,
2623
2618
                                     0, symbol.n_value,
2635
2630
                    || (p == namestring + 1
2636
2631
                        && namestring[0] != ' '))
2637
2632
                  {
2638
 
                    add_psymbol_to_list (namestring, p - namestring,
 
2633
                    add_psymbol_to_list (namestring, p - namestring, 1,
2639
2634
                                         STRUCT_DOMAIN, LOC_TYPEDEF,
2640
2635
                                         &objfile->static_psymbols,
2641
2636
                                         symbol.n_value, 0,
2643
2638
                    if (p[2] == 't')
2644
2639
                      {
2645
2640
                        /* Also a typedef with the same name.  */
2646
 
                        add_psymbol_to_list (namestring, p - namestring,
 
2641
                        add_psymbol_to_list (namestring, p - namestring, 1,
2647
2642
                                             VAR_DOMAIN, LOC_TYPEDEF,
2648
2643
                                             &objfile->static_psymbols,
2649
2644
                                             symbol.n_value, 0,
2656
2651
              case 't':
2657
2652
                if (p != namestring)    /* a name is there, not just :T... */
2658
2653
                  {
2659
 
                    add_psymbol_to_list (namestring, p - namestring,
 
2654
                    add_psymbol_to_list (namestring, p - namestring, 1,
2660
2655
                                         VAR_DOMAIN, LOC_TYPEDEF,
2661
2656
                                         &objfile->static_psymbols,
2662
2657
                                         symbol.n_value, 0,
2718
2713
                          ;
2719
2714
                        /* Note that the value doesn't matter for
2720
2715
                           enum constants in psymtabs, just in symtabs.  */
2721
 
                        add_psymbol_to_list (p, q - p,
 
2716
                        add_psymbol_to_list (p, q - p, 1,
2722
2717
                                             VAR_DOMAIN, LOC_CONST,
2723
2718
                                             &objfile->static_psymbols, 0,
2724
2719
                                             0, psymtab_language, objfile);
2736
2731
 
2737
2732
              case 'c':
2738
2733
                /* Constant, e.g. from "const" in Pascal.  */
2739
 
                add_psymbol_to_list (namestring, p - namestring,
 
2734
                add_psymbol_to_list (namestring, p - namestring, 1,
2740
2735
                                     VAR_DOMAIN, LOC_CONST,
2741
2736
                                     &objfile->static_psymbols, symbol.n_value,
2742
2737
                                     0, psymtab_language, objfile);
2753
2748
                    xfree (name);
2754
2749
                  }
2755
2750
                symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
2756
 
                add_psymbol_to_list (namestring, p - namestring,
 
2751
                add_psymbol_to_list (namestring, p - namestring, 1,
2757
2752
                                     VAR_DOMAIN, LOC_BLOCK,
2758
2753
                                     &objfile->static_psymbols,
2759
2754
                                     0, symbol.n_value,
2782
2777
                  continue;
2783
2778
 
2784
2779
                symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
2785
 
                add_psymbol_to_list (namestring, p - namestring,
 
2780
                add_psymbol_to_list (namestring, p - namestring, 1,
2786
2781
                                     VAR_DOMAIN, LOC_BLOCK,
2787
2782
                                     &objfile->global_psymbols,
2788
2783
                                     0, symbol.n_value,
2868
2863
 
2869
2864
   SECTION_OFFSETS contains offsets relative to which the symbols in the
2870
2865
   various sections are (depending where the sections were actually loaded).
2871
 
   MAINLINE is true if we are reading the main symbol
2872
 
   table (as opposed to a shared lib or dynamically loaded file).  */
 
2866
*/
2873
2867
 
2874
2868
static void
2875
 
xcoff_initial_scan (struct objfile *objfile, int mainline)
 
2869
xcoff_initial_scan (struct objfile *objfile, int symfile_flags)
2876
2870
{
2877
2871
  bfd *abfd;
2878
2872
  int val;
2948
2942
    perror_with_name (_("reading symbol table"));
2949
2943
 
2950
2944
  /* If we are reinitializing, or if we have never loaded syms yet, init */
2951
 
  if (mainline
2952
 
      || (objfile->global_psymbols.size == 0
2953
 
          && objfile->static_psymbols.size == 0))
 
2945
  if (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)
2954
2946
    /* I'm not sure how how good num_symbols is; the rule of thumb in
2955
2947
       init_psymbol_list was developed for a.out.  On the one hand,
2956
2948
       num_symbols includes auxents.  On the other hand, it doesn't
3043
3035
  default_symfile_segments,     /* sym_segments: Get segment information from
3044
3036
                                   a file.  */
3045
3037
  aix_process_linenos,          /* sym_read_linetable */
 
3038
  default_symfile_relocate,     /* sym_relocate: Relocate a debug section.  */
3046
3039
  NULL                          /* next: pointer to next struct sym_fns */
3047
3040
};
3048
3041