public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-jankratochvil-pie: Merge branch 'bp_shlib_event' into archer-jankratochvil-pie
@ 2009-11-06 22:22 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2009-11-06 22:22 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-pie has been updated
       via  45568a35355ac18280b66aa1a1d5ac85ff57441f (commit)
       via  f70772f53e90cb53e715d9dc8e569df52cc88546 (commit)
       via  2213f97647612fef714ad2431f6da1f84fa57dd1 (commit)
       via  8968fd64a881204dcf612fdef2d0d139720867b5 (commit)
       via  0fe356fc196395ba6ebf04c992601f6ad7391077 (commit)
       via  8644065b52e9f08ff2303a0c08b3349e88a76f6c (commit)
       via  3c927e2c480051f4d600ad6cb45d25c571fb8776 (commit)
       via  149216ce79377cbe733ebed3dfdd519394c8cc32 (commit)
       via  d097f5add4075738896e9fa3622f55a9988ea990 (commit)
       via  83c78d99cca35be4a541326266f9bfa6419a5a09 (commit)
       via  b2492ef7cdfbd9f86196c58087eda51f5b5e44fe (commit)
       via  da7c2f9db638f9f4e4e4215d855e9a60e73527e8 (commit)
       via  73e7e941a0b292dcdad5b0fcf74ad77e3c502c62 (commit)
       via  ba3250dc4f1446a0cde9e44ca9cd8b17ebf1eb4c (commit)
       via  94c82aaf63014d288f1ba916860ce06055d987e7 (commit)
       via  8a226414ebc1a6520e6109d3e389897f5c91ad77 (commit)
       via  35f6653bf30b4d8b25bf7ff98f216354b6f56911 (commit)
       via  396738ff0347cab383b4c4e7f2f99baa8be5c6b6 (commit)
       via  a8e1b21cafa0fd186edc16064cb9c1f7eca8fd3c (commit)
       via  fd1bcc3049b8672efe0d2c561d60f83fd7c68f38 (commit)
       via  482496e2ac5103b2114eaffbfc8e42eb83961eeb (commit)
       via  99615d8e1d5debb84acb7ce8c85dba1f6add64b8 (commit)
       via  94506db4a86f80387b9bfd485a1613d89adeec71 (commit)
       via  49c4dcb28466ffda1fe176c827ddc4a4a3213d42 (commit)
       via  9757c29f8a3434f8dec4d554522aa05f77094f2e (commit)
       via  15eb8d6dc2e2d7d3aae160e80463907fb00357f7 (commit)
       via  2ce15c8af7e975a9d37304cccb20a1957fcde88e (commit)
       via  880ac9cd190ed300401fb9146dbf0b3f77c105f0 (commit)
       via  32efa42054f7994a1dba11ecb208030819c10e95 (commit)
       via  85835ca119632912f4197a5bb2738164f7b21330 (commit)
      from  bfe96c7db3d9b15ad6a3c763b8ca36adf1bf3384 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 45568a35355ac18280b66aa1a1d5ac85ff57441f
Merge: 2213f97647612fef714ad2431f6da1f84fa57dd1 f70772f53e90cb53e715d9dc8e569df52cc88546
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 22:24:58 2009 +0100

    Merge branch 'bp_shlib_event' into archer-jankratochvil-pie

commit f70772f53e90cb53e715d9dc8e569df52cc88546
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 22:22:18 2009 +0100

    Fix error on inserting stale breakpoint.
    
    x86_64 host i386 target:
    cd gdb/testsuite; ../gdb -nx -i=mi <transcript.1
    -gdb-set non-stop 1
    105-file-exec-and-symbols gdb.mi/mi-non-stop-exit
    220-exec-run
    200-break-insert -t main
    220-exec-run
    
    =thread-exited,id="3",group-id="16651"
    =thread-exited,id="2",group-id="16651"
    =thread-exited,id="1",group-id="16651"
    =thread-group-exited,id="16651"
    =library-unloaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2",host-name="/lib/ld-linux.so.2"
    =library-unloaded,id="/lib/libpthread.so.0",target-name="/lib/libpthread.so.0",host-name="/lib/libpthread.so.0"
    =library-unloaded,id="/lib/libm.so.6",target-name="/lib/libm.so.6",host-name="/lib/libm.so.6"
    =library-unloaded,id="/lib/libc.so.6",target-name="/lib/libc.so.6",host-name="/lib/libc.so.6"
    =thread-group-created,id="16656"
    =thread-created,id="1",group-id="16656"
    220^running
    *running,thread-id="all"
    (gdb)
    &"Error in re-setting breakpoint 1: Warning:\n"
    &"Cannot insert breakpoint -1.\n"
    &"Error accessing memory address 0x5ab0b0: Input/output error.\n"
    &"\n"
    220^error,msg="Warning:\nCannot insert breakpoint -1.\nError accessing memory address 0x5ab0b0: Input/output error.\n"
    =thread-selected,id="1"
    (gdb)
    =thread-exited,id="1",group-id="16656"
    =thread-group-exited,id="16656"
    
    	* breakpoint.c (disable_breakpoints_in_shlibs): Apply also to
    	bp_shlib_event.  Simplify parentheses.

