From 35fc82857eb04d27f93d32977bea3560d08a0230 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Wed, 9 Aug 2000 20:09:01 +0000 Subject: [PATCH] 2000-08-09 Michael Snyder * 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. --- gdb/ChangeLog | 14 ++++++++++++++ gdb/blockframe.c | 3 ++- gdb/irix4-nat.c | 3 ++- gdb/irix5-nat.c | 3 ++- gdb/jv-valprint.c | 3 ++- gdb/m3-nat.c | 3 ++- gdb/m68k-tdep.c | 3 ++- gdb/mips-nat.c | 3 ++- gdb/mipsv4-nat.c | 3 ++- gdb/pa64solib.c | 3 ++- gdb/solib.c | 3 ++- 11 files changed, 34 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index df64e9fd8d6..fe38e8a2fee 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2000-08-09 Michael Snyder + + * 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. + Mon Aug 7 23:21:22 2000 David Taylor * TODO: remove build_parse entry. diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 8e5c18cca00..2352cdf70cc 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -950,10 +950,11 @@ CORE_ADDR sigtramp_saved_pc (struct frame_info *frame) { CORE_ADDR sigcontext_addr; - char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + 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) diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c index 8e397b83fc3..6c3fddad7b4 100644 --- a/gdb/irix4-nat.c +++ b/gdb/irix4-nat.c @@ -145,9 +145,10 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) int get_longjmp_target (CORE_ADDR *pc) { - char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + 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, diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index dcef6ad6395..b8ca2a523d9 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -165,9 +165,10 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) int get_longjmp_target (CORE_ADDR *pc) { - char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + 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, diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 6fd1691b2e7..f0614fa4523 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -96,8 +96,9 @@ java_value_print (value_ptr val, struct ui_file *stream, int format, while (i < length && things_printed < print_max) { - char buf[TARGET_PTR_BIT / HOST_CHAR_BIT]; + char *buf; + buf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT); fputs_filtered (", ", stream); wrap_here (n_spaces (2)); diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c index 50f7b717685..1472b2c9dce 100644 --- a/gdb/m3-nat.c +++ b/gdb/m3-nat.c @@ -2460,11 +2460,12 @@ get_cprocs (void) gdb_thread_t cproc_head; gdb_thread_t cproc_copy; CORE_ADDR their_cprocs; - char *buf[TARGET_PTR_BIT / HOST_CHAR_BIT]; + 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) diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index c15a1e8a679..8093f8c0215 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -646,9 +646,10 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) int get_longjmp_target (CORE_ADDR *pc) { - char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + 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 */ diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c index b9d20b700a7..cf8a31a837c 100644 --- a/gdb/mips-nat.c +++ b/gdb/mips-nat.c @@ -137,8 +137,9 @@ int get_longjmp_target (CORE_ADDR *pc) { CORE_ADDR jb_addr; - char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + 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, diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c index d63e04388e9..cca40065705 100644 --- a/gdb/mipsv4-nat.c +++ b/gdb/mipsv4-nat.c @@ -143,9 +143,10 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) int get_longjmp_target (CORE_ADDR *pc) { - char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; + 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, diff --git a/gdb/pa64solib.c b/gdb/pa64solib.c index 7a78136ee54..459302ae219 100644 --- a/gdb/pa64solib.c +++ b/gdb/pa64solib.c @@ -1019,8 +1019,9 @@ read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p) Elf64_Dyn *x_dynp = (Elf64_Dyn*)buf; Elf64_Sxword dyn_tag; CORE_ADDR dyn_ptr; - char pbuf[TARGET_PTR_BIT / HOST_CHAR_BIT]; + 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); diff --git a/gdb/solib.c b/gdb/solib.c index a95741125c0..d83c95ada4f 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -762,8 +762,9 @@ elf_locate_base (void) #ifdef DT_MIPS_RLD_MAP else if (dyn_tag == DT_MIPS_RLD_MAP) { - char pbuf[TARGET_PTR_BIT / HOST_CHAR_BIT]; + 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, -- 2.30.2