aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog31
-rw-r--r--gdb/config.in6
-rw-r--r--gdb/config/mips/.Sanitize14
-rwxr-xr-xgdb/configure2
-rw-r--r--gdb/configure.in2
-rw-r--r--gdb/configure.tgt8
-rw-r--r--gdb/dwarf2read.c45
-rw-r--r--gdb/remote-sim.c12
8 files changed, 109 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 130d895..cc26113 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,34 @@
+Mon Dec 15 15:13:57 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (configdirs): Check for sigaction.
+ * configure: Re-generate.
+
+start-sanitize-tx49
+ From Gavin Koch <gavin@cygnus.com>:
+ * config/mips/tx49el.mt : New file.
+ * config/mips/tm-tx49.h : New file.
+ * config/mips/tm-tx49el.h : New file.
+ * configure.tgt: Changed to use the new files for
+ mips64*tx49*-*-elf* and mips64*tx49*el-*-elf*
+
+end-sanitize-tx49
+Mon Dec 15 11:38:52 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dwarf2read.c: From change proposed by Gavin Koch.
+ (address_significant_size): New static variable.
+ (dwarf2_build_psymtabs_hard): Check consistency between
+ `address_size' and `address_significant_size'.
+ (read_address): MASK out all but the significant bits, as
+ determined by `address_significant_size', of any addresses.
+ (elf-bfd.h): Include.
+ (dwarf2_build_psymtabs_hard): Set `address_significant_size'
+ according to the arch_size of the elf object file.
+
+Thu Dec 11 13:40:46 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dwarf2read.c (dwarf_decode_lines): Change type of address to
+ CORE_ADDR.
+
Thu Dec 11 22:39:02 1997 Mark Alexander <marka@cygnus.com>
From change made to branch by Bob Manson <manson@cygnus.com>:
diff --git a/gdb/config.in b/gdb/config.in
index 8a1d0db..097f29e 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -59,6 +59,9 @@
/* Define if the "%Lg" format works to print long doubles. */
#undef PRINTF_HAS_LONG_DOUBLE
+/* Define if the "%Lg" format works to scan long doubles. */
+#undef SCANF_HAS_LONG_DOUBLE
+
/* Define if using Solaris thread debugging. */
#undef HAVE_THREAD_DB_LIB
@@ -84,6 +87,9 @@
/* Define if you have the setpgid function. */
#undef HAVE_SETPGID
+/* Define if you have the sigaction function. */
+#undef HAVE_SIGACTION
+
/* Define if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H
diff --git a/gdb/config/mips/.Sanitize b/gdb/config/mips/.Sanitize
index 0e3dc69..f8c0c91 100644
--- a/gdb/config/mips/.Sanitize
+++ b/gdb/config/mips/.Sanitize
@@ -29,6 +29,20 @@ else
fi
fi
+tx49_files="tm-tx49.h tm-tx49l.h tx49.mt tx49l.mt"
+
+if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
+ keep_these_too="${tx49_files} ${keep_these_too}"
+ if [ -n "${verbose}" ] ; then
+ echo Keeping ${tx49_files}
+ fi
+else
+ lose_these_too="${tx49_files} ${lose_these_too}"
+ if [ -n "${verbose}" ] ; then
+ echo Deleting ${tx49_files}
+ fi
+fi
+
if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
keep_these_too="tm-r5900.h r5900.mt ${keep_these_too}"
else
diff --git a/gdb/configure b/gdb/configure
index 08e8bbb..8de826f 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -1555,7 +1555,7 @@ EOF
fi
-for ac_func in setpgid sbrk select poll
+for ac_func in setpgid sbrk select poll sigaction
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1562: checking for $ac_func" >&5
diff --git a/gdb/configure.in b/gdb/configure.in
index 8512fc9..f343849 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -67,7 +67,7 @@ AC_HEADER_STAT
AC_C_CONST
-AC_CHECK_FUNCS(setpgid sbrk select poll)
+AC_CHECK_FUNCS(setpgid sbrk select poll sigaction)
# If we are configured native on Linux, work around problems with sys/procfs.h
if test "${target}" = "${host}"; then
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 1c1d51f..baa6063 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -171,10 +171,6 @@ mips64*vr5400*el-*-elf*) gdb_target=vr5000el ;;
mips64*vr5400*-*-elf*) gdb_target=vr5000
configdirs="${configdirs} gdbserver" ;;
# end-sanitize-vr5400
-# start-sanitize-tx49
-mips64*tx49*el-*-elf*) gdb_target=vr4300el ;;
-mips64*tx49*-*-elf*) gdb_target=vr4300 ;;
-# end-sanitize-tx49
# start-sanitize-r5900
mips64*r5900*-*-elf*) gdb_target=r5900 ;;
# end-sanitize-r5900
@@ -186,6 +182,10 @@ mips-tx19*-* | mips*tx19*-*-*)
# end-sanitize-tx19
mips*tx39*el*-elf*) gdb_target=tx39el ;;
mips*tx39*-elf*) gdb_target=tx39 ;;
+# start-sanitize-tx49
+mips64*tx49*el-*-elf*) gdb_target=tx49el ;;
+mips64*tx49*-*-elf*) gdb_target=tx49 ;;
+# end-sanitize-tx49
mips64*el-*-elf*) gdb_target=embedl64 ;;
mips64*-*-elf*) gdb_target=embed64 ;;
mips*el-*-ecoff*) gdb_target=embedl ;;
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index feded4e..418aaad 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "bfd.h"
+#include "elf-bfd.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "symfile.h"
@@ -522,6 +523,15 @@ static struct complaint dwarf2_unsupported_const_value_attr =
whatever scope is currently getting read. */
static int address_size;
+/* Some elf32 object file formats while linked for a 32 bit address
+ space contain debug information that has assumed 64 bit
+ addresses. Eg 64 bit MIPS target produced by GCC/GAS/LD where the
+ symbol table contains 32bit address values while its .debug_info
+ section contains 64 bit address values.
+ ADDRESS_SIGNIFICANT_SIZE specifies the number significant bits in
+ the ADDRESS_SIZE bytes read from the file */
+static int address_significant_size;
+
/* Externals references. */
extern int info_verbose; /* From main.c; nonzero => verbose */
@@ -907,6 +917,9 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
int comp_unit_has_pc_info;
CORE_ADDR lowpc, highpc;
+ /* Number of bytes of any addresses that are signficant */
+ address_significant_size = get_elf_backend_data (abfd)->s->arch_size / 8;
+
info_ptr = dwarf_info_buffer;
abbrev_ptr = dwarf_abbrev_buffer;
@@ -934,7 +947,7 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
}
if (cu_header.abbrev_offset >= dwarf_abbrev_size)
{
- error ("Dwarf Error: bad offset (0x%lx) in compilation unit header (at 0x%lx + 6).",
+ error ("Dwarf Error: bad offset (0x%lx) in compilation unit header (offset 0x%lx + 6).",
(long) cu_header.abbrev_offset,
(long) (beg_of_comp_unit - dwarf_info_buffer));
return;
@@ -942,11 +955,17 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline)
if (beg_of_comp_unit + cu_header.length + 4
> dwarf_info_buffer + dwarf_info_size)
{
- error ("Dwarf Error: bad length (0x%lx) in compilation unit header (0x%lx + 0).",
+ error ("Dwarf Error: bad length (0x%lx) in compilation unit header (offset 0x%lx + 0).",
(long) cu_header.length,
(long) (beg_of_comp_unit - dwarf_info_buffer));
return;
}
+ if (address_size < address_significant_size)
+ {
+ error ("Dwarf Error: bad address size (%ld) in compilation unit header (offset 0x%lx + 11).",
+ (long) cu_header.addr_size,
+ (long) (beg_of_comp_unit - dwarf_info_buffer));
+ }
/* Read the abbrevs for this compilation unit into a table */
dwarf2_read_abbrevs (abfd, cu_header.abbrev_offset);
@@ -3509,11 +3528,27 @@ read_address (abfd, buf)
{
CORE_ADDR retval = 0;
- if (address_size == 4)
+ switch (address_size)
{
+ case 4:
retval = bfd_get_32 (abfd, (bfd_byte *) buf);
- } else { /* *THE* alternative is 8, right? */
+ break;
+ case 8:
retval = bfd_get_64 (abfd, (bfd_byte *) buf);
+ break;
+ default:
+ /* *THE* alternative is 8, right? */
+ abort ();
+ }
+ /* If the address being read is larger than the address that is
+ applicable for the object file format then mask it down to the
+ correct size. Take care to avoid unnecessary shift or shift
+ overflow */
+ if (address_size > address_significant_size
+ && address_significant_size < sizeof (CORE_ADDR))
+ {
+ CORE_ADDR mask = ((CORE_ADDR) 0) - 1;
+ retval &= ~(mask << (address_significant_size * 8));
}
return retval;
}
@@ -3844,7 +3879,7 @@ dwarf_decode_lines (offset, comp_dir, abfd)
while (line_ptr < line_end)
{
/* state machine registers */
- unsigned int address = 0;
+ CORE_ADDR address = 0;
unsigned int file = 1;
unsigned int line = 1;
unsigned int column = 0;
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 22952ca..713e539 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -690,6 +690,18 @@ gdbsim_wait (pid, status)
if (sr_get_debug ())
printf_filtered ("gdbsim_wait\n");
+#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
+ {
+ struct sigaction sa, osa;
+ sa.sa_handler = gdbsim_cntrl_c;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = 0;
+ sigaction (SIGINT, &sa, &osa);
+ prev_sigint = osa.sa_handler;
+ }
+#else
+ prev_sigint = signal (SIGINT, cntrl_c);
+#endif
prev_sigint = signal (SIGINT, gdbsim_cntrl_c);
sim_resume (gdbsim_desc, resume_step,
target_signal_to_host (resume_siggnal));