commit 2213f97647612fef714ad2431f6da1f84fa57dd1
Merge: 8644065b52e9f08ff2303a0c08b3349e88a76f6c 8968fd64a881204dcf612fdef2d0d139720867b5
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 21:16:47 2009 +0100

    Merge branch 'piebase-symbolless-solib-core-attach' into archer-jankratochvil-pie

commit 8968fd64a881204dcf612fdef2d0d139720867b5
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 21:01:23 2009 +0100

    Test also PIE `attach'ing.
    
    gdb/testsuite/
    	* gdb.base/break-interp-lib.c: Include unistd.h, assert.h and stdio.h.
    	(libfunc): New parameter action.  Implement also selectable "sleep".
    	* gdb.base/break-interp-main.c: Include assert.h.
    	(libfunc): New parameter action.
    	(main): New parameters argc and argv.  Assert argc.  Pass argv.
    	* gdb.base/break-interp.exp (test_core): Pass the "segv" argument.
    	(test_attach): New proc.
    	(test_ld): Pass new "segv" exec parameter.  Call also test_attach.
    	* lib/gdb.exp (core_find): New parameter arg.  Pass it to $binfile.

commit 0fe356fc196395ba6ebf04c992601f6ad7391077
Merge: 3c927e2c480051f4d600ad6cb45d25c571fb8776 ba3250dc4f1446a0cde9e44ca9cd8b17ebf1eb4c
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 21:16:19 2009 +0100

    Merge branch 'core_find' into piebase-symbolless-solib-core

commit 8644065b52e9f08ff2303a0c08b3349e88a76f6c
Merge: d097f5add4075738896e9fa3622f55a9988ea990 3c927e2c480051f4d600ad6cb45d25c571fb8776
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:59:50 2009 +0100

    Merge branch 'piebase-symbolless-solib-core-attach' into archer-jankratochvil-pie

commit 3c927e2c480051f4d600ad6cb45d25c571fb8776
Merge: 83c78d99cca35be4a541326266f9bfa6419a5a09 149216ce79377cbe733ebed3dfdd519394c8cc32
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:59:19 2009 +0100

    Merge branch 'piebase-symbolless-solib' into piebase-symbolless-solib-core

commit 149216ce79377cbe733ebed3dfdd519394c8cc32
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:59:06 2009 +0100

    Revert "lib->libsegv"
    
    This reverts commit b2492ef7cdfbd9f86196c58087eda51f5b5e44fe.

commit d097f5add4075738896e9fa3622f55a9988ea990
Merge: 94c82aaf63014d288f1ba916860ce06055d987e7 83c78d99cca35be4a541326266f9bfa6419a5a09
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:49:54 2009 +0100

    Merge branch 'piebase-symbolless-solib-core-attach' into archer-jankratochvil-pie

commit 83c78d99cca35be4a541326266f9bfa6419a5a09
Merge: da7c2f9db638f9f4e4e4215d855e9a60e73527e8 b2492ef7cdfbd9f86196c58087eda51f5b5e44fe
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:49:34 2009 +0100

    Merge branch 'piebase-symbolless-solib' into piebase-symbolless-solib-core

commit b2492ef7cdfbd9f86196c58087eda51f5b5e44fe
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:49:16 2009 +0100

    lib->libsegv

commit da7c2f9db638f9f4e4e4215d855e9a60e73527e8
Merge: b8d6cfdc2869e0caceb7beb284d51a8b64f14eef 8a226414ebc1a6520e6109d3e389897f5c91ad77
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:18:41 2009 +0100

    Merge commit 'origin/master' into piebase-symbolless-solib-core

commit 73e7e941a0b292dcdad5b0fcf74ad77e3c502c62
Merge: 59d2190f1c3bc0772f0cfed1171a582871bb9bb1 8a226414ebc1a6520e6109d3e389897f5c91ad77
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:18:40 2009 +0100

    Merge commit 'origin/master' into piebase-symbolless-solib

commit ba3250dc4f1446a0cde9e44ca9cd8b17ebf1eb4c
Merge: b9f4a7505acd77cd216516a732bad8e943e80aaf 8a226414ebc1a6520e6109d3e389897f5c91ad77
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:18:35 2009 +0100

    Merge commit 'origin/master' into core_find

commit 94c82aaf63014d288f1ba916860ce06055d987e7
Merge: bfe96c7db3d9b15ad6a3c763b8ca36adf1bf3384 8a226414ebc1a6520e6109d3e389897f5c91ad77
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 19:18:33 2009 +0100

    Merge commit 'origin/master' into archer-jankratochvil-pie

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

Summary of changes:
 bfd/version.h                              |    2 +-
 gdb/ChangeLog                              |   81 +
 gdb/amd64-tdep.c                           |    5 +-
 gdb/breakpoint.c                           |    7 +-
 gdb/dwarf2read.c                           |  275 +-
 gdb/elfread.c                              |    5 +-
 gdb/m68k-tdep.c                            |    3 +-
 gdb/mdebugread.c                           |    9 +-
 gdb/mi/mi-interp.c                         |    5 +-
 gdb/objfiles.c                             |    2 +
 gdb/objfiles.h                             |    1 +
 gdb/solib-sunos.c                          |    1 +
 gdb/stabsread.c                            |    8 +-
 gdb/symfile.c                              |   29 +-
 gdb/symfile.h                              |    5 +-
 gdb/symmisc.c                              |    3 +
 gdb/symtab.h                               |    3 +-
 gdb/testsuite/ChangeLog                    |   12 +
 gdb/testsuite/config/m68k-emc.exp          |   17 -
 gdb/testsuite/gdb.base/break-interp-lib.c  |   20 +-
 gdb/testsuite/gdb.base/break-interp-main.c |   10 +-
 gdb/testsuite/gdb.base/break-interp.exp    |   44 +-
 gdb/testsuite/gdb.trace/actions.exp        |   19 +-
 gdb/testsuite/gdb.trace/backtrace.exp      |   56 +-
 gdb/testsuite/gdb.trace/circ.exp           |    5 -
 gdb/testsuite/gdb.trace/collection.exp     |    5 -
 gdb/testsuite/gdb.trace/deltrace.exp       |   19 +-
 gdb/testsuite/gdb.trace/gdb_c_test.c       | 3792 -----------
 gdb/testsuite/gdb.trace/infotrace.exp      |   19 +-
 gdb/testsuite/gdb.trace/limits.exp         |    5 -
 gdb/testsuite/gdb.trace/packetlen.exp      |   56 +-
 gdb/testsuite/gdb.trace/passc-dyn.exp      |   68 +-
 gdb/testsuite/gdb.trace/passcount.exp      |   19 +-
 gdb/testsuite/gdb.trace/report.exp         |   57 +-
 gdb/testsuite/gdb.trace/save-trace.exp     |   19 +-
 gdb/testsuite/gdb.trace/tfind.exp          |   61 +-
 gdb/testsuite/gdb.trace/tracecmd.exp       |   19 +-
 gdb/testsuite/gdb.trace/while-dyn.exp      |   57 +-
 gdb/testsuite/gdb.trace/while-stepping.exp |   19 +-
 gdb/testsuite/lib/emc-support.exp          |  223 -
 gdb/testsuite/lib/gdb.exp                  |    4 +-
 gdb/top.c                                  |    7 +-
 gdb/version.in                             |    2 +-
 include/ChangeLog                          |    6 +
 include/dwarf2.h                           |    3 +-
 opcodes/ChangeLog                          |   34 +
 opcodes/i386-dis.c                         |  738 +++-
 opcodes/i386-gen.c                         |    8 +-
 opcodes/i386-init.h                        |  137 +-
 opcodes/i386-opc.h                         |   13 +
 opcodes/i386-opc.tbl                       |   15 +
 opcodes/i386-tbl.h                         | 9624 ++++++++++++++--------------
 sim/common/ChangeLog                       |    5 +
 sim/common/cgen-mem.h                      |   10 +-
 54 files changed, 6259 insertions(+), 9412 deletions(-)
 delete mode 100644 gdb/testsuite/config/m68k-emc.exp
 delete mode 100644 gdb/testsuite/gdb.trace/gdb_c_test.c
 delete mode 100644 gdb/testsuite/lib/emc-support.exp

First 500 lines of diff:
diff --git a/bfd/version.h b/bfd/version.h
index 2ca5baf..fafa7cb 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20091105
+#define BFD_VERSION_DATE 20091106
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ff7fa70..5c199c4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,84 @@
+2009-11-06  Vladimir Prus  <vladimir@codesourcery.com>
+
+	* m68k-tdep.c (m68k_convert_register_p): Compare with
+	the actual type of fp registers, not one of the possible
+	values.
+
+2009-11-06  Vladimir Prus  <vladimir@codesourcery.com>
+
+        Prevent program output from mix with "^running".
+
+	gdb/
+	* mi/mi-interp.c (mi_on_resume): Output token
+	and "^running" together, so that nothing else gets
+	in between.
+
+2009-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* dwarf2read.c (struct dwarf2_cu): Remove ranges_offset and
+	has_ranges_offset.
+	(struct partial_die_info): Remove language, has_stmt_list, dirname,
+	and line_offset.
+	(dwarf2_build_include_psymtabs): Take a die_info.  Handle a missing
+	line table.
+	(dwarf2_get_pc_bounds): Take PST argument.  Pass it
+	to dwarf2_ranges_read.  Update all callers.
+	(init_cu_die_reader): Move earlier.
+	(dwarf2_find_base_address): New function.
+	(process_psymtab_comp_unit): Rewrite to use a full DIE for the
+	compilation unit.  Use dwarf2_get_pc_bounds and
+	dwarf2_find_base_address.
+	(load_comp_unit): Rewrite to use a full DIE for the compilation unit.
+	(process_full_comp_unit): Use dwarf2_find_base_address.
+	(read_partial_die): Remove support for attributes only used
+	in the compilation unit DIE.
+	* symfile.c (allocate_psymtab): Make FILENAME const.
+	(start_psymtab_common): Likewise.
+	* symfile.h (allocate_psymtab, start_psymtab_common): Update
+	prototypes.
+
+2009-11-05  Tom Tromey  <tromey@redhat.com>
+
+	* symmisc.c (print_symbol_bcache_statistics): Print filename cache
+	statistics.
+	(print_objfile_statistics): Likewise.
+	* symfile.c (reread_symbols): Initialize filename_cache.
+	(allocate_symtab): Cache the file name.
+	(allocate_psymtab): Likewise.
+	* solib-sunos.c (allocate_rt_common_objfile): Initialize
+	filename_cache.
+	* objfiles.h (struct objfile) <filename_cache>: New field.
+	* objfiles.c (allocate_objfile): Initialize filename_cache.
+	(free_objfile): Free filename_cache.
+
+2009-11-05  Tom Tromey  <tromey@redhat.com>
+
+	* symfile.c (add_psymbol_to_bcache): Make 'psymbol' static again.
+	Zero the 'value' field.
+
+2009-11-05  Doug Evans  <dje@google.com>
+
+	* amd64-tdep.c (amd64_init_frame_cache): Enhance comment describing
+	saved_regs.
+
+2009-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* top.c (execute_command): Select a frame before checking the current
+	language.  Only output a message if verbose.
+
+2009-11-05  Tom Tromey  <tromey@redhat.com>
+
+	* symtab.h (SYMBOL_SET_LINKAGE_NAME): Update comment.
+	* symfile.c (allocate_symtab): Don't use obsavestring on a
+	constant string.
+	* stabsread.c (define_symbol): Don't use obsavestring on a
+	constant string.
+	* mdebugread.c (parse_type): Don't use obsavestring on a constant
+	string.
+	(new_symtab): Likewise.
+	* elfread.c (elf_symtab_read): Don't use obsavestring on a
+	constant string.
+
 2009-11-04  Tom Tromey  <tromey@redhat.com>
 
 	* symfile.c (add_psymbol_to_bcache): Don't copy name.  Make
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 51560cf..b47c4c3 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -1402,7 +1402,10 @@ amd64_init_frame_cache (struct amd64_frame_cache *cache)
   cache->pc = 0;
 
   /* Saved registers.  We initialize these to -1 since zero is a valid
-     offset (that's where %rbp is supposed to be stored).  */
+     offset (that's where %rbp is supposed to be stored).
+     The values start out as being offsets, and are later converted to
+     addresses (at which point -1 is interpreted as an address, still meaning
+     "invalid").  */
   for (i = 0; i < AMD64_NUM_SAVED_REGS; i++)
     cache->saved_regs[i] = -1;
   cache->saved_sp = 0;
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 82a61d0..20229f5 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5000,9 +5000,10 @@ disable_breakpoints_in_shlibs (void)
        becomes enabled, or the duplicate is removed, gdb will try to insert
        all breakpoints.  If we don't set shlib_disabled here, we'll try
        to insert those breakpoints and fail.  */
-    if (((b->type == bp_breakpoint)
-	 || (b->type == bp_hardware_breakpoint)
-	 || (b->type == bp_tracepoint))
+    if ((b->type == bp_breakpoint
+	 || b->type == bp_hardware_breakpoint
+	 || b->type == bp_tracepoint
+	 || b->type == bp_shlib_event)
 	&& loc->pspace == current_program_space
 	&& !loc->shlib_disabled
 #ifdef PC_SOLIB
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 9bf89d7..b3bb899 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -283,9 +283,6 @@ struct dwarf2_cu
   /* Hash table holding all the loaded partial DIEs.  */
   htab_t partial_dies;
 
-  /* `.debug_ranges' offset for this `DW_TAG_compile_unit' DIE.  */
-  unsigned int ranges_offset;
-
   /* Storage for things with the same lifetime as this read-in compilation
      unit, including partial DIEs.  */
   struct obstack comp_unit_obstack;
