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

« back to all changes in this revision

Viewing changes to gdb/mips-linux-tdep.c

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Target-dependent code for GNU/Linux on MIPS processors.
2
2
 
3
 
   Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009
 
3
   Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4
4
   Free Software Foundation, Inc.
5
5
 
6
6
   This file is part of GDB.
797
797
 
798
798
   struct sigframe {
799
799
     u32 sf_ass[4];            [argument save space for o32]
800
 
     u32 sf_code[2];           [signal trampoline]
 
800
     u32 sf_code[2];           [signal trampoline or fill]
801
801
     struct sigcontext sf_sc;
802
802
     sigset_t sf_mask;
803
803
   };
827
827
 
828
828
   struct rt_sigframe {
829
829
     u32 rs_ass[4];            [argument save space for o32]
830
 
     u32 rs_code[2]            [signal trampoline]
 
830
     u32 rs_code[2]            [signal trampoline or fill]
831
831
     struct siginfo rs_info;
832
832
     struct ucontext rs_uc;
833
833
   };
842
842
   };  */
843
843
/* *INDENT-ON* */
844
844
 
845
 
#define SIGFRAME_CODE_OFFSET         (4 * 4)
846
845
#define SIGFRAME_SIGCONTEXT_OFFSET   (6 * 4)
847
846
 
848
847
#define RTSIGFRAME_SIGINFO_SIZE      128
871
870
{
872
871
  struct gdbarch *gdbarch = get_frame_arch (this_frame);
873
872
  int ireg, reg_position;
874
 
  CORE_ADDR sigcontext_base = func - SIGFRAME_CODE_OFFSET;
 
873
  CORE_ADDR frame_sp = get_frame_sp (this_frame);
 
874
  CORE_ADDR sigcontext_base;
875
875
  const struct mips_regnum *regs = mips_regnum (gdbarch);
876
876
  CORE_ADDR regs_base;
877
877
 
878
878
  if (self == &mips_linux_o32_sigframe)
879
 
    sigcontext_base += SIGFRAME_SIGCONTEXT_OFFSET;
 
879
    sigcontext_base = frame_sp + SIGFRAME_SIGCONTEXT_OFFSET;
880
880
  else
881
 
    sigcontext_base += RTSIGFRAME_SIGCONTEXT_OFFSET;
 
881
    sigcontext_base = frame_sp + RTSIGFRAME_SIGCONTEXT_OFFSET;
882
882
 
883
883
  /* I'm not proud of this hack.  Eventually we will have the
884
884
     infrastructure to indicate the size of saved registers on a
947
947
                           sigcontext_base + SIGCONTEXT_BADVADDR);
948
948
 
949
949
  /* Choice of the bottom of the sigframe is somewhat arbitrary.  */
950
 
  trad_frame_set_id (this_cache,
951
 
                     frame_id_build (func - SIGFRAME_CODE_OFFSET,
952
 
                                     func));
 
950
  trad_frame_set_id (this_cache, frame_id_build (frame_sp, func));
953
951
}
954
952
 
955
953
/* *INDENT-OFF* */
957
955
 
958
956
  struct rt_sigframe_n32 {
959
957
    u32 rs_ass[4];                  [ argument save space for o32 ]
960
 
    u32 rs_code[2];                 [ signal trampoline ]
 
958
    u32 rs_code[2];                 [ signal trampoline or fill ]
961
959
    struct siginfo rs_info;
962
960
    struct ucontextn32 rs_uc;
963
961
  };
1038
1036
{
1039
1037
  struct gdbarch *gdbarch = get_frame_arch (this_frame);
1040
1038
  int ireg, reg_position;
1041
 
  CORE_ADDR sigcontext_base = func - SIGFRAME_CODE_OFFSET;
 
1039
  CORE_ADDR frame_sp = get_frame_sp (this_frame);
 
1040
  CORE_ADDR sigcontext_base;
1042
1041
  const struct mips_regnum *regs = mips_regnum (gdbarch);
1043
1042
 
1044
1043
  if (self == &mips_linux_n32_rt_sigframe)
1045
 
    sigcontext_base += N32_SIGFRAME_SIGCONTEXT_OFFSET;
 
1044
    sigcontext_base = frame_sp + N32_SIGFRAME_SIGCONTEXT_OFFSET;
1046
1045
  else
1047
 
    sigcontext_base += N64_SIGFRAME_SIGCONTEXT_OFFSET;
 
1046
    sigcontext_base = frame_sp + N64_SIGFRAME_SIGCONTEXT_OFFSET;
1048
1047
 
1049
1048
  if (mips_linux_restart_reg_p (gdbarch))
1050
1049
    trad_frame_set_reg_addr (this_cache,
1082
1081
                           sigcontext_base + N64_SIGCONTEXT_LO);
1083
1082
 
1084
1083
  /* Choice of the bottom of the sigframe is somewhat arbitrary.  */
1085
 
  trad_frame_set_id (this_cache,
1086
 
                     frame_id_build (func - SIGFRAME_CODE_OFFSET,
1087
 
                                     func));
 
1084
  trad_frame_set_id (this_cache, frame_id_build (frame_sp, func));
1088
1085
}
1089
1086
 
1090
1087
static void