public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  master: Merge remote branch 'gdb/master'
Date: Sun, 31 Jan 2010 17:25:00 -0000	[thread overview]
Message-ID: <20100131172518.25430.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  2e4e6c860563f4d26538db70b02712753456a49a (commit)
       via  5f9a1f9f73c5552ceca68d5e2cefb6454d4d4a22 (commit)
       via  9c13abd586d6251a03d10c2d3809f3dd75a79a96 (commit)
       via  a86369688577ace604d9c15f2e45053cb0f1d046 (commit)
       via  fbae06a026848d102269b1d7627ed1ed1476ecd9 (commit)
       via  481ae44b178f289a3dce573858c076cba130a186 (commit)
       via  00d206f06c1bfe3c4e4ad727e7e7c0d23fec9304 (commit)
       via  ea72145d5db8c66253c9b21b785a5311f69ae99e (commit)
       via  055ea5aad2e3e6e74eb70760a27c5b12b105097d (commit)
       via  e85c2313d4ebb17b06409da168bbb836e229f877 (commit)
       via  c0869096279f9efb4047b5deceee1c6ded43300d (commit)
       via  eaf43e71840fb73fba7c0af93a675b945cf33272 (commit)
       via  06e45bb813f0299045e706936d448563e18de2f2 (commit)
       via  09ffeaf7f4252c5177063a04b70886b604431142 (commit)
       via  285e284cdcd5bd63bf316ddefaf642833d5a0f6a (commit)
       via  a54573f7582d0c73bc98ac06969bbcf3310ac16a (commit)
       via  a1f83b9843c1744564ffb0991f0a51ad372e3346 (commit)
       via  0fcc0541ae31b12263bba2ba8d52c8b461efbfe2 (commit)
       via  753be84d32a8922b66c4f9705811c57d5e64a724 (commit)
       via  cddb5b9441387b546785edb7f3723fd69a34db5a (commit)
      from  aeae4a8edcc90a5560ff3d9832ea79b65b119d9f (commit)

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

- Log -----------------------------------------------------------------
commit 2e4e6c860563f4d26538db70b02712753456a49a
Merge: aeae4a8edcc90a5560ff3d9832ea79b65b119d9f 5f9a1f9f73c5552ceca68d5e2cefb6454d4d4a22
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Sun Jan 31 18:25:05 2010 +0100

    Merge remote branch 'gdb/master'

commit 5f9a1f9f73c5552ceca68d5e2cefb6454d4d4a22
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Sun Jan 31 00:00:02 2010 +0000

    *** empty log message ***

commit 9c13abd586d6251a03d10c2d3809f3dd75a79a96
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sat Jan 30 23:00:05 2010 +0000

    daily update

commit a86369688577ace604d9c15f2e45053cb0f1d046
Author: Dave Anglin <dave.anglin@nrc.ca>
Date:   Sat Jan 30 16:09:42 2010 +0000

    	* elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
    	R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations that use the
    	linkage table pointer to use the global table pointer if not doing
    	a shared link.

commit fbae06a026848d102269b1d7627ed1ed1476ecd9
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Sat Jan 30 00:00:03 2010 +0000

    *** empty log message ***

commit 481ae44b178f289a3dce573858c076cba130a186
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Fri Jan 29 23:00:05 2010 +0000

    daily update

commit 00d206f06c1bfe3c4e4ad727e7e7c0d23fec9304
Author: Daniel Jacobowitz <dan@debian.org>
Date:   Fri Jan 29 16:47:55 2010 +0000

    	gas/testsuite/
    	* gas/arm/dis-data.d: Update test name.  Do not expect
    	.word output.
    	* gas/arm/dis-data2.d, gas/arm/dis-data2.s,
    	gas/arm/dis-data3.d, gas/arm/dis-data3.s: New tests.
    
    	opcodes/
    	* opcodes/arm-dis.c (struct arm_private_data): New.
    	(print_insn_coprocessor, print_insn_arm): Update to use struct
    	arm_private_data.
    	(is_mapping_symbol, get_map_sym_type): New functions.
    	(get_sym_code_type): Check the symbol's section.  Do not check
    	mapping symbols.
    	(print_insn): Default to disassembling ARM mode code.  Check
    	for mapping symbols separately from other symbols.  Use
    	struct arm_private_data.