@@ -333,9 +330,6 @@ struct dwarf2_cu
      DIEs for namespaces, we don't need to try to infer them
      from mangled names.  */
   unsigned int has_namespace_info : 1;
-
-  /* Field `ranges_offset' is filled in; flag as the value may be zero.  */
-  unsigned int has_ranges_offset : 1;
 };
 
 /* Persistent data held for a compilation unit, even when not
@@ -474,17 +468,12 @@ struct partial_die_info
     /* DWARF-2 tag for this DIE.  */
     ENUM_BITFIELD(dwarf_tag) tag : 16;
 
-    /* Language code associated with this DIE.  This is only used
-       for the compilation unit DIE.  */
-    unsigned int language : 8;
-
     /* Assorted flags describing the data found in this DIE.  */
     unsigned int has_children : 1;
     unsigned int is_external : 1;
     unsigned int is_declaration : 1;
     unsigned int has_type : 1;
     unsigned int has_specification : 1;
-    unsigned int has_stmt_list : 1;
     unsigned int has_pc_info : 1;
 
     /* Flag set if the SCOPE field of this structure has been
@@ -498,7 +487,6 @@ struct partial_die_info
        sometimes DW_TAG_MIPS_linkage_name or a string computed in some
        other fashion.  */
     char *name;
-    char *dirname;
 
     /* The scope to prepend to our children.  This is generally
        allocated on the comp_unit_obstack, so will disappear
@@ -521,9 +509,6 @@ struct partial_die_info
        DW_AT_extension).  */
     unsigned int spec_offset;
 
