This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH]: MULTI_ARCH fix-up



2000-08-09  Michael Snyder  <msnyder@cleaver.cygnus.com>

        * blockframe.c (sigtramp_saved_pc): Use dynamic allocation,
        since TARGET_PTR_BIT is no longer a constant (MULTI_ARCH).
        * irix4-nat.c (get_longjmp_target): Ditto.
        * irix5-nat.c (get_longjmp_target): Ditto.
        * jv-valprint.c (java_value_print): Ditto.
        * m3-nat.c (get_cprocs):            Ditto.
        * m68k-tdep.c (get_longjmp_target): Ditto.
        * mips-nat.c  (get_longjmp_target): Ditto.
        * mipsv4-nat.c(get_longjmp_target): Ditto.
        * pa64solib.c (read_dynamic_info):  Ditto.
        * solib.c (elf_locate_base):        Ditto.

Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.5
diff -p -r1.5 blockframe.c
*** blockframe.c	2000/07/30 01:48:24	1.5
--- blockframe.c	2000/08/09 20:07:01
*************** CORE_ADDR
*** 950,959 ****
  sigtramp_saved_pc (struct frame_info *frame)
  {
    CORE_ADDR sigcontext_addr;
!   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
    int ptrbytes = TARGET_PTR_BIT / TARGET_CHAR_BIT;
    int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT;
  
    /* Get sigcontext address, it is the third parameter on the stack.  */
    if (frame->next)
      sigcontext_addr = read_memory_integer (FRAME_ARGS_ADDRESS (frame->next)
--- 950,960 ----
  sigtramp_saved_pc (struct frame_info *frame)
  {
    CORE_ADDR sigcontext_addr;
!   char *buf;
    int ptrbytes = TARGET_PTR_BIT / TARGET_CHAR_BIT;
    int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT;
  
+   buf = alloca (ptrbytes);
    /* Get sigcontext address, it is the third parameter on the stack.  */
    if (frame->next)
      sigcontext_addr = read_memory_integer (FRAME_ARGS_ADDRESS (frame->next)
Index: irix4-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/irix4-nat.c,v
retrieving revision 1.4
diff -p -r1.4 irix4-nat.c
*** irix4-nat.c	2000/07/30 01:48:25	1.4
--- irix4-nat.c	2000/08/09 20:07:01
*************** fill_fpregset (fpregset_t *fpregsetp, in
*** 145,153 ****
  int
  get_longjmp_target (CORE_ADDR *pc)
  {
!   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
    CORE_ADDR jb_addr;
  
    jb_addr = read_register (A0_REGNUM);
  
    if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
--- 145,154 ----
  int
  get_longjmp_target (CORE_ADDR *pc)
  {
!   char *buf;
    CORE_ADDR jb_addr;
  
+   buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
    jb_addr = read_register (A0_REGNUM);
  
    if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
Index: irix5-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/irix5-nat.c,v
retrieving revision 1.7
diff -p -r1.7 irix5-nat.c
*** irix5-nat.c	2000/07/30 01:48:25	1.7
--- irix5-nat.c	2000/08/09 20:07:01
*************** fill_fpregset (fpregset_t *fpregsetp, in
*** 165,173 ****
  int
  get_longjmp_target (CORE_ADDR *pc)
  {
!   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
    CORE_ADDR jb_addr;
  
    jb_addr = read_register (A0_REGNUM);
  
    if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
--- 165,174 ----
  int
  get_longjmp_target (CORE_ADDR *pc)
  {
!   char *buf;
    CORE_ADDR jb_addr;
  
+   buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
    jb_addr = read_register (A0_REGNUM);
  
    if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
Index: jv-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-valprint.c,v
retrieving revision 1.3
diff -p -r1.3 jv-valprint.c
*** jv-valprint.c	2000/07/30 01:48:26	1.3
--- jv-valprint.c	2000/08/09 20:07:01
*************** java_value_print (value_ptr val, struct 
*** 96,103 ****
  
  	  while (i < length && things_printed < print_max)
  	    {
! 	      char buf[TARGET_PTR_BIT / HOST_CHAR_BIT];
  
  	      fputs_filtered (", ", stream);
  	      wrap_here (n_spaces (2));
  
--- 96,104 ----
  
  	  while (i < length && things_printed < print_max)
  	    {
! 	      char *buf;
  
+ 	      buf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
  	      fputs_filtered (", ", stream);
  	      wrap_here (n_spaces (2));
  
Index: m3-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/m3-nat.c,v
retrieving revision 1.3
diff -p -r1.3 m3-nat.c
*** m3-nat.c	2000/07/30 01:48:26	1.3
--- m3-nat.c	2000/08/09 20:07:01
*************** get_cprocs (void)
*** 2460,2470 ****
    gdb_thread_t cproc_head;
    gdb_thread_t cproc_copy;
    CORE_ADDR their_cprocs;
!   char *buf[TARGET_PTR_BIT / HOST_CHAR_BIT];
    char *name;
    cthread_t cthread;
    CORE_ADDR symaddr;
  
    symaddr = lookup_address_of_variable ("cproc_list");
  
    if (!symaddr)
--- 2460,2471 ----
    gdb_thread_t cproc_head;
    gdb_thread_t cproc_copy;
    CORE_ADDR their_cprocs;
!   char *buf;
    char *name;
    cthread_t cthread;
    CORE_ADDR symaddr;
  
+   buf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
    symaddr = lookup_address_of_variable ("cproc_list");
  
    if (!symaddr)
Index: m68k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68k-tdep.c,v
retrieving revision 1.6
diff -p -r1.6 m68k-tdep.c
*** m68k-tdep.c	2000/07/30 01:48:26	1.6
--- m68k-tdep.c	2000/08/09 20:07:01
*************** fill_fpregset (fpregset_t *fpregsetp, in
*** 646,654 ****
  int
  get_longjmp_target (CORE_ADDR *pc)
  {
!   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
    CORE_ADDR sp, jb_addr;
  
    sp = read_register (SP_REGNUM);
  
    if (target_read_memory (sp + SP_ARG0,		/* Offset of first arg on stack */
--- 646,655 ----
  int
  get_longjmp_target (CORE_ADDR *pc)
  {
!   char *buf;
    CORE_ADDR sp, jb_addr;
  
+   buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
    sp = read_register (SP_REGNUM);
  
    if (target_read_memory (sp + SP_ARG0,		/* Offset of first arg on stack */
Index: mips-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-nat.c,v
retrieving revision 1.3
diff -p -r1.3 mips-nat.c
*** mips-nat.c	2000/07/30 01:48:26	1.3
--- mips-nat.c	2000/08/09 20:07:01
*************** int
*** 137,144 ****
  get_longjmp_target (CORE_ADDR *pc)
  {
    CORE_ADDR jb_addr;
!   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
  
    jb_addr = read_register (A0_REGNUM);
  
    if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
--- 137,145 ----
  get_longjmp_target (CORE_ADDR *pc)
  {
    CORE_ADDR jb_addr;
!   char *buf;
  
+   buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
    jb_addr = read_register (A0_REGNUM);
  
    if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
Index: mipsv4-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/mipsv4-nat.c,v
retrieving revision 1.3
diff -p -r1.3 mipsv4-nat.c
*** mipsv4-nat.c	2000/07/30 01:48:26	1.3
--- mipsv4-nat.c	2000/08/09 20:07:01
*************** fill_fpregset (fpregset_t *fpregsetp, in
*** 143,151 ****
  int
  get_longjmp_target (CORE_ADDR *pc)
  {
!   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
    CORE_ADDR jb_addr;
  
    jb_addr = read_register (A0_REGNUM);
  
    if (target_read_memory (jb_addr + _JB_PC * JB_ELEMENT_SIZE, buf,
--- 143,152 ----
  int
  get_longjmp_target (CORE_ADDR *pc)
  {
!   char *buf;
    CORE_ADDR jb_addr;
  
+   buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
    jb_addr = read_register (A0_REGNUM);
  
    if (target_read_memory (jb_addr + _JB_PC * JB_ELEMENT_SIZE, buf,
Index: pa64solib.c
===================================================================
RCS file: /cvs/src/src/gdb/pa64solib.c,v
retrieving revision 1.5
diff -p -r1.5 pa64solib.c
*** pa64solib.c	2000/07/30 01:48:26	1.5
--- pa64solib.c	2000/08/09 20:07:01
*************** read_dynamic_info (asection *dyninfo_sec
*** 1019,1026 ****
        Elf64_Dyn *x_dynp = (Elf64_Dyn*)buf;
        Elf64_Sxword dyn_tag;
        CORE_ADDR	dyn_ptr;
!       char pbuf[TARGET_PTR_BIT / HOST_CHAR_BIT];
  
        dyn_tag = bfd_h_get_64 (symfile_objfile->obfd, 
  			      (bfd_byte*) &x_dynp->d_tag);
  
--- 1019,1027 ----
        Elf64_Dyn *x_dynp = (Elf64_Dyn*)buf;
        Elf64_Sxword dyn_tag;
        CORE_ADDR	dyn_ptr;
!       char *pbuf;
  
+       pbuf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
        dyn_tag = bfd_h_get_64 (symfile_objfile->obfd, 
  			      (bfd_byte*) &x_dynp->d_tag);
  
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.19
diff -p -r1.19 solib.c
*** solib.c	2000/08/07 10:56:22	1.19
--- solib.c	2000/08/09 20:07:01
*************** elf_locate_base (void)
*** 762,769 ****
  #ifdef DT_MIPS_RLD_MAP
  	  else if (dyn_tag == DT_MIPS_RLD_MAP)
  	    {
! 	      char pbuf[TARGET_PTR_BIT / HOST_CHAR_BIT];
  
  	      /* DT_MIPS_RLD_MAP contains a pointer to the address
  		 of the dynamic link structure.  */
  	      dyn_ptr = bfd_h_get_32 (exec_bfd, 
--- 762,770 ----
  #ifdef DT_MIPS_RLD_MAP
  	  else if (dyn_tag == DT_MIPS_RLD_MAP)
  	    {
! 	      char *pbuf;
  
+ 	      pbuf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
  	      /* DT_MIPS_RLD_MAP contains a pointer to the address
  		 of the dynamic link structure.  */
  	      dyn_ptr = bfd_h_get_32 (exec_bfd, 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]