From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19020 invoked by alias); 9 Jan 2010 08:41:27 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 18971 invoked by uid 9674); 9 Jan 2010 08:41:25 -0000 Date: Sat, 09 Jan 2010 08:41:00 -0000 Message-ID: <20100109084125.18951.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] master: Merge remote branch 'gdb/master' X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 39a8dc9d7f4aeb64b63374991a2b260072794460 X-Git-Newrev: 0beb8ff7535f788f432efe77036e3f85711ea09b X-SW-Source: 2010-q1/txt/msg00011.txt.bz2 List-Id: The branch, master has been updated via 0beb8ff7535f788f432efe77036e3f85711ea09b (commit) via 97f6d96b0439794ecba310a256fb884f0d4a45bc (commit) via 36f25a02af8a0f90c70d120f763595cf38943ace (commit) via 6de8b8d63ed156636460945b6cc3e97438673a03 (commit) via cbc069857cf0f4472b8aca5a1698458589157a9c (commit) via 4d53683024cc12c9eb396ed372566ebccecc6fe0 (commit) via 6cfbd29244ca246410ef4d5c812aac487b20909e (commit) via 20d2b0c01a6843dc954dc59dabd710d18f0ac58d (commit) via f848c0d286a68cc4d8d9fec6be657850a121fb82 (commit) via 9f0f19b693cebd4d538b6f5efded886f5af0442a (commit) via f1a97abbd8e9bb7fe0837e73497982c0231f04a8 (commit) via 0a006d88022a5d60204b68a678870232f2b16331 (commit) via 6c24b94109720c7df9356e081975221036a10546 (commit) via a5aae03cf8565630bba4924bad1e44182aad2488 (commit) via 43bf433d8d9c8d1a3b23392bed3abf2275b3b37b (commit) via 173121fc618e528481ceb3ee41e3f7399d26ce93 (commit) via 4efb761b57fcad92ffcdc7c40dd4729c34055d2d (commit) via b12e8bc499256bd218cf5a234869f53cee8debd1 (commit) via afef974bb852648f90af92683141a21ee4a8d091 (commit) from 39a8dc9d7f4aeb64b63374991a2b260072794460 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0beb8ff7535f788f432efe77036e3f85711ea09b Merge: 39a8dc9d7f4aeb64b63374991a2b260072794460 97f6d96b0439794ecba310a256fb884f0d4a45bc Author: Jan Kratochvil Date: Sat Jan 9 09:41:16 2010 +0100 Merge remote branch 'gdb/master' commit 97f6d96b0439794ecba310a256fb884f0d4a45bc Author: Joel Brobecker Date: Sat Jan 9 05:03:34 2010 +0000 Fix patch ownership in ChangeLog entry. commit 36f25a02af8a0f90c70d120f763595cf38943ace Author: Joel Brobecker Date: Sat Jan 9 04:44:55 2010 +0000 Signal unwinder for mips-irix N32. * mips-irix-tdep.c: #include mips-tdep.h, trad-frame.h, and tramp-frame.h. (SIGTRAMP_FRAME_SIZE, SIGCONTEXT_PC_OFF, SIGCONTEXT_REGS_OFF) (SIGCONTEXT_FPREGS_OFF, SIGCONTEXT_FPCSR_OFF, SIGCONTEXT_HI_OFF) (SIGCONTEXT_LO_OFF): New macros. (mips_irix_n32_tramp_frame_init): New function. (mips_irix_n32_tramp_frame): New static constant. (mips_irix_init_abi): Prepend the mips_irix_n32_tramp_frame unwinder. commit 6de8b8d63ed156636460945b6cc3e97438673a03 Author: Joel Brobecker Date: Sat Jan 9 04:44:02 2010 +0000 Breakpoint in shared library does not work on mips-irix. * procfs.c: #include "observer.h". (procfs_inferior_created): New function, moving here the code which unsets the syssgi syscall-exit notifications. (procfs_create_inferior): Remove the code which unsets the syssgi syscall-exit notifications. It is too early to do this here. (_initialize_procfs): Attach the procfs_inferior_created observer. commit cbc069857cf0f4472b8aca5a1698458589157a9c Author: Joel Brobecker Date: Sat Jan 9 04:42:53 2010 +0000 Wrong return convention for arrays (mips-irix). * mips-tdep.c (mips_n32n64_return_value): Arrays whose size is 128 bits or smaller are returned the same way as structs and unions of the the same size. commit 4d53683024cc12c9eb396ed372566ebccecc6fe0 Author: Joel Brobecker Date: Sat Jan 9 04:41:49 2010 +0000 Cannot set the PC on mips-irix. * irix5-nat.c (fill_gregset): Check regno against the raw PC register number, no the cooked one. commit 6cfbd29244ca246410ef4d5c812aac487b20909e Author: Joel Brobecker Date: Sat Jan 9 04:40:59 2010 +0000 Error while loading core file on mips-irix. * solib-irix.c (irix_solib_create_inferior_hook): Do nothing if debugging from a core file. commit 20d2b0c01a6843dc954dc59dabd710d18f0ac58d Author: Joel Brobecker Date: Sat Jan 9 04:40:02 2010 +0000 GDB hangs when attaching to process on mips-irix. * solib-irix.c (irix_solib_create_inferior_hook): Do nothing if attaching to a process. commit f848c0d286a68cc4d8d9fec6be657850a121fb82 Author: Joel Brobecker Date: Sat Jan 9 04:38:29 2010 +0000 * mips-tdep.c (mips_breakpoint_from_pc): Add new static variable containing the correct breakpoint instruction to use on mips-irix. Use it when the osabi is GDB_OSABI_IRIX. commit 9f0f19b693cebd4d538b6f5efded886f5af0442a Author: Joel Brobecker Date: Sat Jan 9 04:37:12 2010 +0000 -Wunused warning in procfs.c (mips-irix only). * procfs.c (gdb_praddset, gdb_prdelset): New macros. Use them throughout instead of using praddset and prdelset respectively. commit f1a97abbd8e9bb7fe0837e73497982c0231f04a8 Author: Joel Brobecker Date: Sat Jan 9 04:36:00 2010 +0000 GDB crash while stepping into function. * infrun.c (handle_inferior_event): Refetch the current frame after handling what.main_action, in case that pointer became dangling. commit 0a006d88022a5d60204b68a678870232f2b16331 Author: Joel Brobecker Date: Sat Jan 9 04:34:35 2010 +0000 * ada-valprint.c, parse.c: Include defs.h before including ctype.h. commit 6c24b94109720c7df9356e081975221036a10546 Author: Joel Brobecker Date: Sat Jan 9 04:32:51 2010 +0000 * procfs.c: (procfs_do_thread_registers) Use elfcore_write_lwpstatus. commit a5aae03cf8565630bba4924bad1e44182aad2488 Author: Jan Kratochvil Date: Sat Jan 9 00:14:11 2010 +0000 gdb/testsuite/ * gdb.base/corefile.exp: Move the core finding block out and call it as core_find, new variable $corefile, replace corefile by $corefile and [file tail $corefile] for usage vs. test names resp. * lib/gdb.exp (core_find): Move it as a new function here. New parameter binfile and deletefiles. New variable $destcore. Pre-delete $destcore. Return "" on error. commit 43bf433d8d9c8d1a3b23392bed3abf2275b3b37b Author: gdbadmin Date: Sat Jan 9 00:00:03 2010 +0000 *** empty log message *** commit 173121fc618e528481ceb3ee41e3f7399d26ce93 Author: Alan Modra Date: Fri Jan 8 23:00:05 2010 +0000 daily update commit 4efb761b57fcad92ffcdc7c40dd4729c34055d2d Author: Jan Kratochvil Date: Fri Jan 8 22:59:47 2010 +0000 gdb/testsuite/ Workaround PR binutils/10802. * lib/gdb.exp (gdb_gnu_strip_debug): Preserve the file attributes (twice). commit b12e8bc499256bd218cf5a234869f53cee8debd1 Author: Jan Kratochvil Date: Fri Jan 8 22:55:14 2010 +0000 gdb/ Move some symfile code into subroutines. * symfile.h (relative_addr_info_to_section_offsets) (addr_info_make_relative): New prototypes. * symfile.c (default_symfile_offsets): Move a part to ... (relative_addr_info_to_section_offsets): ... this new function. (default_symfile_offsets): Call it. (syms_from_objfile other[0].name>): Move this part to ... (addr_info_make_relative): ... this new function. commit afef974bb852648f90af92683141a21ee4a8d091 Author: Jan Kratochvil Date: Fri Jan 8 22:52:03 2010 +0000 gdb/ Add from_tty to solib_create_inferior_hook. * infcmd.c (post_create_inferior): Move solib_add after solib_create_inferior_hook. Pass from_tty to solib_create_inferior_hook. Call solib_add and SOLIB_ADD with 0 from_tty and comment why. * infrun.c (follow_exec): Pass from_tty solib_create_inferior_hook as 0. * linux-nat.c (linux_child_follow_fork): Likewise. * nto-procfs.c (procfs_post_attach, procfs_create_inferior): Likewise. * solib-darwin.c (darwin_solib_create_inferior_hook): New parameter from_tty. * solib-frv.c (frv_solib_create_inferior_hook): Likewise. * solib-irix.c (irix_solib_create_inferior_hook): Likewise. * solib-null.c (null_solib_create_inferior_hook): Likewise. * solib-osf.c (osf_solib_create_inferior_hook): Likewise. * solib-pa64.c (pa64_solib_create_inferior_hook): Likewise. * solib-som.c (som_solib_create_inferior_hook): Likewise. * solib-spu.c (spu_solib_create_inferior_hook): New parameter from_tty. Pass it to svr4_so_ops.solib_create_inferior_hook. * solib-sunos.c (sunos_solib_create_inferior_hook): New parameter from_tty. * solib-svr4.c (enable_break): New parameter from_tty. Pass it to solib_add. (svr4_solib_create_inferior_hook): New parameter from_tty. Pass it to enable_break. * solib-target.c (solib_target_solib_create_inferior_hook): New parameter from_tty. * solib.c (solib_create_inferior_hook): New parameter from_tty. Pass it to ops->solib_create_inferior_hook. (reload_shared_libraries): Pass from_tty to solib_create_inferior_hook. Move solib_add after solib_create_inferior_hook, call it now with from_tty as 0. New comment there. * solib.h (solib_create_inferior_hook): New parameter from_tty. * solist.h (struct target_so_ops ): Likewise. ----------------------------------------------------------------------- Summary of changes: bfd/version.h | 2 +- gdb/ChangeLog | 128 ++++++++++++++++++++++++++- gdb/ada-valprint.c | 2 +- gdb/infcmd.c | 36 ++++---- gdb/infrun.c | 7 ++- gdb/irix5-nat.c | 2 +- gdb/linux-nat.c | 4 +- gdb/mips-irix-tdep.c | 153 ++++++++++++++++++++++++++++++++- gdb/mips-tdep.c | 15 ++- gdb/nto-procfs.c | 4 +- gdb/parse.c | 3 +- gdb/procfs.c | 44 ++++++++-- gdb/solib-darwin.c | 2 +- gdb/solib-frv.c | 2 +- gdb/solib-irix.c | 17 +++- gdb/solib-null.c | 2 +- gdb/solib-osf.c | 2 +- gdb/solib-pa64.c | 2 +- gdb/solib-som.c | 2 +- gdb/solib-spu.c | 4 +- gdb/solib-sunos.c | 2 +- gdb/solib-svr4.c | 12 ++-- gdb/solib-target.c | 2 +- gdb/solib.c | 19 +++- gdb/solib.h | 2 +- gdb/solist.h | 2 +- gdb/symfile.c | 166 +++++++++++++++++++---------------- gdb/symfile.h | 7 ++ gdb/testsuite/ChangeLog | 15 +++ gdb/testsuite/gdb.base/corefile.exp | 87 ++++--------------- gdb/testsuite/lib/gdb.exp | 79 ++++++++++++++++- gdb/version.in | 2 +- 32 files changed, 611 insertions(+), 217 deletions(-) First 500 lines of diff: diff --git a/bfd/version.h b/bfd/version.h index 6113528..5d88b80 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20100108 +#define BFD_VERSION_DATE 20100109 #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 bfb8d29..1ff5f35 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,129 @@ +2010-01-09 Joel Brobecker + + Signal unwinder for mips-irix N32. + * mips-irix-tdep.c: #include mips-tdep.h, trad-frame.h, and + tramp-frame.h. + (SIGTRAMP_FRAME_SIZE, SIGCONTEXT_PC_OFF, SIGCONTEXT_REGS_OFF) + (SIGCONTEXT_FPREGS_OFF, SIGCONTEXT_FPCSR_OFF, SIGCONTEXT_HI_OFF) + (SIGCONTEXT_LO_OFF): New macros. + (mips_irix_n32_tramp_frame_init): New function. + (mips_irix_n32_tramp_frame): New static constant. + (mips_irix_init_abi): Prepend the mips_irix_n32_tramp_frame unwinder. + +2010-01-09 Joel Brobecker + + Breakpoint in shared library does not work on mips-irix. + * procfs.c: #include "observer.h". + (procfs_inferior_created): New function, moving here the code + which unsets the syssgi syscall-exit notifications. + (procfs_create_inferior): Remove the code which unsets the syssgi + syscall-exit notifications. It is too early to do this here. + (_initialize_procfs): Attach the procfs_inferior_created observer. + +2010-01-09 Joel Brobecker + + Wrong return convention for arrays (mips-irix). + * mips-tdep.c (mips_n32n64_return_value): Arrays whose size is + 128 bits or smaller are returned the same way as structs + and unions of the the same size. + +2010-01-09 Joel Brobecker + + Cannot set the PC on mips-irix. + * irix5-nat.c (fill_gregset): Check regno against the raw PC + register number, no the cooked one. + +2010-01-09 Joel Brobecker + + Error while loading core file on mips-irix. + * solib-irix.c (irix_solib_create_inferior_hook): Do nothing + if debugging from a core file. + +2010-01-09 Joel Brobecker + + GDB hangs when attaching to process on mips-irix. + * solib-irix.c (irix_solib_create_inferior_hook): Do nothing if + attaching to a process. + +2010-01-09 Joel Brobecker + + Use the correct breakpoint instruction on mips-irix. + * mips-tdep.c (mips_breakpoint_from_pc): Add new static variable + containing the correct breakpoint instruction to use on mips-irix. + Use it when the osabi is GDB_OSABI_IRIX. + +2010-01-09 Joel Brobecker + + -Wunused warning in procfs.c (mips-irix only). + * procfs.c (gdb_praddset, gdb_prdelset): New macros. Use them + throughout instead of using praddset and prdelset respectively. + +2010-01-09 Joel Brobecker + + GDB crash while stepping into function. + * infrun.c (handle_inferior_event): Refetch the current frame + after handling what.main_action, in case that pointer became + dangling. + +2010-01-09 Joel Brobecker + + Fix build failure of solaris-hosted cross debuggers. + * ada-valprint.c, parse.c: Include defs.h before including ctype.h. + +2010-01-09 Daniel Gutson + + Fix build failure on sparc-solaris. + * procfs.c: (procfs_do_thread_registers) Use elfcore_write_lwpstatus. + +2010-01-08 Jan Kratochvil + + Move some symfile code into subroutines. + * symfile.h (relative_addr_info_to_section_offsets) + (addr_info_make_relative): New prototypes. + * symfile.c (default_symfile_offsets): Move a part to ... + (relative_addr_info_to_section_offsets): ... this new function. + (default_symfile_offsets): Call it. + (syms_from_objfile other[0].name>): Move + this part to ... + (addr_info_make_relative): ... this new function. + +2010-01-08 Jan Kratochvil + + Add from_tty to solib_create_inferior_hook. + * infcmd.c (post_create_inferior): Move solib_add after + solib_create_inferior_hook. Pass from_tty to + solib_create_inferior_hook. Call solib_add and SOLIB_ADD with + 0 from_tty and comment why. + * infrun.c (follow_exec): Pass from_tty solib_create_inferior_hook as 0. + * linux-nat.c (linux_child_follow_fork): Likewise. + * nto-procfs.c (procfs_post_attach, procfs_create_inferior): Likewise. + * solib-darwin.c (darwin_solib_create_inferior_hook): New parameter + from_tty. + * solib-frv.c (frv_solib_create_inferior_hook): Likewise. + * solib-irix.c (irix_solib_create_inferior_hook): Likewise. + * solib-null.c (null_solib_create_inferior_hook): Likewise. + * solib-osf.c (osf_solib_create_inferior_hook): Likewise. + * solib-pa64.c (pa64_solib_create_inferior_hook): Likewise. + * solib-som.c (som_solib_create_inferior_hook): Likewise. + * solib-spu.c (spu_solib_create_inferior_hook): New parameter from_tty. + Pass it to svr4_so_ops.solib_create_inferior_hook. + * solib-sunos.c (sunos_solib_create_inferior_hook): New parameter + from_tty. + * solib-svr4.c (enable_break): New parameter from_tty. Pass it to + solib_add. + (svr4_solib_create_inferior_hook): New parameter from_tty. Pass it to + enable_break. + * solib-target.c (solib_target_solib_create_inferior_hook): New + parameter from_tty. + * solib.c (solib_create_inferior_hook): New parameter from_tty. Pass + it to ops->solib_create_inferior_hook. + (reload_shared_libraries): Pass from_tty to solib_create_inferior_hook. + Move solib_add after solib_create_inferior_hook, call it now with + from_tty as 0. New comment there. + * solib.h (solib_create_inferior_hook): New parameter from_tty. + * solist.h (struct target_so_ops ): + Likewise. + 2010-01-08 Vladimir Prus Fix multiexec race. @@ -22,7 +148,7 @@ (ada_print_type): Remove support for VAX floats. * ada-valprint.c (ada_val_print_1): Remove support for VAX floats. -2010-01-08 jan kratochvil +2010-01-08 Jan Kratochvil * stabsread.c (read_args): Handle zero arguments. diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index e000411..4f644b8 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -19,8 +19,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include #include "defs.h" +#include #include "gdb_string.h" #include "symtab.h" #include "gdbtypes.h" diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 821ae5f..21a2233 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -397,22 +397,6 @@ post_create_inferior (struct target_ops *target, int from_tty) /* Now that we know the register layout, retrieve current PC. */ stop_pc = regcache_read_pc (get_current_regcache ()); - /* If the solist is global across processes, there's no need to - refetch it here. */ - if (exec_bfd && !gdbarch_has_global_solist (target_gdbarch)) - { - /* Sometimes the platform-specific hook loads initial shared - libraries, and sometimes it doesn't. Try to do so first, so - that we can add them with the correct value for FROM_TTY. - If we made all the inferior hook methods consistent, - this call could be removed. */ -#ifdef SOLIB_ADD - SOLIB_ADD (NULL, from_tty, target, auto_solib_add); -#else - solib_add (NULL, from_tty, target, auto_solib_add); -#endif - } - if (exec_bfd) { /* Create the hooks to handle shared library load and unload @@ -420,7 +404,25 @@ post_create_inferior (struct target_ops *target, int from_tty) #ifdef SOLIB_CREATE_INFERIOR_HOOK SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); #else - solib_create_inferior_hook (); + solib_create_inferior_hook (from_tty); +#endif + } + + /* If the solist is global across processes, there's no need to + refetch it here. */ + if (exec_bfd && !gdbarch_has_global_solist (target_gdbarch)) + { + /* Sometimes the platform-specific hook loads initial shared + libraries, and sometimes it doesn't. If it doesn't FROM_TTY will be + incorrectly 0 but such solib targets should be fixed anyway. If we + made all the inferior hook methods consistent, this call could be + removed. Call it only after the solib target has been initialized by + solib_create_inferior_hook. */ + +#ifdef SOLIB_ADD + SOLIB_ADD (NULL, 0, target, auto_solib_add); +#else + solib_add (NULL, 0, target, auto_solib_add); #endif } diff --git a/gdb/infrun.c b/gdb/infrun.c index cfa7e82..426b816 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -764,7 +764,7 @@ follow_exec (ptid_t pid, char *execd_pathname) #ifdef SOLIB_CREATE_INFERIOR_HOOK SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); #else - solib_create_inferior_hook (); + solib_create_inferior_hook (0); #endif jit_inferior_created_hook (); @@ -4066,6 +4066,11 @@ infrun: not switching back to stepped thread, it has vanished\n"); return; } + /* Re-fetch current thread's frame in case the code above caused + the frame cache to be re-initialized, making our FRAME variable + a dangling pointer. */ + frame = get_current_frame (); + /* If stepping through a line, keep going if still within it. Note that step_range_end is the address of the first instruction diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index d8e1073..f7454dc 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -98,7 +98,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno) *(regp + regi) = extract_signed_integer (buf, size, byte_order); } - if ((regno == -1) || (regno == gdbarch_pc_regnum (gdbarch))) + if ((regno == -1) || (regno == mips_regnum (gdbarch)->pc)) { regi = mips_regnum (gdbarch)->pc; size = register_size (gdbarch, regi); diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 0c95b95..48ea1bc 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -769,7 +769,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ breakpoint. If a "cloned-VM" event was propagated better throughout the core, this wouldn't be required. */ - solib_create_inferior_hook (); + solib_create_inferior_hook (0); } /* Let the thread_db layer learn about this new process. */ @@ -952,7 +952,7 @@ Attaching after process %d fork to child process %d.\n"), shared libraries, and install the solib event breakpoint. If a "cloned-VM" event was propagated better throughout the core, this wouldn't be required. */ - solib_create_inferior_hook (); + solib_create_inferior_hook (0); } /* Let the thread_db layer learn about this new process. */ diff --git a/gdb/mips-irix-tdep.c b/gdb/mips-irix-tdep.c index 92d1489..1965964 100644 --- a/gdb/mips-irix-tdep.c +++ b/gdb/mips-irix-tdep.c @@ -23,8 +23,10 @@ #include "gdb_string.h" #include "solib.h" #include "solib-irix.h" - #include "elf-bfd.h" +#include "mips-tdep.h" +#include "trad-frame.h" +#include "tramp-frame.h" static void mips_irix_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, @@ -77,11 +79,160 @@ mips_irix_elf_osabi_sniffer (bfd *abfd) return osabi; } +/* Unwinding past the signal handler on mips-irix. + + Note: The following has only been tested with N32, but can probably + be made to work with a small number of adjustments. + + On mips-irix, the sigcontext_t structure is stored at the base + of the frame established by the _sigtramp function. The definition + of this structure can be found in (comments have been + C++'ified to avoid a collision with the C-style comment delimiters + used by this comment): + + typedef struct sigcontext { + __uint32_t sc_regmask; // regs to restore in sigcleanup + __uint32_t sc_status; // cp0 status register + __uint64_t sc_pc; // pc at time of signal + // General purpose registers + __uint64_t sc_regs[32]; // processor regs 0 to 31 + // Floating point coprocessor state + __uint64_t sc_fpregs[32]; // fp regs 0 to 31 + __uint32_t sc_ownedfp; // fp has been used + __uint32_t sc_fpc_csr; // fpu control and status reg + __uint32_t sc_fpc_eir; // fpu exception instruction reg + // implementation/revision + __uint32_t sc_ssflags; // signal stack state to restore + __uint64_t sc_mdhi; // Multiplier hi and low regs + __uint64_t sc_mdlo; + // System coprocessor registers at time of signal + __uint64_t sc_cause; // cp0 cause register + __uint64_t sc_badvaddr; // cp0 bad virtual address + __uint64_t sc_triggersave; // state of graphics trigger (SGI) + sigset_t sc_sigset; // signal mask to restore + __uint64_t sc_fp_rounded_result; // for Ieee 754 support + __uint64_t sc_pad[31]; + } sigcontext_t; + + The following macros provide the offset of some of the fields + used to retrieve the value of the registers before the signal + was raised. */ + +/* The size of the sigtramp frame. The sigtramp frame base can then + be computed by adding this size to the SP. */ +#define SIGTRAMP_FRAME_SIZE 48 +/* The offset in sigcontext_t where the PC is saved. */ +#define SIGCONTEXT_PC_OFF 8 +/* The offset in sigcontext_t where the GP registers are saved. */ +#define SIGCONTEXT_REGS_OFF (SIGCONTEXT_PC_OFF + 8) +/* The offset in sigcontext_t where the FP regsiters are saved. */ +#define SIGCONTEXT_FPREGS_OFF (SIGCONTEXT_REGS_OFF + 32 * 8) +/* The offset in sigcontext_t where the FP CSR register is saved. */ +#define SIGCONTEXT_FPCSR_OFF (SIGCONTEXT_FPREGS_OFF + 32 * 8 + 4) +/* The offset in sigcontext_t where the multiplier hi register is saved. */ +#define SIGCONTEXT_HI_OFF (SIGCONTEXT_FPCSR_OFF + 2 * 4) +/* The offset in sigcontext_t where the multiplier lo register is saved. */ +#define SIGCONTEXT_LO_OFF (SIGCONTEXT_HI_OFF + 4) + +/* Implement the "init" routine in struct tramp_frame for the N32 ABI + on mips-irix. */ +static void +mips_irix_n32_tramp_frame_init (const struct tramp_frame *self, + struct frame_info *this_frame, + struct trad_frame_cache *this_cache, + CORE_ADDR func) +{ + struct gdbarch *gdbarch = get_frame_arch (this_frame); + const int num_regs = gdbarch_num_regs (gdbarch); + int sp_cooked_regno = num_regs + MIPS_SP_REGNUM; + const CORE_ADDR sp = get_frame_register_signed (this_frame, sp_cooked_regno); + const CORE_ADDR sigcontext_base = sp + 48; + const struct mips_regnum *regs = mips_regnum (gdbarch); + int ireg; + + trad_frame_set_reg_addr (this_cache, regs->pc + gdbarch_num_regs (gdbarch), + sigcontext_base + SIGCONTEXT_PC_OFF); + + for (ireg = 1; ireg < 32; ireg++) + trad_frame_set_reg_addr (this_cache, ireg + MIPS_ZERO_REGNUM + num_regs, + sigcontext_base + SIGCONTEXT_REGS_OFF + ireg * 8); + + for (ireg = 0; ireg < 32; ireg++) + trad_frame_set_reg_addr (this_cache, ireg + regs->fp0 + num_regs, + sigcontext_base + SIGCONTEXT_FPREGS_OFF + + ireg * 8); + + trad_frame_set_reg_addr (this_cache, regs->fp_control_status + num_regs, + sigcontext_base + SIGCONTEXT_FPCSR_OFF); + + trad_frame_set_reg_addr (this_cache, regs->hi + num_regs, + sigcontext_base + SIGCONTEXT_HI_OFF); + + trad_frame_set_reg_addr (this_cache, regs->lo + num_regs, + sigcontext_base + SIGCONTEXT_LO_OFF); + + trad_frame_set_id (this_cache, frame_id_build (sigcontext_base, func)); +} + +/* The tramp_frame structure describing sigtramp frames on mips-irix N32. + + Note that the list of instructions below is pretty much a pure dump + of function _sigtramp on mips-irix. A few instructions are actually + not tested (mask set to 0), because a portion of these instructions + contain an address which changes due to relocation. We could use + a smarter mask that checks the instrutction code alone, but given + the number of instructions already being checked, this seemed + unnecessary. */ + +static const struct tramp_frame mips_irix_n32_tramp_frame = +{ + SIGTRAMP_FRAME, + 4, + { + { 0x3c0c8000, -1 }, /* lui t0,0x8000 */ + { 0x27bdffd0, -1 }, /* addiu sp,sp,-48 */ + { 0x008c6024, -1 }, /* and t0,a0,t0 */ + { 0xffa40018, -1 }, /* sd a0,24(sp) */ + { 0x00000000, 0 }, /* beqz t0,0xfaefcb8 <_sigtramp+40> */ + { 0xffa60028, -1 }, /* sd a2,40(sp) */ + { 0x01806027, -1 }, /* nor t0,t0,zero */ + { 0xffa00020, -1 }, /* sd zero,32(sp) */ + { 0x00000000, 0 }, /* b 0xfaefcbc <_sigtramp+44> */ + { 0x008c2024, -1 }, /* and a0,a0,t0 */ + { 0xffa60020, -1 }, /* sd a2,32(sp) */ + { 0x03e0c025, -1 }, /* move t8,ra */ + { 0x00000000, 0 }, /* bal 0xfaefcc8 <_sigtramp+56> */ + { 0x00000000, -1 }, /* nop */ + { 0x3c0c0007, -1 }, /* lui t0,0x7 */ + { 0x00e0c825, -1 }, /* move t9,a3 */ + { 0x658c80fc, -1 }, /* daddiu t0,t0,-32516 */ + { 0x019f602d, -1 }, /* daddu t0,t0,ra */ + { 0x0300f825, -1 }, /* move ra,t8 */ + { 0x8d8c9880, -1 }, /* lw t0,-26496(t0) */ + { 0x8d8c0000, -1 }, /* lw t0,0(t0) */ + { 0x8d8d0000, -1 }, /* lw t1,0(t0) */ + { 0xffac0008, -1 }, /* sd t0,8(sp) */ + { 0x0320f809, -1 }, /* jalr t9 */ + { 0xffad0010, -1 }, /* sd t1,16(sp) */ + { 0xdfad0010, -1 }, /* ld t1,16(sp) */ + { 0xdfac0008, -1 }, /* ld t0,8(sp) */ + { 0xad8d0000, -1 }, /* sw t1,0(t0) */ + { 0xdfa40020, -1 }, /* ld a0,32(sp) */ + { 0xdfa50028, -1 }, /* ld a1,40(sp) */ + { 0xdfa60018, -1 }, /* ld a2,24(sp) */ + { 0x24020440, -1 }, /* li v0,1088 */ + { 0x0000000c, -1 }, /* syscall */ + { TRAMP_SENTINEL_INSN, -1 } + }, + mips_irix_n32_tramp_frame_init +}; + static void mips_irix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { set_solib_ops (gdbarch, &irix_so_ops); + tramp_frame_prepend_unwinder (gdbarch, &mips_irix_n32_tramp_frame); } /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 2748805..6749c27 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -3379,7 +3379,7 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type, (and $f2 if necessary). This is a generalization of the Fortran COMPLEX case. - * Any other struct or union results of at most 128 bits are returned in + * Any other composite results of at most 128 bits are returned in $2 (first 64 bits) and $3 (remainder, if necessary). * Larger composite results are handled by converting the function to a @@ -3390,8 +3390,7 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type, specific exception to return COMPLEX results in the floating point registers.] */ - if (TYPE_CODE (type) == TYPE_CODE_ARRAY - || TYPE_LENGTH (type) > 2 * MIPS64_REGSIZE) + if (TYPE_LENGTH (type) > 2 * MIPS64_REGSIZE) return RETURN_VALUE_STRUCT_CONVENTION; else if (TYPE_CODE (type) == TYPE_CODE_FLT && TYPE_LENGTH (type) == 16 @@ -3481,9 +3480,10 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type, return RETURN_VALUE_REGISTER_CONVENTION; } else if (TYPE_CODE (type) == TYPE_CODE_STRUCT - || TYPE_CODE (type) == TYPE_CODE_UNION) + || TYPE_CODE (type) == TYPE_CODE_UNION + || TYPE_CODE (type) == TYPE_CODE_ARRAY) { - /* A structure or union. Extract the left justified value, + /* A composite type. Extract the left justified value, regardless of the byte order. I.e. DO NOT USE mips_xfer_lower. */ int offset; @@ -5045,6 +5045,9 @@ mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) static gdb_byte big_breakpoint[] = { 0, 0x5, 0, 0xd }; static gdb_byte pmon_big_breakpoint[] = { 0, 0, 0, 0xd }; static gdb_byte idt_big_breakpoint[] = { 0, 0, 0x0a, 0xd }; + /* Likewise, IRIX appears to expect a different breakpoint, + although this is not apparent until you try to use pthreads. */ hooks/post-receive -- Repository for Project Archer.