-    /* If HAS_STMT_LIST, the offset of the Line Number Information data.  */
-    unsigned int line_offset;
-
     /* Pointers to this DIE's parent, first child, and next sibling,
        if any.  */
     struct partial_die_info *die_parent, *die_child, *die_sibling;
@@ -788,7 +773,7 @@ static void dwarf2_create_include_psymtab (char *, struct partial_symtab *,
                                            struct objfile *);
 
 static void dwarf2_build_include_psymtabs (struct dwarf2_cu *,
-                                           struct partial_die_info *,
+                                           struct die_info *,
                                            struct partial_symtab *);
 
 static void dwarf2_build_psymtabs_hard (struct objfile *, int);
@@ -964,7 +949,8 @@ static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *,
 			       struct dwarf2_cu *, struct partial_symtab *);
 
 static int dwarf2_get_pc_bounds (struct die_info *,
-				 CORE_ADDR *, CORE_ADDR *, struct dwarf2_cu *);
+				 CORE_ADDR *, CORE_ADDR *, struct dwarf2_cu *,
+				 struct partial_symtab *);
 
 static void get_scope_pc_bounds (struct die_info *,
 				 CORE_ADDR *, CORE_ADDR *,
@@ -1664,22 +1650,24 @@ dwarf2_create_include_psymtab (char *name, struct partial_symtab *pst,
 
 /* Read the Line Number Program data and extract the list of files
    included by the source file represented by PST.  Build an include
-   partial symtab for each of these included files.
-   
-   This procedure assumes that there *is* a Line Number Program in
-   the given CU.  Callers should check that PDI->HAS_STMT_LIST is set
-   before calling this procedure.  */
+   partial symtab for each of these included files.  */
 
 static void
 dwarf2_build_include_psymtabs (struct dwarf2_cu *cu,
-                               struct partial_die_info *pdi,
+                               struct die_info *die,
                                struct partial_symtab *pst)
 {
   struct objfile *objfile = cu->objfile;
   bfd *abfd = objfile->obfd;
-  struct line_header *lh;
+  struct line_header *lh = NULL;
+  struct attribute *attr;
 
-  lh = dwarf_decode_line_header (pdi->line_offset, abfd, cu);
+  attr = dwarf2_attr (die, DW_AT_stmt_list, cu);
+  if (attr)
+    {
+      unsigned int line_offset = DW_UNSND (attr);
+      lh = dwarf_decode_line_header (line_offset, abfd, cu);
+    }
   if (lh == NULL)
     return;  /* No linetable, so no includes.  */
 
@@ -1810,6 +1798,51 @@ lookup_signatured_type (struct objfile *objfile, ULONGEST sig)
   return entry;
 }
 
+/* Initialize a die_reader_specs struct from a dwarf2_cu struct.  */
+
+static void
+init_cu_die_reader (struct die_reader_specs *reader,
+		    struct dwarf2_cu *cu)
+{
+  reader->abfd = cu->objfile->obfd;
+  reader->cu = cu;
+  if (cu->per_cu->from_debug_types)
+    reader->buffer = dwarf2_per_objfile->types.buffer;
+  else
+    reader->buffer = dwarf2_per_objfile->info.buffer;
+}
+
+/* Find the base address of the compilation unit for range lists and
+   location lists.  It will normally be specified by DW_AT_low_pc.
+   In DWARF-3 draft 4, the base address could be overridden by
+   DW_AT_entry_pc.  It's been removed, but GCC still uses this for
+   compilation units with discontinuous ranges.  */
+
+static void
+dwarf2_find_base_address (struct die_info *die, struct dwarf2_cu *cu)
+{
+  struct attribute *attr;
+
+  cu->base_known = 0;
+  cu->base_address = 0;
+
+  attr = dwarf2_attr (die, DW_AT_entry_pc, cu);
+  if (attr)
+    {
+      cu->base_address = DW_ADDR (attr);
+      cu->base_known = 1;
+    }
+  else
+    {
+      attr = dwarf2_attr (die, DW_AT_low_pc, cu);
+      if (attr)
+	{
+	  cu->base_address = DW_ADDR (attr);
+	  cu->base_known = 1;
+	}
+    }
+}
+
 /* Subroutine of process_type_comp_unit and dwarf2_build_psymtabs_hard
    to combine the common parts.
    Process a compilation unit for a psymtab.
@@ -1826,13 +1859,17 @@ process_psymtab_comp_unit (struct objfile *objfile,
 {
   bfd *abfd = objfile->obfd;
   gdb_byte *beg_of_comp_unit = info_ptr;
-  struct partial_die_info comp_unit_die;
+  struct die_info *comp_unit_die;
   struct partial_symtab *pst;
   CORE_ADDR baseaddr;
   struct cleanup *back_to_inner;
   struct dwarf2_cu cu;
-  struct abbrev_info *abbrev;
   unsigned int bytes_read;
+  int has_children, has_pc_info;
+  struct attribute *attr;
+  const char *name;
+  CORE_ADDR best_lowpc = 0, best_highpc = 0;
+  struct die_reader_specs reader_specs;
 
   memset (&cu, 0, sizeof (cu));
   cu.objfile = objfile;
@@ -1850,6 +1887,8 @@ process_psymtab_comp_unit (struct objfile *objfile,
 
   cu.list_in_scope = &file_symbols;
 
+  cu.per_cu = this_cu;
+
   /* Read the abbrevs for this compilation unit into a table.  */
   dwarf2_read_abbrevs (abfd, &cu);
   make_cleanup (dwarf2_free_abbrev_table, &cu);
@@ -1857,9 +1896,9 @@ process_psymtab_comp_unit (struct objfile *objfile,
   /* Read the compilation unit die.  */
   if (this_cu->from_debug_types)
     info_ptr += 8 /*signature*/ + cu.header.offset_size;
-  abbrev = peek_die_abbrev (info_ptr, &bytes_read, &cu);
-  info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read, abfd,
-			       buffer, info_ptr, &cu);
+  init_cu_die_reader (&reader_specs, &cu);
+  info_ptr = read_full_die (&reader_specs, &comp_unit_die, info_ptr,
+			    &has_children);
 
   if (this_cu->from_debug_types)
     {
@@ -1867,7 +1906,7 @@ process_psymtab_comp_unit (struct objfile *objfile,
       this_cu->offset = cu.header.offset;
       this_cu->length = cu.header.length + cu.header.initial_length_size;
     }
-  else if (comp_unit_die.tag == DW_TAG_partial_unit)
+  else if (comp_unit_die->tag == DW_TAG_partial_unit)
     {
       info_ptr = (beg_of_comp_unit + cu.header.length
 		  + cu.header.initial_length_size);
@@ -1876,20 +1915,24 @@ process_psymtab_comp_unit (struct objfile *objfile,
     }
 
   /* Set the language we're debugging.  */
-  set_cu_language (comp_unit_die.language, &cu);
+  attr = dwarf2_attr (comp_unit_die, DW_AT_language, &cu);
+  if (attr)
+    set_cu_language (DW_UNSND (attr), &cu);
+  else
+    set_cu_language (language_minimal, &cu);
 
   /* Allocate a new partial symbol table structure.  */
+  attr = dwarf2_attr (comp_unit_die, DW_AT_name, &cu);
   pst = start_psymtab_common (objfile, objfile->section_offsets,
-			      comp_unit_die.name ? comp_unit_die.name : "",
+			      (attr != NULL) ? DW_STRING (attr) : "",
 			      /* TEXTLOW and TEXTHIGH are set below.  */
 			      0,
 			      objfile->global_psymbols.next,
 			      objfile->static_psymbols.next);
 
-  if (comp_unit_die.dirname)
-    pst->dirname = obsavestring (comp_unit_die.dirname,
-				 strlen (comp_unit_die.dirname),
-				 &objfile->objfile_obstack);
+  attr = dwarf2_attr (comp_unit_die, DW_AT_comp_dir, &cu);
+  if (attr != NULL)
+    pst->dirname = DW_STRING (attr);
 
   pst->read_symtab_private = (char *) this_cu;
 
@@ -1907,8 +1950,6 @@ process_psymtab_comp_unit (struct objfile *objfile,
   if (this_cu->cu != NULL)
     free_one_cached_comp_unit (this_cu->cu);
 
-  cu.per_cu = this_cu;
-
   /* Note that this is a pointer to our stack frame, being
      added to a global data structure.	It will be cleaned up
      in free_stack_comp_unit when we finish with this
@@ -1917,26 +1958,23 @@ process_psymtab_comp_unit (struct objfile *objfile,
 
   this_cu->psymtab = pst;
 
+  dwarf2_find_base_address (comp_unit_die, &cu);
+
   /* Possibly set the default values of LOWPC and HIGHPC from
      `DW_AT_ranges'.  */
-  if (cu.has_ranges_offset)
-    {
-      if (dwarf2_ranges_read (cu.ranges_offset, &comp_unit_die.lowpc,
-			      &comp_unit_die.highpc, &cu, pst))
-	comp_unit_die.has_pc_info = 1;
-    }
-  else if (comp_unit_die.has_pc_info
-	   && comp_unit_die.lowpc < comp_unit_die.highpc)
+  has_pc_info = dwarf2_get_pc_bounds (comp_unit_die, &best_lowpc,
+				      &best_highpc, &cu, pst);
+  if (has_pc_info == 1 && best_lowpc < best_highpc)
     /* Store the contiguous range if it is not empty; it can be empty for
        CUs with no code.  */
     addrmap_set_empty (objfile->psymtabs_addrmap,
-		       comp_unit_die.lowpc + baseaddr,
-		       comp_unit_die.highpc + baseaddr - 1, pst);
+		       best_lowpc + baseaddr,
+		       best_highpc + baseaddr - 1, pst);
 
   /* Check if comp unit has_children.
      If so, read the rest of the partial symbols from this comp unit.
      If not, there's no more debug_info for this comp unit. */
-  if (comp_unit_die.has_children)
+  if (has_children)
     {
       struct partial_die_info *first_die;
       CORE_ADDR lowpc, highpc;
@@ -1947,7 +1985,7 @@ process_psymtab_comp_unit (struct objfile *objfile,
       first_die = load_partial_dies (abfd, buffer, info_ptr, 1, &cu);
 
       scan_partial_symbols (first_die, &lowpc, &highpc,
-			    ! comp_unit_die.has_pc_info, &cu);
+			    ! has_pc_info, &cu);
 
       /* If we didn't find a lowpc, set it to highpc to avoid
 	 complaints from `maint check'.	 */
@@ -1956,14 +1994,14 @@ process_psymtab_comp_unit (struct objfile *objfile,
 
       /* If the compilation unit didn't have an explicit address range,
 	 then use the information extracted from its child dies.  */
-      if (! comp_unit_die.has_pc_info)
+      if (! has_pc_info)
 	{
-	  comp_unit_die.lowpc = lowpc;
-	  comp_unit_die.highpc = highpc;
+	  best_lowpc = lowpc;
+	  best_highpc = highpc;
 	}
     }
-  pst->textlow = comp_unit_die.lowpc + baseaddr;
-  pst->texthigh = comp_unit_die.highpc + baseaddr;
+  pst->textlow = best_lowpc + baseaddr;
+  pst->texthigh = best_highpc + baseaddr;
 
   pst->n_global_syms = objfile->global_psymbols.next -
     (objfile->global_psymbols.list + pst->globals_offset);
@@ -1985,11 +2023,11 @@ process_psymtab_comp_unit (struct objfile *objfile,
       /* It's not clear we want to do anything with stmt lists here.
 	 Waiting to see what gcc ultimately does.  */
     }
-  else if (comp_unit_die.has_stmt_list)
+  else
     {
       /* Get the list of files included in the current compilation unit,
 	 and build a psymtab for each of them.  */
-      dwarf2_build_include_psymtabs (&cu, &comp_unit_die, pst);
+      dwarf2_build_include_psymtabs (&cu, comp_unit_die, pst);
     }
 
   do_cleanups (back_to_inner);
@@ -2098,11 +2136,13 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu,
 {
   bfd *abfd = objfile->obfd;
   gdb_byte *info_ptr, *beg_of_comp_unit;
-  struct partial_die_info comp_unit_die;
+  struct die_info *comp_unit_die;
   struct dwarf2_cu *cu;
-  struct abbrev_info *abbrev;
   unsigned int bytes_read;
   struct cleanup *back_to;
+  struct attribute *attr;
+  int has_children;
+  struct die_reader_specs reader_specs;
 
   gdb_assert (! this_cu->from_debug_types);
 
@@ -2127,12 +2167,16 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu,
   back_to = make_cleanup (dwarf2_free_abbrev_table, cu);
 
   /* Read the compilation unit die.  */
-  abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu);
-  info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read, abfd,
-			       dwarf2_per_objfile->info.buffer, info_ptr, cu);
+  init_cu_die_reader (&reader_specs, cu);
+  info_ptr = read_full_die (&reader_specs, &comp_unit_die, info_ptr,
+			    &has_children);
 
   /* Set the language we're debugging.  */
-  set_cu_language (comp_unit_die.language, cu);
+  attr = dwarf2_attr (comp_unit_die, DW_AT_language, cu);
+  if (attr)
+    set_cu_language (DW_UNSND (attr), cu);
+  else
+    set_cu_language (language_minimal, cu);


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-06 22:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-06 22:22 [SCM] archer-jankratochvil-pie: Merge branch 'bp_shlib_event' into archer-jankratochvil-pie jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).