commit ea72145d5db8c66253c9b21b785a5311f69ae99e
Author: Daniel Jacobowitz <dan@debian.org>
Date:   Fri Jan 29 15:40:19 2010 +0000

    	* infrun.c (prepare_to_proceed): Handle other signals which might
    	match a breakpoint.
    	(handle_inferior_event): Move the check for unusual breakpoint
    	signals earlier.
    
    	gdbserver/
    	* linux-low.c (get_stop_pc): Check for SIGTRAP.
    	(linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
    	breakpoints.

commit 055ea5aad2e3e6e74eb70760a27c5b12b105097d
Author: Daniel Jacobowitz <dan@debian.org>
Date:   Fri Jan 29 15:38:37 2010 +0000

    	* gdb.base/call-strs.exp, gdb.base/default.exp,
    	gdb.base/ending-run.exp, gdb.base/finish.exp, gdb.base/funcargs.exp,
    	gdb.base/huge.exp, gdb.base/nodebug.exp, gdb.base/ptype.exp,
    	gdb.base/restore.exp, gdb.base/return.exp, gdb.base/setvar.exp,
    	gdb.base/watchpoints.exp, gdb.threads/gcore-thread.exp,
    	gdb.base/watchpoint-solib.exp: Save and restore timeout.
    	* gdb.base/ending-run.exp: Correct restore of timeout.
    	* gdb.base/page.exp: Remove unnecessary timeout setting.

commit e85c2313d4ebb17b06409da168bbb836e229f877
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Fri Jan 29 14:39:02 2010 +0000

    amd64 - function returning record with field straddling 2 registers
    
    gdb/ChangeLog:
    
            From Paul Hilfinger  <hilfinger@adacore.com>
            * amd64-tdep.c (amd_classify_aggregate): Handle the case of
            a record of length <= 16 in which a field straddles the two
            eightbytes.
    
    gdb/testsuite/ChangeLog:
    
            * gdb.ada/rec_return: New testcase.

commit c0869096279f9efb4047b5deceee1c6ded43300d
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Fri Jan 29 05:29:21 2010 +0000

    Implement return values on amd64-windows.
    
            * amd64-windows-tdep.c: #include gdbcore.h and regcache.h.
            (amd64_windows_return_value): New function.
            (amd64_windows_init_abi): Call set_gdbarch_return_value with
            amd64_windows_return_value.

commit eaf43e71840fb73fba7c0af93a675b945cf33272
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Fri Jan 29 05:27:35 2010 +0000

    amd64-windows: 32 bytes allocated on stack by caller for integer parameter registers
    
            * i386-tdep.h (struct gdbarch_tdep): Add new field
            integer_param_regs_saved_in_caller_frame.
            * amd64-windows-tdep.c (amd64_windows_init_abi): Set
            tdep->integer_param_regs_saved_in_caller_frame to 1.
            * amd64-tdep.c (amd64_push_dummy_call): Allocate some memory on
            stack if tdep->integer_param_regs_saved_in_caller_frame is set.

commit 06e45bb813f0299045e706936d448563e18de2f2
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Fri Jan 29 05:23:37 2010 +0000

    Add summary line to the second to last entry.

commit 09ffeaf7f4252c5177063a04b70886b604431142
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Fri Jan 29 05:21:55 2010 +0000

    amd64-windows: memory args passed by pointer during function calls.
    
            * i386-tdep.h (gdbarch_tdep): Add field memory_args_by_pointer.
            * amd64-tdep.c (amd64_push_arguments): Add handling of architectures
            where tdep->memory_args_by_pointer is non-zero.
            * amd64-windows-tdep.c (amd64_windows_init_abi): Set
            tdep->memory_args_by_pointer to 1.

commit 285e284cdcd5bd63bf316ddefaf642833d5a0f6a
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Fri Jan 29 05:19:22 2010 +0000

    amd64: Integer parameters in function calls on Windows.
    
    gdb/ChangeLog:
    
            * i386-tdep.h (enum amd64_reg_class): New, moved here from
            amd64-tdep.c.
            (struct gdbarch_tdep): Add fields call_dummy_num_integer_regs,
            call_dummy_integer_regs, and classify.
            * amd64-tdep.h (amd64_classify): Add declaration.
            * amd64-tdep.c (amd64_dummy_call_integer_regs): New static constant.
            (amd64_reg_class): Delete, moved to i386-tdep.h.
            (amd64_classify): Make non-static.  Move declaration to amd64-tdep.h.
            Replace call to amd64_classify by call to tdep->classify.
            (amd64_push_arguments): Get the list of registers to use for
            passing integer parameters from the gdbarch tdep structure,
            rather than using a hardcoded one.  Replace calls to amd64_classify
            by calls to tdep->classify.
            (amd64_push_dummy_call): Get the register number used for
            the "hidden" argument from tdep->call_dummy_integer_regs.
            (amd64_init_abi): Initialize tdep->call_dummy_num_integer_regs
            and tdep->call_dummy_integer_regs.  Set tdep->classify.
            * amd64-windows-tdep.c: Add include of gdbtypes.h.
            (amd64_windows_dummy_call_integer_regs): New static global.
            (amd64_windows_classify): New function.
            (amd64_windows_init_abi): Initialize tdep->call_dummy_num_integer_regs
            tdep->call_dummy_integer_regs and tdep->classify.
    
    gdb/testsuite/ChangeLog:
    
            * gdb.ada/call_pn: New testcase.

commit a54573f7582d0c73bc98ac06969bbcf3310ac16a
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Fri Jan 29 04:32:59 2010 +0000

    core files: wrong signal number with threaded program on sparc-solaris.
    
            * elf.c (elfcore_grok_lwpstatus): Do not overwrite the core signal
            if it has already been set.

commit a1f83b9843c1744564ffb0991f0a51ad372e3346
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Fri Jan 29 00:00:33 2010 +0000

    *** empty log message ***

commit 0fcc0541ae31b12263bba2ba8d52c8b461efbfe2
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Thu Jan 28 23:00:04 2010 +0000

    daily update

commit 753be84d32a8922b66c4f9705811c57d5e64a724
Author: Daniel Jacobowitz <dan@debian.org>
Date:   Thu Jan 28 22:14:11 2010 +0000

    	* gdb.mi/mi-nonstop.exp (mi_nonstop_resume): New function.
    	(Top level): Use it to resume.
    	* lib/mi-support.exp (mi_send_resuming_command_raw): Recognize
    	the Thumb mode displaced stepping error as unsupported.

commit cddb5b9441387b546785edb7f3723fd69a34db5a
Author: Daniel Jacobowitz <dan@debian.org>
Date:   Thu Jan 28 22:07:57 2010 +0000

    	* regcache.c (regcache_xmalloc): Add aspace argument.  Use it
    	for the new regcache.  All callers updated.
    	(regcache_cpy, regcache_cpy_no_passthrough): Do not set aspace here.
    	(get_thread_arch_regcache): Do not set aspace here.
    	* regcache.h (regcache_xmalloc): Update declaration.
    
    	* frame.c, infcall.c, ppc-linux-tdep.c: Calls to
    	regcache_xmalloc updated.

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

Summary of changes:
 bfd/ChangeLog                               |   12 ++
 bfd/elf.c                                   |    5 +-
 bfd/elf32-hppa.c                            |   12 +-
 bfd/version.h                               |    2 +-
 gdb/ChangeLog                               |   79 ++++++++++
 gdb/amd64-tdep.c                            |  136 +++++++++++++-----
 gdb/amd64-tdep.h                            |    3 +
 gdb/amd64-windows-tdep.c                    |  112 +++++++++++++++
 gdb/frame.c                                 |    4 +-
 gdb/gdbserver/ChangeLog                     |    6 +
 gdb/gdbserver/linux-low.c                   |   21 ++-
 gdb/i386-tdep.h                             |   43 ++++++
 gdb/infcall.c                               |    3 +-
 gdb/infrun.c                                |   50 ++++---
 gdb/ppc-linux-tdep.c                        |    3 +-
 gdb/regcache.c                              |   15 +--
 gdb/regcache.h                              |    3 +-
 gdb/testsuite/ChangeLog                     |   26 ++++
 gdb/testsuite/gdb.ada/call_pn.exp           |   53 +++++++
 gdb/testsuite/gdb.ada/call_pn/foo.adb       |   23 +++
 gdb/testsuite/gdb.ada/call_pn/pck.adb       |   25 ++++
 gdb/testsuite/gdb.ada/call_pn/pck.ads       |   23 +++
 gdb/testsuite/gdb.ada/rec_return.exp        |   46 ++++++
 gdb/testsuite/gdb.ada/rec_return/foo.adb    |   24 +++
 gdb/testsuite/gdb.ada/rec_return/pck.adb    |   27 ++++
 gdb/testsuite/gdb.ada/rec_return/pck.ads    |   28 ++++
 gdb/testsuite/gdb.base/call-strs.exp        |    9 +-
 gdb/testsuite/gdb.base/default.exp          |    3 +
 gdb/testsuite/gdb.base/ending-run.exp       |    4 +-
 gdb/testsuite/gdb.base/finish.exp           |    2 +
 gdb/testsuite/gdb.base/freebpcmd.exp        |    3 +
 gdb/testsuite/gdb.base/funcargs.exp         |    3 +
 gdb/testsuite/gdb.base/huge.exp             |    2 +
 gdb/testsuite/gdb.base/nodebug.exp          |    4 +-
 gdb/testsuite/gdb.base/page.exp             |    5 -
 gdb/testsuite/gdb.base/ptype.exp            |    5 +-
 gdb/testsuite/gdb.base/restore.exp          |    2 +
 gdb/testsuite/gdb.base/return.exp           |    2 +
 gdb/testsuite/gdb.base/setvar.exp           |    5 +-
 gdb/testsuite/gdb.base/watchpoint-solib.exp |    8 +-
 gdb/testsuite/gdb.base/watchpoints.exp      |    3 +-
 gdb/testsuite/gdb.mi/mi-nonstop.exp         |   19 ++-
 gdb/testsuite/gdb.threads/gcore-thread.exp  |    2 +
 gdb/testsuite/lib/mi-support.exp            |   10 +-
 gdb/version.in                              |    2 +-
 opcodes/ChangeLog                           |   12 ++
 opcodes/arm-dis.c                           |  206 ++++++++++++++++++++-------
 47 files changed, 935 insertions(+), 160 deletions(-)
 create mode 100644 gdb/testsuite/gdb.ada/call_pn.exp
 create mode 100644 gdb/testsuite/gdb.ada/call_pn/foo.adb
 create mode 100644 gdb/testsuite/gdb.ada/call_pn/pck.adb
 create mode 100644 gdb/testsuite/gdb.ada/call_pn/pck.ads
 create mode 100644 gdb/testsuite/gdb.ada/rec_return.exp
 create mode 100644 gdb/testsuite/gdb.ada/rec_return/foo.adb
 create mode 100644 gdb/testsuite/gdb.ada/rec_return/pck.adb
 create mode 100644 gdb/testsuite/gdb.ada/rec_return/pck.ads

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ce2c0c6..1f66207 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-30  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
+	R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations that use the
+	linkage table pointer to use the global table pointer if not doing
+	a shared link.
+
+2010-01-29  Joel Brobecker  <brobecker@adacore.com>
+
+	* elf.c (elfcore_grok_lwpstatus): Do not overwrite the core signal
+	if it has already been set.
+
 2010-01-27  Tristan Gingold  <gingold@adacore.com>
 
 	* vms.h: Remove trailing spaces.
diff --git a/bfd/elf.c b/bfd/elf.c
index aac3314..19e4695 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -7800,7 +7800,10 @@ elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note)
   memcpy (&lwpstat, note->descdata, sizeof (lwpstat));
 
   elf_tdata (abfd)->core_lwpid = lwpstat.pr_lwpid;
-  elf_tdata (abfd)->core_signal = lwpstat.pr_cursig;
+  /* Do not overwrite the core signal if it has already been set by
+     another thread.  */
+  if (elf_tdata (abfd)->core_signal == 0)
+    elf_tdata (abfd)->core_signal = lwpstat.pr_cursig;
 
   /* Make a ".reg/999" section.  */
 
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 2a5547b..babe9f2 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -3388,12 +3388,19 @@ final_link_relocate (asection *input_section,
     case R_PARISC_DPREL21L:
     case R_PARISC_DPREL14R:
     case R_PARISC_DPREL14F:
+    case R_PARISC_TLS_GD21L:
+    case R_PARISC_TLS_LDM21L:
+    case R_PARISC_TLS_IE21L:
       /* Convert instructions that use the linkage table pointer (r19) to
 	 instructions that use the global data pointer (dp).  This is the
 	 most efficient way of using PIC code in an incomplete executable,
 	 but the user must follow the standard runtime conventions for
 	 accessing data for this to work.  */
-      if (orig_r_type == R_PARISC_DLTIND21L)
+      if (orig_r_type == R_PARISC_DLTIND21L
+	  || (!info->shared
+	      && (r_type == R_PARISC_TLS_GD21L
+		  || r_type == R_PARISC_TLS_LDM21L
+		  || r_type == R_PARISC_TLS_IE21L)))
 	{
 	  /* Convert addil instructions if the original reloc was a
 	     DLTIND21L.  GCC sometimes uses a register other than r19 for
@@ -3444,11 +3451,8 @@ final_link_relocate (asection *input_section,
     case R_PARISC_DLTIND21L:
     case R_PARISC_DLTIND14R:
     case R_PARISC_DLTIND14F:
-    case R_PARISC_TLS_GD21L:
     case R_PARISC_TLS_GD14R:
-    case R_PARISC_TLS_LDM21L:
     case R_PARISC_TLS_LDM14R:
-    case R_PARISC_TLS_IE21L:
     case R_PARISC_TLS_IE14R:
       value -= elf_gp (input_section->output_section->owner);
       break;
diff --git a/bfd/version.h b/bfd/version.h
index 61fb4a2..08f4544 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20100128
+#define BFD_VERSION_DATE 20100131
 #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 db65d6d..45d1e61 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,82 @@
+2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* infrun.c (prepare_to_proceed): Handle other signals which might
+	match a breakpoint.
+	(handle_inferior_event): Move the check for unusual breakpoint
+	signals earlier.
+
+2010-01-29  Paul Hilfinger  <hilfinger@adacore.com>
+
+	amd64 - function returning record with field straddling 2 registers.
+	* amd64-tdep.c (amd_classify_aggregate): Handle the case of
+	a record of length <= 16 in which a field straddles the two
+	eightbytes.
+
+2010-01-29  Joel Brobecker  <brobecker@adacore.com>
+
+	Implement return values on amd64-windows.
+	* amd64-windows-tdep.c: #include gdbcore.h and regcache.h.
+	(amd64_windows_return_value): New function.
+	(amd64_windows_init_abi): Call set_gdbarch_return_value with
+	amd64_windows_return_value.
+
+2010-01-29  Joel Brobecker  <brobecker@adacore.com>
+
+	amd64-windows: 32 bytes allocated on stack by caller for integer
+	parameter registers.
+	* i386-tdep.h (struct gdbarch_tdep): Add new field
+	integer_param_regs_saved_in_caller_frame.
+	* amd64-windows-tdep.c (amd64_windows_init_abi): Set
+	tdep->integer_param_regs_saved_in_caller_frame to 1.
+	* amd64-tdep.c (amd64_push_dummy_call): Allocate some memory on
+	stack if tdep->integer_param_regs_saved_in_caller_frame is set.
+
+2010-01-29  Joel Brobecker  <brobecker@adacore.com>
+
+	amd64-windows: memory args passed by pointer during function calls.
+	* i386-tdep.h (gdbarch_tdep): Add field memory_args_by_pointer.
+	* amd64-tdep.c (amd64_push_arguments): Add handling of architectures
+	where tdep->memory_args_by_pointer is non-zero.
+	* amd64-windows-tdep.c (amd64_windows_init_abi): Set
+	tdep->memory_args_by_pointer to 1.
+
+2010-01-29  Joel Brobecker  <brobecker@adacore.com>
+
+	amd64-windows: Integer parameters in function calls.
+	* i386-tdep.h (enum amd64_reg_class): New, moved here from
+	amd64-tdep.c.
+	(struct gdbarch_tdep): Add fields call_dummy_num_integer_regs,
+	call_dummy_integer_regs, and classify.
+	* amd64-tdep.h (amd64_classify): Add declaration.
+	* amd64-tdep.c (amd64_dummy_call_integer_regs): New static constant.
+	(amd64_reg_class): Delete, moved to i386-tdep.h.
+	(amd64_classify): Make non-static.  Move declaration to amd64-tdep.h.
+	Replace call to amd64_classify by call to tdep->classify.
+	(amd64_push_arguments): Get the list of registers to use for
+	passing integer parameters from the gdbarch tdep structure,
+	rather than using a hardcoded one.  Replace calls to amd64_classify
+	by calls to tdep->classify.
+	(amd64_push_dummy_call): Get the register number used for
+	the "hidden" argument from tdep->call_dummy_integer_regs.
+	(amd64_init_abi): Initialize tdep->call_dummy_num_integer_regs
+	and tdep->call_dummy_integer_regs.  Set tdep->classify.
+	* amd64-windows-tdep.c: Add include of gdbtypes.h.
+	(amd64_windows_dummy_call_integer_regs): New static global.
+	(amd64_windows_classify): New function.
+	(amd64_windows_init_abi): Initialize tdep->call_dummy_num_integer_regs
+	tdep->call_dummy_integer_regs and tdep->classify.
+
+2010-01-28  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* regcache.c (regcache_xmalloc): Add aspace argument.  Use it
+	for the new regcache.  All callers updated.
+	(regcache_cpy, regcache_cpy_no_passthrough): Do not set aspace here.
+	(get_thread_arch_regcache): Do not set aspace here.
+	* regcache.h (regcache_xmalloc): Update declaration.
+
+	* frame.c, infcall.c, ppc-linux-tdep.c: Calls to
+	regcache_xmalloc updated.
+
 2010-01-28  Joel Brobecker  <brobecker@adacore.com>
 
 	Another -Wunused-function error in procfs.c (sparc-solaris)
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 74a38a8..2b15141 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -72,6 +72,17 @@ static const char *amd64_register_names[] =
 /* Total number of registers.  */
 #define AMD64_NUM_REGS	ARRAY_SIZE (amd64_register_names)
 
+/* The registers used to pass integer arguments during a function call.  */
+static int amd64_dummy_call_integer_regs[] =
+{
+  AMD64_RDI_REGNUM,		/* %rdi */
+  AMD64_RSI_REGNUM,		/* %rsi */
+  AMD64_RDX_REGNUM,		/* %rdx */
+  AMD64_RCX_REGNUM,		/* %rcx */
+  8,				/* %r8 */
+  9				/* %r9 */
+};
+
 /* Return the name of register REGNUM.  */
 
 const char *
@@ -240,20 +251,6 @@ amd64_arch_reg_to_regnum (int reg)
 
 \f
 
-/* Register classes as defined in the psABI.  */
-
-enum amd64_reg_class
-{
-  AMD64_INTEGER,
-  AMD64_SSE,
-  AMD64_SSEUP,
-  AMD64_X87,
-  AMD64_X87UP,
-  AMD64_COMPLEX_X87,
-  AMD64_NO_CLASS,
-  AMD64_MEMORY
-};
-
 /* Return the union class of CLASS1 and CLASS2.  See the psABI for
    details.  */
 
@@ -290,8 +287,6 @@ amd64_merge_classes (enum amd64_reg_class class1, enum amd64_reg_class class2)
   return AMD64_SSE;
 }
 
-static void amd64_classify (struct type *type, enum amd64_reg_class class[2]);
-
 /* Return non-zero if TYPE is a non-POD structure or union type.  */
 
 static int
@@ -352,6 +347,12 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
 	  struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
 	  int pos = TYPE_FIELD_BITPOS (type, i) / 64;
 	  enum amd64_reg_class subclass[2];
+	  int bitsize = TYPE_FIELD_BITSIZE (type, i);
+	  int endpos;
+
+	  if (bitsize == 0)
+	    bitsize = TYPE_LENGTH (subtype) * 8;
+	  endpos = (TYPE_FIELD_BITPOS (type, i) + bitsize - 1) / 64;
 
 	  /* Ignore static fields.  */
 	  if (field_is_static (&TYPE_FIELD (type, i)))
@@ -361,6 +362,30 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
 
 	  amd64_classify (subtype, subclass);
 	  class[pos] = amd64_merge_classes (class[pos], subclass[0]);
+	  if (bitsize <= 64 && pos == 0 && endpos == 1)
+	    /* This is a bit of an odd case:  We have a field that would
+	       normally fit in one of the two eightbytes, except that
+	       it is placed in a way that this field straddles them.
+	       This has been seen with a structure containing an array.
+
+	       The ABI is a bit unclear in this case, but we assume that
+	       this field's class (stored in subclass[0]) must also be merged
+	       into class[1].  In other words, our field has a piece stored
+	       in the second eight-byte, and thus its class applies to
+	       the second eight-byte as well.
+
+	       In the case where the field length exceeds 8 bytes,
+	       it should not be necessary to merge the field class
+	       into class[1].  As LEN > 8, subclass[1] is necessarily
+	       different from AMD64_NO_CLASS.  If subclass[1] is equal
+	       to subclass[0], then the normal class[1]/subclass[1]
+	       merging will take care of everything.  For subclass[1]
+	       to be different from subclass[0], I can only see the case
+	       where we have a SSE/SSEUP or X87/X87UP pair, which both
+	       use up all 16 bytes of the aggregate, and are already
+	       handled just fine (because each portion sits on its own
+	       8-byte).  */
+	    class[1] = amd64_merge_classes (class[1], subclass[0]);
 	  if (pos == 0)
 	    class[1] = amd64_merge_classes (class[1], subclass[1]);
 	}
@@ -383,7 +408,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
 
 /* Classify TYPE, and store the result in CLASS.  */
 
-static void
+void
 amd64_classify (struct type *type, enum amd64_reg_class class[2])
 {
   enum type_code code = TYPE_CODE (type);
@@ -434,6 +459,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *func_type,
 		    struct type *type, struct regcache *regcache,
 		    gdb_byte *readbuf, const gdb_byte *writebuf)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum amd64_reg_class class[2];
   int len = TYPE_LENGTH (type);
   static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
@@ -443,9 +469,10 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *func_type,
   int i;
 
   gdb_assert (!(readbuf && writebuf));
+  gdb_assert (tdep->classify);
 
   /* 1. Classify the return type with the classification algorithm.  */
-  amd64_classify (type, class);
+  tdep->classify (type, class);
 
   /* 2. If the type has class MEMORY, then the caller provides space
      for the return value and passes the address of this storage in
@@ -543,15 +570,11 @@ static CORE_ADDR
 amd64_push_arguments (struct regcache *regcache, int nargs,
 		      struct value **args, CORE_ADDR sp, int struct_return)
 {
-  static int integer_regnum[] =
-  {
-    AMD64_RDI_REGNUM,		/* %rdi */
-    AMD64_RSI_REGNUM,		/* %rsi */
-    AMD64_RDX_REGNUM,		/* %rdx */
-    AMD64_RCX_REGNUM,		/* %rcx */
-    8,				/* %r8 */
-    9				/* %r9 */
-  };
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  int *integer_regs = tdep->call_dummy_integer_regs;
+  int num_integer_regs = tdep->call_dummy_num_integer_regs;
+
   static int sse_regnum[] =
   {
     /* %xmm0 ... %xmm7 */
@@ -561,6 +584,11 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
     AMD64_XMM0_REGNUM + 6, AMD64_XMM0_REGNUM + 7,
   };
   struct value **stack_args = alloca (nargs * sizeof (struct value *));
+  /* An array that mirrors the stack_args array.  For all arguments
+     that are passed by MEMORY, if that argument's address also needs
+     to be stored in a register, the ARG_ADDR_REGNO array will contain
+     that register number (or a negative value otherwise).  */
+  int *arg_addr_regno = alloca (nargs * sizeof (int));
   int num_stack_args = 0;
   int num_elements = 0;
   int element = 0;
@@ -568,6 +596,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
   int sse_reg = 0;
   int i;
 
+  gdb_assert (tdep->classify);
+
   /* Reserve a register for the "hidden" argument.  */
   if (struct_return)
     integer_reg++;
@@ -582,7 +612,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
       int j;
 
       /* Classify argument.  */
-      amd64_classify (type, class);
+      tdep->classify (type, class);
 
       /* Calculate the number of integer and SSE registers needed for
          this argument.  */
@@ -596,13 +626,25 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
 
       /* Check whether enough registers are available, and if the
          argument should be passed in registers at all.  */
-      if (integer_reg + needed_integer_regs > ARRAY_SIZE (integer_regnum)
+      if (integer_reg + needed_integer_regs > num_integer_regs
 	  || sse_reg + needed_sse_regs > ARRAY_SIZE (sse_regnum)
 	  || (needed_integer_regs == 0 && needed_sse_regs == 0))
 	{
 	  /* The argument will be passed on the stack.  */
 	  num_elements += ((len + 7) / 8);
-	  stack_args[num_stack_args++] = args[i];
+	  stack_args[num_stack_args] = args[i];
+          /* If this is an AMD64_MEMORY argument whose address must also
+             be passed in one of the integer registers, reserve that
+             register and associate this value to that register so that
+             we can store the argument address as soon as we know it.  */
+          if (class[0] == AMD64_MEMORY
+              && tdep->memory_args_by_pointer
+              && integer_reg < tdep->call_dummy_num_integer_regs)
+            arg_addr_regno[num_stack_args] =
+              tdep->call_dummy_integer_regs[integer_reg++];
+          else
+            arg_addr_regno[num_stack_args] = -1;
+          num_stack_args++;
 	}
       else
 	{
@@ -620,7 +662,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
 	      switch (class[j])
 		{
 		case AMD64_INTEGER:
-		  regnum = integer_regnum[integer_reg++];
+		  regnum = integer_regs[integer_reg++];
 		  break;
 
 		case AMD64_SSE:
@@ -658,8 +700,19 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
       struct type *type = value_type (stack_args[i]);
       const gdb_byte *valbuf = value_contents (stack_args[i]);
       int len = TYPE_LENGTH (type);
-
-      write_memory (sp + element * 8, valbuf, len);
+      CORE_ADDR arg_addr = sp + element * 8;
+
+      write_memory (arg_addr, valbuf, len);
+      if (arg_addr_regno[i] >= 0)
+        {
+          /* We also need to store the address of that argument in
+             the given register.  */
+          gdb_byte buf[8];
+          enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
+          store_unsigned_integer (buf, 8, byte_order, arg_addr);
+          regcache_cooked_write (regcache, arg_addr_regno[i], buf);
+        }
       element += ((len + 7) / 8);
     }
 
@@ -678,6 +731,7 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		       int struct_return, CORE_ADDR struct_addr)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   gdb_byte buf[8];
 
   /* Pass arguments.  */
@@ -686,10 +740,20 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   /* Pass "hidden" argument".  */
   if (struct_return)
     {
+      struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+      /* The "hidden" argument is passed throught the first argument
+         register.  */
+      const int arg_regnum = tdep->call_dummy_integer_regs[0];
+
       store_unsigned_integer (buf, 8, byte_order, struct_addr);
-      regcache_cooked_write (regcache, AMD64_RDI_REGNUM, buf);
+      regcache_cooked_write (regcache, arg_regnum, buf);
     }
 
+  /* Reserve some memory on the stack for the integer-parameter registers,
+     if required by the ABI.  */
+  if (tdep->integer_param_regs_saved_in_caller_frame)
+    sp -= tdep->call_dummy_num_integer_regs * 8;
+
   /* Store return address.  */
   sp -= 8;
   store_unsigned_integer (buf, 8, byte_order, bp_addr);
@@ -2134,6 +2198,10 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_push_dummy_call (gdbarch, amd64_push_dummy_call);
   set_gdbarch_frame_align (gdbarch, amd64_frame_align);
   set_gdbarch_frame_red_zone_size (gdbarch, 128);
+  tdep->call_dummy_num_integer_regs =
+    ARRAY_SIZE (amd64_dummy_call_integer_regs);
+  tdep->call_dummy_integer_regs = amd64_dummy_call_integer_regs;
+  tdep->classify = amd64_classify;
 
   set_gdbarch_convert_register_p (gdbarch, i387_convert_register_p);
   set_gdbarch_register_to_value (gdbarch, i387_register_to_value);
diff --git a/gdb/amd64-tdep.h b/gdb/amd64-tdep.h
index 3bff5d1..363479c 100644
--- a/gdb/amd64-tdep.h
+++ b/gdb/amd64-tdep.h
@@ -98,6 +98,9 @@ extern void amd64_supply_fxsave (struct regcache *regcache, int regnum,
 
 extern void amd64_collect_fxsave (const struct regcache *regcache, int regnum,
 				  void *fxsave);
+
+void amd64_classify (struct type *type, enum amd64_reg_class class[2]);
+
 \f
 
 /* Variables exported from amd64nbsd-tdep.c.  */
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index bdad9bd..05d0824 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -20,15 +20,127 @@
 #include "amd64-tdep.h"
 #include "solib.h"
 #include "solib-target.h"
+#include "gdbtypes.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+/* The registers used to pass integer arguments during a function call.  */
+static int amd64_windows_dummy_call_integer_regs[] =
+{
+  AMD64_RCX_REGNUM,          /* %rcx */
+  AMD64_RDX_REGNUM,          /* %rdx */
+  8,                         /* %r8 */
+  9                          /* %r9 */
+};
+
+/* Implement the "classify" method in the gdbarch_tdep structure
+   for amd64-windows.  */
+
+static void
+amd64_windows_classify (struct type *type, enum amd64_reg_class class[2])
+{
+  switch (TYPE_CODE (type))
+    {
+      case TYPE_CODE_ARRAY:
+	/* Arrays are always passed by memory.	*/
+	class[0] = class[1] = AMD64_MEMORY;
+	break;
+
+      case TYPE_CODE_STRUCT:
+      case TYPE_CODE_UNION:
+        /* Struct/Union types whose size is 1, 2, 4, or 8 bytes
+	   are passed as if they were integers of the same size.
+	   Types of different sizes are passed by memory.  */
+	if (TYPE_LENGTH (type) == 1


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


             reply	other threads:[~2010-01-31 17:25 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-31 17:25 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-01 19:25 jkratoch
2011-01-29 16:44 jkratoch
2011-01-25 12:53 pmuldoon
2011-01-25  9:10 jkratoch
2011-01-17 13:31 pmuldoon
2011-01-15 11:35 jkratoch
2011-01-14  8:04 jkratoch
2011-01-10 12:00 pmuldoon
2011-01-10  9:10 jkratoch
2011-01-07  5:57 jkratoch
2011-01-06 12:22 pmuldoon
2011-01-04  4:59 jkratoch
2010-12-31 22:30 jkratoch
2010-12-30  7:22 jkratoch
2010-12-22 20:11 swagiaal
2010-12-14 17:13 jkratoch
2010-12-14  8:27 pmuldoon
2010-12-10 17:16 jkratoch
2010-12-08 15:55 pmuldoon
2010-12-06  6:40 jkratoch
2010-12-04  1:03 jkratoch
2010-12-02 15:47 pmuldoon
2010-11-30  0:15 jkratoch
2010-11-28 18:02 jkratoch
2010-11-28  5:41 jkratoch
2010-11-16  5:04 jkratoch
2010-11-12 11:47 pmuldoon
2010-11-11 11:39 pmuldoon
2010-11-10  9:09 pmuldoon
2010-11-08  9:34 pmuldoon
2010-11-07 18:15 jkratoch
2010-10-22 14:28 pmuldoon
2010-10-20 12:48 pmuldoon
2010-10-19 16:01 pmuldoon
2010-10-17 20:27 jkratoch
2010-10-15 17:07 jkratoch
2010-10-14 20:55 jkratoch
2010-10-13 15:06 jkratoch
2010-10-12 16:45 jkratoch
2010-10-11  9:21 jkratoch
2010-10-11  8:47 pmuldoon
2010-10-06  9:00 pmuldoon
2010-09-30  8:56 pmuldoon
2010-09-27  9:48 jkratoch
2010-09-20 12:34 pmuldoon
2010-09-16 20:49 ratmice
2010-09-04 19:59 jkratoch
2010-09-03  7:26 jkratoch
2010-09-02 15:04 jkratoch
2010-09-01 15:29 swagiaal
2010-08-23 13:54 jkratoch
2010-08-20 17:49 jkratoch
2010-08-12 15:19 swagiaal
2010-08-06 15:32 jkratoch
2010-07-29 19:17 swagiaal
2010-07-22 16:57 jkratoch
2010-07-22 16:26 jkratoch
2010-07-20 18:51 jkratoch
2010-07-09  8:09 jkratoch
2010-06-24  8:55 jkratoch
2010-06-23 20:56 jkratoch
2010-06-17 12:53 jkratoch
2010-06-07  8:14 jkratoch
2010-06-02 19:03 jkratoch
2010-05-28 21:27 jkratoch
2010-05-26 18:36 swagiaal
2010-05-17 18:02 jkratoch
2010-05-17  1:04 jkratoch
2010-05-10 19:30 swagiaal
2010-05-05 14:24 swagiaal
2010-05-03 13:49 jkratoch
2010-05-03  8:48 jkratoch
2010-05-02 23:10 jkratoch
2010-05-02 15:54 jkratoch
2010-04-30  7:11 jkratoch
2010-04-28 11:44 jkratoch
2010-04-25 20:22 jkratoch
2010-04-09 20:37 jkratoch
2010-04-07  1:41 jkratoch
2010-04-05 10:11 jkratoch
2010-04-04 11:58 jkratoch
2010-03-22 23:58 jkratoch
2010-03-20 17:23 jkratoch
2010-03-18 10:01 jkratoch
2010-03-17 18:04 jkratoch
2010-03-12 18:35 jkratoch
2010-03-04 22:28 jkratoch
2010-03-01 22:16 jkratoch
2010-02-26 22:16 jkratoch
2010-02-26 17:50 jkratoch
2010-02-17 16:01 swagiaal
2010-02-13 22:51 jkratoch
2010-02-11 12:51 jkratoch
2010-02-09 19:01 jkratoch
2010-02-08 21:46 jkratoch
2010-02-03  4:38 jkratoch
2010-01-28 19:17 swagiaal
2010-01-28 10:56 jkratoch
2010-01-27 19:21 swagiaal
2010-01-27  8:08 jkratoch
2010-01-26 18:58 swagiaal
2010-01-20 21:48 jkratoch
2010-01-15  2:09 jkratoch
2010-01-15  0:52 jkratoch
2010-01-14 22:23 jkratoch
2010-01-13 20:53 jkratoch
2010-01-10 20:47 jkratoch
2010-01-09 10:03 jkratoch
2010-01-09  8:41 jkratoch
2010-01-08 19:16 jkratoch
2009-12-06 17:43 jkratoch
2009-12-03 16:32 jkratoch
2009-11-30 13:59 jkratoch
2009-11-24 21:21 jkratoch
2009-11-21  9:24 jkratoch
2009-11-20 21:06 jkratoch
2009-11-20 15:57 jkratoch
2009-11-17 19:59 jkratoch
2009-11-16  2:22 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100131172518.25430.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).