aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-12-18 16:41:12 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-12-18 16:41:12 -0800
commit5aded605b4c09eaf6c413239ab6129d3345a7ac8 (patch)
treeb27cb389a77778fd76d87b47d6dfadf1beced328
parentb787ff4bd603af1f6dd8c9ed216ed70b0f9f292b (diff)
parentff7609bc46d9afdd4fdbaebf49a838db75d78057 (diff)
downloadgdb-5aded605b4c09eaf6c413239ab6129d3345a7ac8.zip
gdb-5aded605b4c09eaf6c413239ab6129d3345a7ac8.tar.gz
gdb-5aded605b4c09eaf6c413239ab6129d3345a7ac8.tar.bz2
Merge remote-tracking branch 'origin/master' into hjl/linux/master
-rw-r--r--bfd/ChangeLog18
-rw-r--r--bfd/elf32-ppc.c3
-rw-r--r--bfd/elf64-ppc.c2
-rw-r--r--bfd/elflink.c6
-rw-r--r--bfd/format.c2
-rw-r--r--bfd/mach-o.c6
-rw-r--r--bfd/version.h2
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/dwarf.c2
-rw-r--r--gas/ChangeLog1
-rw-r--r--gas/NEWS4
-rw-r--r--gas/testsuite/ChangeLog16
-rw-r--r--gas/testsuite/gas/mips/attr-gnu-4-5.d2
-rw-r--r--gas/testsuite/gas/mips/attr-gnu-4-6.d2
-rw-r--r--gas/testsuite/gas/mips/attr-gnu-4-7.d2
-rw-r--r--gas/testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d2
-rw-r--r--gas/testsuite/gas/mips/attr-none-o32-fp64.d2
-rw-r--r--gas/testsuite/gas/mips/attr-none-o32-fpxx.d2
-rw-r--r--gas/testsuite/gas/mips/r6-n32.d3
-rw-r--r--gas/testsuite/gas/mips/r6-n64.d3
-rw-r--r--gas/testsuite/gas/mips/r6.d3
-rw-r--r--gas/testsuite/gas/mips/r6.s3
-rw-r--r--gdb/ChangeLog204
-rw-r--r--gdb/NEWS24
-rw-r--r--gdb/ada-exp.y12
-rw-r--r--gdb/ada-tasks.c3
-rw-r--r--gdb/buildsym.c220
-rw-r--r--gdb/buildsym.h5
-rw-r--r--gdb/c-exp.y10
-rw-r--r--gdb/compile/compile.c4
-rw-r--r--gdb/config.in3
-rwxr-xr-xgdb/configure2
-rw-r--r--gdb/configure.ac2
-rw-r--r--gdb/corelow.c2
-rw-r--r--gdb/cp-namespace.c181
-rw-r--r--gdb/cp-support.h4
-rw-r--r--gdb/d-exp.y4
-rw-r--r--gdb/darwin-nat.c2
-rw-r--r--gdb/defs.h8
-rw-r--r--gdb/doc/ChangeLog4
-rw-r--r--gdb/doc/gdb.texinfo8
-rw-r--r--gdb/dwarf2read.c6
-rw-r--r--gdb/elfread.c13
-rw-r--r--gdb/event-top.c2
-rw-r--r--gdb/event-top.h2
-rw-r--r--gdb/f-exp.y4
-rw-r--r--gdb/gdbarch.c13
-rw-r--r--gdb/gdbarch.h2
-rwxr-xr-xgdb/gdbarch.sh2
-rw-r--r--gdb/gdbserver/ChangeLog20
-rw-r--r--gdb/gdbserver/linux-aarch64-low.c8
-rw-r--r--gdb/gdbserver/linux-low.c4
-rw-r--r--gdb/gdbserver/lynx-low.c7
-rw-r--r--gdb/gdbtypes.c2
-rw-r--r--gdb/go-exp.y6
-rw-r--r--gdb/h8300-tdep.c9
-rw-r--r--gdb/infcmd.c51
-rw-r--r--gdb/inferior.c8
-rw-r--r--gdb/inferior.h11
-rw-r--r--gdb/infrun.c10
-rw-r--r--gdb/language.c25
-rw-r--r--gdb/language.h6
-rw-r--r--gdb/linux-nat.c16
-rw-r--r--gdb/linux-tdep.c6
-rw-r--r--gdb/memattr.c8
-rw-r--r--gdb/mi/mi-interp.c4
-rw-r--r--gdb/minsyms.c41
-rw-r--r--gdb/mips-tdep.c93
-rw-r--r--gdb/nat/linux-ptrace.c34
-rw-r--r--gdb/nat/linux-ptrace.h7
-rw-r--r--gdb/objfiles.c8
-rw-r--r--gdb/objfiles.h4
-rw-r--r--gdb/p-exp.y4
-rw-r--r--gdb/proc-service.c2
-rw-r--r--gdb/python/lib/gdb/prompt.py2
-rw-r--r--gdb/python/py-gdb-readline.c4
-rw-r--r--gdb/record-btrace.c4
-rw-r--r--gdb/remote-sim.c6
-rw-r--r--gdb/sol2-tdep.c2
-rw-r--r--gdb/symfile-debug.c56
-rw-r--r--gdb/symfile.h10
-rw-r--r--gdb/symtab.c220
-rw-r--r--gdb/symtab.h6
-rw-r--r--gdb/target.c4
-rw-r--r--gdb/testsuite/ChangeLog79
-rw-r--r--gdb/testsuite/Makefile.in4
-rw-r--r--gdb/testsuite/README4
-rw-r--r--gdb/testsuite/boards/stabs.exp45
-rw-r--r--gdb/testsuite/dg-extract-results.py585
-rwxr-xr-xgdb/testsuite/dg-extract-results.sh9
-rw-r--r--gdb/testsuite/gdb.arch/aarch64-fp.c38
-rw-r--r--gdb/testsuite/gdb.arch/aarch64-fp.exp85
-rw-r--r--gdb/testsuite/gdb.base/completion.exp9
-rw-r--r--gdb/testsuite/gdb.base/float.exp9
-rw-r--r--gdb/testsuite/gdb.compile/compile-ops.exp2
-rw-r--r--gdb/testsuite/gdb.compile/compile-setjmp.exp2
-rw-r--r--gdb/testsuite/gdb.compile/compile-tls.exp2
-rw-r--r--gdb/testsuite/gdb.compile/compile.exp2
-rw-r--r--gdb/testsuite/lib/gdb.exp42
-rw-r--r--gdb/thread.c6
-rw-r--r--gdb/top.c30
-rw-r--r--gdb/user-regs.c4
-rw-r--r--gdb/valops.c9
-rw-r--r--gold/ChangeLog9
-rw-r--r--gold/mapfile.cc16
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/mips-opc.c3
107 files changed, 2152 insertions, 392 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 23e4ba5..eec359f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,21 @@
+2014-12-18 Richard Henderson <rth@redhat.com>
+
+ * elf32-ppc.c (ELF_COMMONPAGESIZE): Set to 64k.
+ * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.
+
+2014-12-16 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * format.c (bfd_check_format_matches): Check for a matching vector
+ before using match priorities.
+ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Fix off-by-one
+ errors with previous delta.
+
+2014-12-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/17713
+ * elflink.c (_bfd_elf_gc_mark_rsec): Check corrupt input.
+
2014-12-13 H.J. Lu <hongjiu.lu@intel.com>
PR ld/17689
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 8429e8f..1ebb2c7 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -10327,11 +10327,12 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#define ELF_MACHINE_CODE EM_PPC
#ifdef __QNXTARGET__
#define ELF_MAXPAGESIZE 0x1000
+#define ELF_COMMONPAGESIZE 0x1000
#else
#define ELF_MAXPAGESIZE 0x10000
+#define ELF_COMMONPAGESIZE 0x10000
#endif
#define ELF_MINPAGESIZE 0x1000
-#define ELF_COMMONPAGESIZE 0x1000
#define elf_info_to_howto ppc_elf_info_to_howto
#ifdef EM_CYGNUS_POWERPC
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 26ae9ed..88ae80c 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -64,7 +64,7 @@ static bfd_vma opd_entry_value
#define ELF_TARGET_ID PPC64_ELF_DATA
#define ELF_MACHINE_CODE EM_PPC64
#define ELF_MAXPAGESIZE 0x10000
-#define ELF_COMMONPAGESIZE 0x1000
+#define ELF_COMMONPAGESIZE 0x10000
#define elf_info_to_howto ppc64_elf_info_to_howto
#define elf_backend_want_got_sym 0
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 2da6d1b..b701fa0 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -11860,6 +11860,12 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info, asection *sec,
|| ELF_ST_BIND (cookie->locsyms[r_symndx].st_info) != STB_LOCAL)
{
h = cookie->sym_hashes[r_symndx - cookie->extsymoff];
+ if (h == NULL)
+ {
+ info->callbacks->einfo (_("%F%P: corrupt input: %B\n"),
+ sec->owner);
+ return NULL;
+ }
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
diff --git a/bfd/format.c b/bfd/format.c
index c4bc944..f0d1e66 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -402,7 +402,7 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
/* We still have more than one equally good match, and at least some
of the targets support match priority. Choose the first of the
best matches. */
- if (match_count > 1 && best_count != match_count)
+ if (matching_vector && match_count > 1 && best_count != match_count)
{
int i;
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 31ffa84..61d60db 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -1350,7 +1350,7 @@ bfd_mach_o_canonicalize_one_reloc (bfd *abfd,
if (reloc.r_extern)
{
/* PR 17512: file: 8396-1185-0.004. */
- if (num >= bfd_get_symcount (abfd))
+ if (bfd_get_symcount (abfd) > 0 && num > bfd_get_symcount (abfd))
sym = bfd_und_section_ptr->symbol_ptr_ptr;
else
/* An external symbol number. */
@@ -1368,7 +1368,7 @@ bfd_mach_o_canonicalize_one_reloc (bfd *abfd,
else
{
/* PR 17512: file: 006-2964-0.004. */
- if (num >= mdata->nsects)
+ if (num > mdata->nsects)
return -1;
/* A section number. */
@@ -1400,6 +1400,7 @@ bfd_mach_o_canonicalize_one_reloc (bfd *abfd,
if (!(*bed->_bfd_mach_o_swap_reloc_in)(res, &reloc))
return -1;
+
return 0;
}
@@ -1414,6 +1415,7 @@ bfd_mach_o_canonicalize_relocs (bfd *abfd, unsigned long filepos,
/* Allocate and read relocs. */
native_size = count * BFD_MACH_O_RELENT_SIZE;
+
native_relocs =
(struct mach_o_reloc_info_external *) bfd_malloc (native_size);
if (native_relocs == NULL)
diff --git a/bfd/version.h b/bfd/version.h
index a1ee054..dfbce0e 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20141214
+#define BFD_VERSION_DATE 20141219
#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/binutils/ChangeLog b/binutils/ChangeLog
index 48957bd..2833ad0 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-18 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf.c (read_and_display_attr_value): Change display name of
+ DW_LANG_C11 from (ANSI C11) to (C11).
+
2014-12-11 Nick Clifton <nickc@redhat.com>
PR binutils/17512
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 10d639c..49f9c49 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -1936,7 +1936,7 @@ read_and_display_attr_value (unsigned long attribute,
/* DWARF 5 values. */
case DW_LANG_Go: printf ("(Go)"); break;
case DW_LANG_C_plus_plus_11: printf ("(C++11)"); break;
- case DW_LANG_C11: printf ("(ANSI C11)"); break;
+ case DW_LANG_C11: printf ("(C11)"); break;
case DW_LANG_C_plus_plus_14: printf ("(C++14)"); break;
/* MIPS extension. */
case DW_LANG_Mips_Assembler: printf ("(MIPS assembler)"); break;
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 27da2cc..b53fcff 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -2,6 +2,7 @@
* config/tc-i386.c (flag_compress_debug): Default to compress
debug sections for Linux.
+ * NEWS: Mention it.
2014-12-12 Alan Modra <amodra@gmail.com>
diff --git a/gas/NEWS b/gas/NEWS
index 8a757c5..16035c6 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -1,5 +1,9 @@
-*- text -*-
+Changes in 2.26:
+
+* --compress-debug-sections is turned on for Linux/x86 by default.
+
Changes in 2.25:
* Add support for the AVR Tiny microcontrollers.
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 63d58fe..e0d2040 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,19 @@
+2014-12-16 Matthew Fortune <matthew.fortune@imgtec.com>
+
+ * gas/mips/attr-gnu-4-5.d: Ignore ASEs.
+ * gas/mips/attr-gnu-4-6.d: Likewise.
+ * gas/mips/attr-gnu-4-7.d: Likewise.
+ * gas/mips/attr-none-o32-fp64-nooddspreg.d: Likewise.
+ * gas/mips/attr-none-o32-fp64.d: Likewise.
+ * gas/mips/attr-none-o32-fpxx.d: Likewise.
+
+2014-12-16 Matthew Fortune <matthew.fortune@imgtec.com>
+
+ * gas/mips/r6.s: Test JALRC and NAL
+ * gas/mips/r6-n32.d: Add expected output for JALRC and NAL.
+ * gas/mips/r6-n64.d: Likewise.
+ * gas/mips/r6.d: Likewise.
+
2014-12-06 Eric Botcazou <ebotcazou@adacore.com>
* gas/elf/elf.exp: Skip ifunc-1 for Visium.
diff --git a/gas/testsuite/gas/mips/attr-gnu-4-5.d b/gas/testsuite/gas/mips/attr-gnu-4-5.d
index e6eb677..a6297e6 100644
--- a/gas/testsuite/gas/mips/attr-gnu-4-5.d
+++ b/gas/testsuite/gas/mips/attr-gnu-4-5.d
@@ -17,7 +17,7 @@ CPR2 size: 0
FP ABI: Hard float \(32-bit CPU, Any FPU\)
ISA Extension: .*
ASEs:
- None
+ .*
FLAGS 1: 0000000.
FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/attr-gnu-4-6.d b/gas/testsuite/gas/mips/attr-gnu-4-6.d
index 5df111f..00704a5 100644
--- a/gas/testsuite/gas/mips/attr-gnu-4-6.d
+++ b/gas/testsuite/gas/mips/attr-gnu-4-6.d
@@ -17,7 +17,7 @@ CPR2 size: 0
FP ABI: Hard float \(32-bit CPU, 64-bit FPU\)
ISA Extension: .*
ASEs:
- None
+ .*
FLAGS 1: 00000001
FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/attr-gnu-4-7.d b/gas/testsuite/gas/mips/attr-gnu-4-7.d
index b453218..bdc2e6c 100644
--- a/gas/testsuite/gas/mips/attr-gnu-4-7.d
+++ b/gas/testsuite/gas/mips/attr-gnu-4-7.d
@@ -17,7 +17,7 @@ CPR2 size: 0
FP ABI: Hard float compat \(32-bit CPU, 64-bit FPU\)
ISA Extension: .*
ASEs:
- None
+ .*
FLAGS 1: 00000000
FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d b/gas/testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d
index d122268..c276bcb 100644
--- a/gas/testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d
+++ b/gas/testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d
@@ -17,7 +17,7 @@ CPR2 size: 0
FP ABI: Hard float compat \(32-bit CPU, 64-bit FPU\)
ISA Extension: .*
ASEs:
- None
+ .*
FLAGS 1: 00000000
FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/attr-none-o32-fp64.d b/gas/testsuite/gas/mips/attr-none-o32-fp64.d
index 1f5abd2..28c3c36 100644
--- a/gas/testsuite/gas/mips/attr-none-o32-fp64.d
+++ b/gas/testsuite/gas/mips/attr-none-o32-fp64.d
@@ -17,7 +17,7 @@ CPR2 size: 0
FP ABI: Hard float \(32-bit CPU, 64-bit FPU\)
ISA Extension: .*
ASEs:
- None
+ .*
FLAGS 1: 00000001
FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/attr-none-o32-fpxx.d b/gas/testsuite/gas/mips/attr-none-o32-fpxx.d
index 1e440bd..7afdd89 100644
--- a/gas/testsuite/gas/mips/attr-none-o32-fpxx.d
+++ b/gas/testsuite/gas/mips/attr-none-o32-fpxx.d
@@ -17,7 +17,7 @@ CPR2 size: 0
FP ABI: Hard float \(32-bit CPU, Any FPU\)
ISA Extension: .*
ASEs:
- None
+ .*
FLAGS 1: 0000000.
FLAGS 2: 00000000
diff --git a/gas/testsuite/gas/mips/r6-n32.d b/gas/testsuite/gas/mips/r6-n32.d
index 4df4f31..d4e9859 100644
--- a/gas/testsuite/gas/mips/r6-n32.d
+++ b/gas/testsuite/gas/mips/r6-n32.d
@@ -490,4 +490,7 @@ Disassembly of section .text:
0+057c <[^>]*> ec8bffff lwpc a0,00100578 <[^>]*>
0+0580 <[^>]*> 00000000 nop
0+0584 <[^>]*> ec83ffff lapc a0,00100580 <[^>]*>
+0+0588 <[^>]*> f8040000 jalrc a0
+0+058c <[^>]*> 04100000 nal
+0+0590 <[^>]*> 00000000 nop
\.\.\.
diff --git a/gas/testsuite/gas/mips/r6-n64.d b/gas/testsuite/gas/mips/r6-n64.d
index d099988..e388e7a 100644
--- a/gas/testsuite/gas/mips/r6-n64.d
+++ b/gas/testsuite/gas/mips/r6-n64.d
@@ -746,4 +746,7 @@ Disassembly of section .text:
0+057c <[^>]*> ec8bffff lwpc a0,0000000000100578 <[^>]*>
0+0580 <[^>]*> 00000000 nop
0+0584 <[^>]*> ec83ffff lapc a0,0000000000100580 <[^>]*>
+0+0588 <[^>]*> f8040000 jalrc a0
+0+058c <[^>]*> 04100000 nal
+0+0590 <[^>]*> 00000000 nop
\.\.\.
diff --git a/gas/testsuite/gas/mips/r6.d b/gas/testsuite/gas/mips/r6.d
index 0cfccb8..94ab611 100644
--- a/gas/testsuite/gas/mips/r6.d
+++ b/gas/testsuite/gas/mips/r6.d
@@ -489,4 +489,7 @@ Disassembly of section .text:
0+057c <[^>]*> ec8bffff lwpc a0,00100578 <[^>]*>
0+0580 <[^>]*> 00000000 nop
0+0584 <[^>]*> ec83ffff lapc a0,00100580 <[^>]*>
+0+0588 <[^>]*> f8040000 jalrc a0
+0+058c <[^>]*> 04100000 nal
+0+0590 <[^>]*> 00000000 nop
\.\.\.
diff --git a/gas/testsuite/gas/mips/r6.s b/gas/testsuite/gas/mips/r6.s
index 73308ad..e4ee083 100644
--- a/gas/testsuite/gas/mips/r6.s
+++ b/gas/testsuite/gas/mips/r6.s
@@ -258,6 +258,9 @@ new: maddf.s $f0,$f1,$f2
nop
addiu $4, $pc, (262143 << 2)
+ jalrc $4
+ nal
+
# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
.align 2
.space 8
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f3a358e..adb24d4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,205 @@
+2014-12-18 Simon Marchi <simon.marchi@ericsson.com>
+
+ * elfread.c (elf_symfile_init): Remove stale comment.
+ (elf_symfile_read): Same.
+ * symfile.h (struct sym_fns): Same.
+
+2014-12-18 Nigel Stephens <nigel@mips.com>
+ Maciej W. Rozycki <macro@codesourcery.com>
+
+ * mips-tdep.c (print_fpu_flags): New function.
+ (mips_print_float_info): Likewise.
+ (mips_gdbarch_init): Install mips_print_float_info as gdbarch
+ print_float_info routine.
+
+2014-12-18 Yao Qi <yao@codesourcery.com>
+
+ * gdbarch.sh (print_float_info): Change its type from 'M' to 'm'.
+ * gdbarch.c: Re-generated.
+ * gdbarch.h: Likewise.
+ * infcmd.c (default_print_float_info): New function.
+ (print_float_info): Removed. Move code to
+ default_print_float_info.
+ (float_info): Adjust to call gdbarch_print_float_info.
+ * inferior.h (default_print_float_info): Declare it.
+
+2014-12-18 Yao Qi <yao@codesourcery.com>
+
+ * h8300-tdep.c (h8300_print_float_info): Remove.
+ (h8300_gdbarch_init): Remove the call to
+ set_gdbarch_print_float_info.
+
+2014-12-18 Doug Evans <xdje42@gmail.com>
+
+ * infcmd.c (jump_command): Minor simplification.
+
+2014-12-18 Doug Evans <xdje42@gmail.com>
+
+ * language.c (language_lookup_primitive_type): Renamed from
+ language_lookup_primitive_type_by_name. All callers updated.
+
+2014-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix MinGW compilation.
+ * compile/compile.c (get_compile_file_tempdir): Call error if
+ !HAVE_MKDTEMP.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+ * configure.ac (AC_CHECK_FUNCS): Add mkdtemp.
+
+2014-12-17 Doug Evans <xdje42@gmail.com>
+
+ * valops.c (value_maybe_namespace_elt): Remove redundant call to
+ lookup_static_symbol.
+
+2014-12-17 Doug Evans <xdje42@gmail.com>
+
+ New parameter "debug symbol-lookup".
+ * NEWS: Mention it.
+ * cp-namespace.c (cp_lookup_symbol_imports_or_template): Add debug
+ output.
+ (cp_lookup_symbol_namespace, cp_lookup_symbol_nonlocal): Ditto.
+ (cp_lookup_nested_symbol): Ditto.
+ * language.c (language_lookup_primitive_type_by_name): Add debug
+ output.
+ * minsyms.c (lookup_minimal_symbol): Add debug output.
+ * objfiles.c (objfile_debug_name): Moved here, and renamed ...
+ * symfile-debug.c (debug_objfile_name): ... from here. All callers
+ updated.
+ * objfiles.h (objfile_debug_name): Declare.
+ * symtab.h (symbol_lookup_debug): Declare.
+ * symtab.c (symbol_lookup_debug): New global.
+ (lookup_language_this): Add debug output.
+ (lookup_symbol_aux, lookup_symbol_in_block): Ditto.
+ (lookup_symbol_in_objfile_symtabs, lookup_symbol_via_quick_fns): Ditto.
+ (lookup_symbol_in_static_block, lookup_symbol_in_objfile): Ditto.
+ (_initialize_symtab): Add new parameter "debug symbol-lookup".
+
+2014-12-16 Doug Evans <xdje42@gmail.com>
+
+ * buildsym.c: Add comments describing how the buildsym machinery
+ is used by the various file formats.
+ (really_free_pendings): Enhance function comment.
+ See pending_macros to NULL. Simplify resetting pending_addrmap.
+ Call free_buildsym_compunit.
+ (free_buildsym_compunit): Set current_subfile to NULL.
+ (prepare_for_building): New function.
+ (start_symtab): Call it. Remove call to set_last_source_file.
+ (restart_symtab): New arg "cust". All callers updated.
+ Simplify, call prepare_for_building. Re-initialize buildsym_compunit.
+ (reset_symtab_globals): Enhance function comment.
+ Set local_symbols, file_symbols, global_symbols to NULL.
+ Set pending_macros to NULL. Simplify resetting pending_addrmap.
+ Call free_buildysym_compunit.
+ (end_symtab_without_blockvector): Delete. All callers updated.
+ (end_symtab_with_blockvector): Remove redundant call to
+ free_buildsym_compunit.
+ (augment_type_symtab): Remove arg "cust". All callers updated.
+ (buildsym_init): Remove resetting of free_pendings, file_symbols,
+ global_symbols, pending_blocks, pending_macros. Instead make
+ handling consistent with pending_addrmap: Assert value was reset
+ at end of previous symtab building. Initialize context_stack here.
+
+2014-12-16 Doug Evans <xdje42@gmail.com>
+
+ * cp-namespace.c (cp_lookup_symbol_via_imports): Renamed from
+ cp_lookup_symbol_imports. All callers updated.
+
+2014-12-16 Doug Evans <xdje42@gmail.com>
+
+ * cp-namespace.c (cp_find_type_baseclass_by_name): Renamed from
+ find_type_baseclass_by_name. All callers updated.
+
+2014-12-16 Doug Evans <xdje42@gmail.com>
+
+ * symtab.h (struct symbol_search) <symtab>: Delete. All uses updated.
+ * symtab.c (compare_search_syms): Use SYMBOL_SYMTAB accessor.
+ (print_symbol_info): Delete arg symtab. All callers updated.
+ (symtab_symbol_info): Use SYMBOL_SYMTAB accessor.
+
+2014-12-16 Andreas Arnez <arnez@vnet.linux.ibm.com>
+
+ * user-regs.c (maintenance_print_user_registers): Swap "Nr" and
+ "Name" columns. Assure that the output is always indented.
+
+2014-12-16 Joel Brobecker <brobecker@adacore.com>
+
+ * nat/linux-ptrace.h (PTRACE_O_EXITKILL): Define if not
+ already defined.
+ (linux_enable_event_reporting): Add parameter "attached".
+ * nat/linux-ptrace.c (linux_test_for_exitkill): New forward
+ declaration. New function.
+ (linux_check_ptrace_features): Add linux_test_for_exitkill call.
+ (linux_enable_event_reporting): Add new parameter "attached".
+ Do not call ptrace with the PTRACE_O_EXITKILL if ATTACHED is
+ nonzero.
+ * linux-nat.c (linux_init_ptrace): Add parameter "attached".
+ Use it. Update function description.
+ (linux_child_post_attach, linux_child_post_startup_inferior):
+ Update call to linux_enable_event_reporting.
+
+2014-12-16 Yao Qi <yao@codesourcery.com>
+
+ * NEWS: Move some entries to "Changes since GDB 7.8" section.
+
+2014-12-16 Yao Qi <yao@codesourcery.com>
+
+ * linux-tdep.c (linux_infcall_mmap): Replace ARG_MAX with
+ ARG_LAST.
+
+2014-12-15 Simon Marchi <simon.marchi@ericsson.com>
+
+ * inferior.c (find_inferior_ptid): New function.
+ * inferior.h (find_inferior_ptid): New declaration.
+ * ada-tasks.c (ada_get_task_number): Use find_inferior_ptid.
+ * corelow.c (core_pid_to_str): Same.
+ * darwin-nat.c (darwin_resume): Same.
+ * infrun.c (fetch_inferior_event): Same.
+ (get_inferior_stop_soon): Same.
+ (handle_inferior_event): Same.
+ (handle_signal_stop): Same.
+ * linux-nat.c (resume_lwp): Same.
+ (stop_wait_callback): Same.
+ * mi/mi-interp.c (mi_new_thread): Same.
+ (mi_thread_exit): Same.
+ * proc-service.c (ps_pglobal_lookup): Same.
+ * record-btrace.c (record_btrace_step_thread): Same.
+ * remote-sim.c (gdbsim_close_inferior): Same.
+ (gdbsim_resume): Same.
+ (gdbsim_stop): Same.
+ * sol2-tdep.c (sol2_core_pid_to_str): Same.
+ * target.c (memory_xfer_partial_1): Same.
+ (default_thread_address_space): Same.
+ * thread.c (thread_change_ptid): Same.
+ (switch_to_thread): Same.
+ (do_restore_current_thread_cleanup): Same.
+
+2014-12-15 Simon Marchi <simon.marchi@ericsson.com>
+
+ * defs.h (gdb_readline): Constify argument.
+ (gdb_readline_wrapper): Same.
+ (command_line_input): Same.
+ (deprecated_readline_hook): Same.
+ * top.c (deprecated_readline_hook): Same.
+ (gdb_readline): Same.
+ (gdb_readline_wrapper): Same.
+ (command_line_input): Constify argument. Pass prompt_arg to called
+ functions instead of local_prompt, overwriting prompt_arg if necessary.
+ * event-top.h (display_gdb_prompt): Constify argument.
+ * event-top.c (display_gdb_prompt): Same.
+ * python/py-gdb-readline.c (gdbpy_readline_wrapper): Constify argument
+ if building with Python 3.4 and up.
+
+2014-12-15 Simon Marchi <simon.marchi@ericsson.com>
+
+ * python/lib/gdb/prompt.py (_prompt_pwd): Use os.getcwd() instead of
+ os.getcwdu().
+
+2014-12-15 Catalin Udma <catalin.udma@freescale.com>
+
+ PR gdb/15684
+ * memattr.c (mem_info_command): Remove "unsigned long" casts.
+
2014-12-13 Doug Evans <xdje42@gmail.com>
* utils.c (make_hex_string): Fix off-by-one error.
@@ -401,7 +603,7 @@
2014-12-10 Doug Evans <xdje42@gmail.com>
* cp-namespace.c (cp_lookup_symbol_imports): Make static.
- * cp-support.c (cp_lookup_symbol_imports): Delete.
+ * cp-support.h (cp_lookup_symbol_imports): Delete.
2014-12-10 Simon Marchi <simon.marchi@ericsson.com>
diff --git a/gdb/NEWS b/gdb/NEWS
index a6789bd..955dd23 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -1,16 +1,6 @@
What has changed in GDB?
(Organized release by release)
-* Python Scripting
-
- New events which are triggered when GDB modifies the state of the
- inferior.
-
- ** gdb.events.inferior_call_pre: Function call is about to be made.
- ** gdb.events.inferior_call_post: Function call has just been made.
- ** gdb.events.memory_changed: A memory location has been altered.
- ** gdb.events.register_changed: A register has been altered.
-
*** Changes since GDB 7.8
* GDB now supports hardware watchpoints on x86 GNU Hurd.
@@ -30,6 +20,14 @@
** You can now add attributes to gdb.Objfile and gdb.Progspace objects.
** New function gdb.lookup_objfile.
+ New events which are triggered when GDB modifies the state of the
+ inferior.
+
+ ** gdb.events.inferior_call_pre: Function call is about to be made.
+ ** gdb.events.inferior_call_post: Function call has just been made.
+ ** gdb.events.memory_changed: A memory location has been altered.
+ ** gdb.events.register_changed: A register has been altered.
+
* New Python-based convenience functions:
** $_caller_is(name [, number_of_frames])
@@ -86,6 +84,12 @@ compile file [-r|-raw] filename
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
+* New options
+
+set debug symbol-lookup
+show debug symbol-lookup
+ Control display of debugging info regarding symbol lookup.
+
* MI changes
** The -list-thread-groups command outputs an exit-code field for
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 0a49952..c02f6a1 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1086,9 +1086,9 @@ static struct type*
find_primitive_type (struct parser_state *par_state, char *name)
{
struct type *type;
- type = language_lookup_primitive_type_by_name (parse_language (par_state),
- parse_gdbarch (par_state),
- name);
+ type = language_lookup_primitive_type (parse_language (par_state),
+ parse_gdbarch (par_state),
+ name);
if (type == NULL && strcmp ("system__address", name) == 0)
type = type_system_address (par_state);
@@ -1525,9 +1525,9 @@ static struct type *
type_system_address (struct parser_state *par_state)
{
struct type *type
- = language_lookup_primitive_type_by_name (parse_language (par_state),
- parse_gdbarch (par_state),
- "system__address");
+ = language_lookup_primitive_type (parse_language (par_state),
+ parse_gdbarch (par_state),
+ "system__address");
return type != NULL ? type : parse_type (par_state)->builtin_data_ptr;
}
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index 2d5a19d..17d0338 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -292,7 +292,7 @@ int
ada_get_task_number (ptid_t ptid)
{
int i;
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ptid));
+ struct inferior *inf = find_inferior_ptid (ptid);
struct ada_tasks_inferior_data *data;
gdb_assert (inf != NULL);
@@ -1449,4 +1449,3 @@ _initialize_tasks (void)
Without argument, this command simply prints the current task ID"),
&cmdlist);
}
-
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 4aeb6ac..35b3f17 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -21,7 +21,53 @@
file-reading routines.
Routines to support specific debugging information formats (stabs,
- DWARF, etc) belong somewhere else. */
+ DWARF, etc) belong somewhere else.
+
+ The basic way this module is used is as follows:
+
+ buildsym_init ();
+ cleanups = make_cleanup (really_free_pendings, NULL);
+ cust = start_symtab (...);
+ ... read debug info ...
+ cust = end_symtab (...);
+ do_cleanups (cleanups);
+
+ The compunit symtab pointer ("cust") is returned from both start_symtab
+ and end_symtab to simplify the debug info readers.
+
+ There are minor variations on this, e.g., dwarf2read.c splits end_symtab
+ into two calls: end_symtab_get_static_block, end_symtab_from_static_block,
+ but all debug info readers follow this basic flow.
+
+ Reading DWARF Type Units is another variation:
+
+ buildsym_init ();
+ cleanups = make_cleanup (really_free_pendings, NULL);
+ cust = start_symtab (...);
+ ... read debug info ...
+ cust = end_expandable_symtab (...);
+ do_cleanups (cleanups);
+
+ And then reading subsequent Type Units within the containing "Comp Unit"
+ will use a second flow:
+
+ buildsym_init ();
+ cleanups = make_cleanup (really_free_pendings, NULL);
+ cust = restart_symtab (...);
+ ... read debug info ...
+ cust = augment_type_symtab (...);
+ do_cleanups (cleanups);
+
+ dbxread.c and xcoffread.c use another variation:
+
+ buildsym_init ();
+ cleanups = make_cleanup (really_free_pendings, NULL);
+ cust = start_symtab (...);
+ ... read debug info ...
+ cust = end_symtab (...);
+ ... start_symtab + read + end_symtab repeated ...
+ do_cleanups (cleanups);
+*/
#include "defs.h"
#include "bfd.h"
@@ -146,6 +192,8 @@ static struct subfile_stack *subfile_stack;
currently reading. */
static struct macro_table *pending_macros;
+static void free_buildsym_compunit (void);
+
static int compare_line_numbers (const void *ln1p, const void *ln2p);
static void record_pending_block (struct objfile *objfile,
@@ -220,8 +268,12 @@ find_symbol_in_list (struct pending *list, char *name, int length)
return (NULL);
}
-/* At end of reading syms, or in case of quit, really free as many
- `struct pending's as we can easily find. */
+/* At end of reading syms, or in case of quit, ensure everything associated
+ with building symtabs is freed. This is intended to be registered as a
+ cleanup before doing psymtab->symtab expansion.
+
+ N.B. This is *not* intended to be used when building psymtabs. Some debug
+ info readers call this anyway, which is harmless if confusing. */
void
really_free_pendings (void *dummy)
@@ -253,12 +305,13 @@ really_free_pendings (void *dummy)
if (pending_macros)
free_macro_table (pending_macros);
+ pending_macros = NULL;
if (pending_addrmap)
- {
- obstack_free (&pending_addrmap_obstack, NULL);
- pending_addrmap = NULL;
- }
+ obstack_free (&pending_addrmap_obstack, NULL);
+ pending_addrmap = NULL;
+
+ free_buildsym_compunit ();
}
/* This function is called to discard any pending blocks. */
@@ -744,6 +797,7 @@ free_buildsym_compunit (void)
xfree (buildsym_compunit->comp_dir);
xfree (buildsym_compunit);
buildsym_compunit = NULL;
+ current_subfile = NULL;
}
/* For stabs readers, the first N_SO symbol is assumed to be the
@@ -943,6 +997,32 @@ get_macro_table (void)
return pending_macros;
}
+/* Init state to prepare for building a symtab.
+ Note: This can't be done in buildsym_init because dbxread.c and xcoffread.c
+ can call start_symtab+end_symtab multiple times after one call to
+ buildsym_init. */
+
+static void
+prepare_for_building (const char *name, CORE_ADDR start_addr)
+{
+ set_last_source_file (name);
+ last_source_start_addr = start_addr;
+
+ local_symbols = NULL;
+ within_function = 0;
+ have_line_numbers = 0;
+
+ context_stack_depth = 0;
+
+ /* These should have been reset either by successful completion of building
+ a symtab, or by the really_free_pendings cleanup. */
+ gdb_assert (file_symbols == NULL);
+ gdb_assert (global_symbols == NULL);
+ gdb_assert (pending_macros == NULL);
+ gdb_assert (pending_addrmap == NULL);
+ gdb_assert (current_subfile == NULL);
+}
+
/* Start a new symtab for a new source file in OBJFILE. Called, for example,
when a stabs symbol of type N_SO is seen, or when a DWARF
TAG_compile_unit DIE is seen. It indicates the start of data for
@@ -956,11 +1036,11 @@ struct compunit_symtab *
start_symtab (struct objfile *objfile, const char *name, const char *comp_dir,
CORE_ADDR start_addr)
{
- restart_symtab (start_addr);
+ prepare_for_building (name, start_addr);
buildsym_compunit = start_buildsym_compunit (objfile, comp_dir);
- /* Allocate the primary symtab now. The caller needs it to allocate
+ /* Allocate the compunit symtab now. The caller needs it to allocate
non-primary symtabs. It is also needed by get_macro_table. */
buildsym_compunit->compunit_symtab = allocate_compunit_symtab (objfile,
name);
@@ -976,43 +1056,27 @@ start_symtab (struct objfile *objfile, const char *name, const char *comp_dir,
of the subfiles list. */
buildsym_compunit->main_subfile = current_subfile;
- set_last_source_file (name);
-
return buildsym_compunit->compunit_symtab;
}
/* Restart compilation for a symtab.
+ CUST is the result of end_expandable_symtab.
+ NAME, START_ADDR are the source file we are resuming with.
+
This is used when a symtab is built from multiple sources.
- The symtab is first built with start_symtab and then for each additional
- piece call restart_symtab. */
+ The symtab is first built with start_symtab/end_expandable_symtab
+ and then for each additional piece call restart_symtab/augment_*_symtab.
+ Note: At the moment there is only augment_type_symtab. */
void
-restart_symtab (CORE_ADDR start_addr)
+restart_symtab (struct compunit_symtab *cust,
+ const char *name, CORE_ADDR start_addr)
{
- set_last_source_file (NULL);
- last_source_start_addr = start_addr;
- file_symbols = NULL;
- global_symbols = NULL;
- within_function = 0;
- have_line_numbers = 0;
+ prepare_for_building (name, start_addr);
- /* Context stack is initially empty. Allocate first one with room
- for 10 levels; reuse it forever afterward. */
- if (context_stack == NULL)
- {
- context_stack_size = INITIAL_CONTEXT_STACK_SIZE;
- context_stack = (struct context_stack *)
- xmalloc (context_stack_size * sizeof (struct context_stack));
- }
- context_stack_depth = 0;
-
- /* We shouldn't have any address map at this point. */
- gdb_assert (! pending_addrmap);
-
- /* Reset the sub source files list. The list should already be empty,
- but free it anyway in case some code didn't finish cleaning up after
- an error. */
- free_buildsym_compunit ();
+ buildsym_compunit = start_buildsym_compunit (COMPUNIT_OBJFILE (cust),
+ COMPUNIT_DIRNAME (cust));
+ buildsym_compunit->compunit_symtab = cust;
}
/* Subroutine of end_symtab to simplify it. Look for a subfile that
@@ -1101,19 +1165,30 @@ block_compar (const void *ap, const void *bp)
- (BLOCK_START (b) < BLOCK_START (a)));
}
-/* Reset globals used to build symtabs. */
+/* Reset state after a successful building of a symtab.
+ This exists because dbxread.c and xcoffread.c can call
+ start_symtab+end_symtab multiple times after one call to buildsym_init,
+ and before the really_free_pendings cleanup is called.
+ We keep the free_pendings list around for dbx/xcoff sake. */
static void
reset_symtab_globals (void)
{
set_last_source_file (NULL);
- free_buildsym_compunit ();
+
+ local_symbols = NULL;
+ file_symbols = NULL;
+ global_symbols = NULL;
+
+ /* We don't free pending_macros here because if the symtab was successfully
+ built then ownership was transferred to the symtab. */
pending_macros = NULL;
+
if (pending_addrmap)
- {
- obstack_free (&pending_addrmap_obstack, NULL);
- pending_addrmap = NULL;
- }
+ obstack_free (&pending_addrmap_obstack, NULL);
+ pending_addrmap = NULL;
+
+ free_buildsym_compunit ();
}
/* Implementation of the first part of end_symtab. It allows modifying
@@ -1221,23 +1296,6 @@ end_symtab_get_static_block (CORE_ADDR end_addr, int expandable, int required)
}
/* Subroutine of end_symtab_from_static_block to simplify it.
- Handle the "no blockvector" case.
- When this happens there is nothing to record, so just free up
- any memory we allocated while reading debug info. */
-
-static void
-end_symtab_without_blockvector (void)
-{
- /* Free up all the subfiles.
- We won't be adding a compunit to the objfile's list of compunits,
- so there's nothing to unchain. However, since each symtab
- is added to the objfile's obstack we can't free that space.
- We could do better, but this is believed to be a sufficiently rare
- event. */
- free_buildsym_compunit ();
-}
-
-/* Subroutine of end_symtab_from_static_block to simplify it.
Handle the "have blockvector" case.
See end_symtab_from_static_block for a description of the arguments. */
@@ -1349,7 +1407,7 @@ end_symtab_with_blockvector (struct block *static_block,
gdb_assert (main_symtab == COMPUNIT_FILETABS (cu));
}
- /* Fill out the primary symtab. */
+ /* Fill out the compunit symtab. */
if (buildsym_compunit->comp_dir != NULL)
{
@@ -1406,7 +1464,6 @@ end_symtab_with_blockvector (struct block *static_block,
}
add_compunit_symtab_to_objfile (cu);
- free_buildsym_compunit ();
return cu;
}
@@ -1428,7 +1485,15 @@ end_symtab_from_static_block (struct block *static_block,
if (static_block == NULL)
{
- end_symtab_without_blockvector ();
+ /* Handle the "no blockvector" case.
+ When this happens there is nothing to record, so there's nothing
+ to do: memory will be freed up later.
+
+ Note: We won't be adding a compunit to the objfile's list of
+ compunits, so there's nothing to unchain. However, since each symtab
+ is added to the objfile's obstack we can't free that space.
+ We could do better, but this is believed to be a sufficiently rare
+ event. */
cu = NULL;
}
else
@@ -1506,8 +1571,9 @@ set_missing_symtab (struct pending *pending_list,
This is the case for DWARF4 Type Units. */
void
-augment_type_symtab (struct compunit_symtab *cust)
+augment_type_symtab (void)
{
+ struct compunit_symtab *cust = buildsym_compunit->compunit_symtab;
const struct blockvector *blockvector = COMPUNIT_BLOCKVECTOR (cust);
if (context_stack_depth > 0)
@@ -1674,17 +1740,29 @@ get_last_source_file (void)
void
buildsym_init (void)
{
- free_pendings = NULL;
- file_symbols = NULL;
- global_symbols = NULL;
- pending_blocks = NULL;
- pending_macros = NULL;
using_directives = NULL;
subfile_stack = NULL;
- /* We shouldn't have any address map at this point. */
- gdb_assert (! pending_addrmap);
pending_addrmap_interesting = 0;
+
+ /* Context stack is initially empty. Allocate first one with room
+ for a few levels; reuse it forever afterward. */
+ if (context_stack == NULL)
+ {
+ context_stack_size = INITIAL_CONTEXT_STACK_SIZE;
+ context_stack = (struct context_stack *)
+ xmalloc (context_stack_size * sizeof (struct context_stack));
+ }
+
+ /* Ensure the really_free_pendings cleanup was called after
+ the last time. */
+ gdb_assert (free_pendings == NULL);
+ gdb_assert (pending_blocks == NULL);
+ gdb_assert (file_symbols == NULL);
+ gdb_assert (global_symbols == NULL);
+ gdb_assert (pending_macros == NULL);
+ gdb_assert (pending_addrmap == NULL);
+ gdb_assert (buildsym_compunit == NULL);
}
/* Initialize anything that needs initializing when a completely new
diff --git a/gdb/buildsym.h b/gdb/buildsym.h
index bddec5f..307ce0a 100644
--- a/gdb/buildsym.h
+++ b/gdb/buildsym.h
@@ -222,7 +222,7 @@ extern struct compunit_symtab *end_symtab (CORE_ADDR end_addr, int section);
extern struct compunit_symtab *end_expandable_symtab (CORE_ADDR end_addr,
int section);
-extern void augment_type_symtab (struct compunit_symtab *cust);
+extern void augment_type_symtab (void);
/* Defined in stabsread.c. */
@@ -243,7 +243,8 @@ extern struct compunit_symtab *start_symtab (struct objfile *objfile,
const char *comp_dir,
CORE_ADDR start_addr);
-extern void restart_symtab (CORE_ADDR start_addr);
+extern void restart_symtab (struct compunit_symtab *cust,
+ const char *name, CORE_ADDR start_addr);
extern int hashname (const char *name);
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 92ff3b6..707e504 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -2942,9 +2942,9 @@ classify_name (struct parser_state *par_state, const struct block *block,
}
yylval.tsym.type
- = language_lookup_primitive_type_by_name (parse_language (par_state),
- parse_gdbarch (par_state),
- copy);
+ = language_lookup_primitive_type (parse_language (par_state),
+ parse_gdbarch (par_state),
+ copy);
if (yylval.tsym.type != NULL)
return TYPENAME;
@@ -3019,7 +3019,7 @@ classify_inner_name (struct parser_state *par_state,
relative to the `this' pointer. */
if (yylval.ssym.sym == NULL)
{
- struct type *base_type = find_type_baseclass_by_name (type, copy);
+ struct type *base_type = cp_find_type_baseclass_by_name (type, copy);
if (base_type != NULL)
{
@@ -3038,7 +3038,7 @@ classify_inner_name (struct parser_state *par_state,
named COPY when we really wanted a base class of the same name.
Double-check this case by looking for a base class. */
{
- struct type *base_type = find_type_baseclass_by_name (type, copy);
+ struct type *base_type = cp_find_type_baseclass_by_name (type, copy);
if (base_type != NULL)
{
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 6d3d16e..414fc35 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -191,7 +191,11 @@ get_compile_file_tempdir (void)
strcpy (tname, TEMPLATE);
#undef TEMPLATE
+#ifdef HAVE_MKDTEMP
tempdir_name = mkdtemp (tname);
+#else
+ error (_("Command not supported on this host."));
+#endif
if (tempdir_name == NULL)
perror_with_name (_("Could not make temporary directory"));
diff --git a/gdb/config.in b/gdb/config.in
index fb3c315..9d3f32d 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -231,6 +231,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `mkdtemp' function. */
+#undef HAVE_MKDTEMP
+
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
diff --git a/gdb/configure b/gdb/configure
index 8985230..7ff74ba 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -10496,7 +10496,7 @@ for ac_func in getrusage getuid getgid \
sigaction sigprocmask sigsetmask socketpair \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
setrlimit getrlimit posix_madvise waitpid \
- ptrace64 sigaltstack
+ ptrace64 sigaltstack mkdtemp
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/gdb/configure.ac b/gdb/configure.ac
index c933e3f..e972ac2 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1317,7 +1317,7 @@ AC_CHECK_FUNCS([getrusage getuid getgid \
sigaction sigprocmask sigsetmask socketpair \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
setrlimit getrlimit posix_madvise waitpid \
- ptrace64 sigaltstack])
+ ptrace64 sigaltstack mkdtemp])
AM_LANGINFO_CODESET
GDB_AC_COMMON
diff --git a/gdb/corelow.c b/gdb/corelow.c
index b91ad22..154b2c4 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -954,7 +954,7 @@ core_pid_to_str (struct target_ops *ops, ptid_t ptid)
/* Otherwise, this isn't a "threaded" core -- use the PID field, but
only if it isn't a fake PID. */
- inf = find_inferior_pid (ptid_get_pid (ptid));
+ inf = find_inferior_ptid (ptid);
if (inf != NULL && !inf->fake_pid_p)
return normal_pid_to_str (ptid);
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index c083327..f17cd69 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -371,12 +371,12 @@ reset_directive_searched (void *data)
only the import of Y is considered. */
static struct symbol *
-cp_lookup_symbol_imports (const char *scope,
- const char *name,
- const struct block *block,
- const domain_enum domain,
- const int declaration_only,
- const int search_parents)
+cp_lookup_symbol_via_imports (const char *scope,
+ const char *name,
+ const struct block *block,
+ const domain_enum domain,
+ const int declaration_only,
+ const int search_parents)
{
struct using_direct *current;
struct symbol *sym = NULL;
@@ -472,9 +472,9 @@ cp_lookup_symbol_imports (const char *scope,
/* If this import statement creates no alias, pass
current->inner as NAMESPACE to direct the search
towards the imported namespace. */
- sym = cp_lookup_symbol_imports (current->import_src,
- name, block,
- domain, 0, 0);
+ sym = cp_lookup_symbol_via_imports (current->import_src,
+ name, block,
+ domain, 0, 0);
}
current->searched = 0;
discard_cleanups (searched_cleanup);
@@ -505,7 +505,7 @@ search_symbol_list (const char *name, int num,
return NULL;
}
-/* Like cp_lookup_symbol_imports, but if BLOCK is a function, it
+/* Like cp_lookup_symbol_via_imports, but if BLOCK is a function, it
searches through the template parameters of the function and the
function's type. */
@@ -516,6 +516,16 @@ cp_lookup_symbol_imports_or_template (const char *scope,
const domain_enum domain)
{
struct symbol *function = BLOCK_FUNCTION (block);
+ struct symbol *result;
+
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_imports_or_template"
+ " (%s, %s, %s, %s)\n",
+ scope, name, host_address_to_string (block),
+ domain_name (domain));
+ }
if (function != NULL && SYMBOL_LANGUAGE (function) == language_cplus)
{
@@ -524,13 +534,21 @@ cp_lookup_symbol_imports_or_template (const char *scope,
{
struct template_symbol *templ
= (struct template_symbol *) function;
- struct symbol *result;
result = search_symbol_list (name,
templ->n_template_arguments,
templ->template_arguments);
if (result != NULL)
- return result;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_imports_or_template"
+ " (...) = %s\n",
+ host_address_to_string (result));
+ }
+ return result;
+ }
}
/* Search the template parameters of the function's defining
@@ -547,7 +565,6 @@ cp_lookup_symbol_imports_or_template (const char *scope,
while (1)
{
- struct symbol *result;
unsigned int prefix_len = cp_entire_prefix_len (name_copy);
if (prefix_len == 0)
@@ -570,6 +587,13 @@ cp_lookup_symbol_imports_or_template (const char *scope,
if (result != NULL)
{
do_cleanups (cleanups);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_imports_or_template"
+ " (...) = %s\n",
+ host_address_to_string (result));
+ }
return result;
}
}
@@ -578,7 +602,15 @@ cp_lookup_symbol_imports_or_template (const char *scope,
}
}
- return cp_lookup_symbol_imports (scope, name, block, domain, 1, 1);
+ result = cp_lookup_symbol_via_imports (scope, name, block, domain, 1, 1);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_imports_or_template (...) = %s\n",
+ result != NULL
+ ? host_address_to_string (result) : "NULL");
+ }
+ return result;
}
/* Searches for NAME in the current namespace, and by applying
@@ -593,26 +625,55 @@ cp_lookup_symbol_namespace (const char *scope,
const domain_enum domain)
{
struct symbol *sym;
-
+
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_namespace (%s, %s, %s, %s)\n",
+ scope, name, host_address_to_string (block),
+ domain_name (domain));
+ }
+
/* First, try to find the symbol in the given namespace. */
sym = cp_lookup_symbol_in_namespace (scope, name,
block, domain, 1);
if (sym != NULL)
- return sym;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_namespace (...) = %s\n",
+ host_address_to_string (sym));
+ }
+ return sym;
+ }
/* Search for name in namespaces imported to this and parent
blocks. */
while (block != NULL)
{
- sym = cp_lookup_symbol_imports (scope, name, block,
- domain, 0, 1);
+ sym = cp_lookup_symbol_via_imports (scope, name, block,
+ domain, 0, 1);
if (sym)
- return sym;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_namespace (...) = %s\n",
+ host_address_to_string (sym));
+ }
+ return sym;
+ }
block = BLOCK_SUPERBLOCK (block);
}
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_namespace (...) = NULL\n");
+ }
return NULL;
}
@@ -684,20 +745,42 @@ cp_lookup_symbol_nonlocal (const char *name,
struct symbol *sym;
const char *scope = block_scope (block);
- sym = lookup_namespace_scope (name, block,
- domain, scope, 0);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_non_local"
+ " (%s, %s (scope %s), %s)\n",
+ name, host_address_to_string (block), scope,
+ domain_name (domain));
+ }
+
+ sym = lookup_namespace_scope (name, block, domain, scope, 0);
if (sym != NULL)
- return sym;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_nonlocal (...) = %s\n",
+ host_address_to_string (sym));
+ }
+ return sym;
+ }
- return cp_lookup_symbol_namespace (scope, name,
- block, domain);
+ sym = cp_lookup_symbol_namespace (scope, name, block, domain);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_symbol_nonlocal (...) = %s\n",
+ sym != NULL ? host_address_to_string (sym) : "NULL");
+ }
+ return sym;
}
/* Search through the base classes of PARENT_TYPE for a base class
named NAME and return its type. If not found, return NULL. */
struct type *
-find_type_baseclass_by_name (struct type *parent_type, const char *name)
+cp_find_type_baseclass_by_name (struct type *parent_type, const char *name)
{
int i;
@@ -713,7 +796,7 @@ find_type_baseclass_by_name (struct type *parent_type, const char *name)
if (streq (base_name, name))
return type;
- type = find_type_baseclass_by_name (type, name);
+ type = cp_find_type_baseclass_by_name (type, name);
if (type != NULL)
return type;
}
@@ -798,6 +881,16 @@ cp_lookup_nested_symbol (struct type *parent_type,
CHECK_TYPEDEF (parent_type);
+ if (symbol_lookup_debug)
+ {
+ const char *type_name = type_name_no_tag (saved_parent_type);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_nested_symbol (%s, %s, %s)\n",
+ type_name != NULL ? type_name : "unnamed",
+ nested_name, host_address_to_string (block));
+ }
+
switch (TYPE_CODE (parent_type))
{
case TYPE_CODE_STRUCT:
@@ -824,7 +917,15 @@ cp_lookup_nested_symbol (struct type *parent_type,
char *concatenated_name;
if (sym != NULL)
- return sym;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_nested_symbol (...) = %s\n",
+ host_address_to_string (sym));
+ }
+ return sym;
+ }
/* Now search all static file-level symbols. We have to do this
for things like typedefs in the class. We do not try to
@@ -838,15 +939,37 @@ cp_lookup_nested_symbol (struct type *parent_type,
parent_name, nested_name);
sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN);
if (sym != NULL)
- return sym;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_nested_symbol (...) = %s\n",
+ host_address_to_string (sym));
+ }
+ return sym;
+ }
/* If no matching symbols were found, try searching any
base classes. */
- return find_symbol_in_baseclass (parent_type, nested_name, block);
+ sym = find_symbol_in_baseclass (parent_type, nested_name, block);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_nested_symbol (...) = %s\n",
+ sym != NULL
+ ? host_address_to_string (sym) : "NULL");
+ }
+ return sym;
}
case TYPE_CODE_FUNC:
case TYPE_CODE_METHOD:
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "cp_lookup_nested_symbol (...) = NULL"
+ " (func/method)\n");
+ }
return NULL;
default:
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index efd1e18..2594e34 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -215,8 +215,8 @@ struct type *cp_lookup_transparent_type (const char *name);
/* See description in cp-namespace.c. */
-struct type *find_type_baseclass_by_name (struct type *parent_type,
- const char *name);
+struct type *cp_find_type_baseclass_by_name (struct type *parent_type,
+ const char *name);
/* Functions from cp-name-parser.y. */
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index 5e4c10d..00d3a26 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -1577,8 +1577,8 @@ yylex (void)
return DOLLAR_VARIABLE;
yylval.tsym.type
- = language_lookup_primitive_type_by_name (parse_language (pstate),
- parse_gdbarch (pstate), copy);
+ = language_lookup_primitive_type (parse_language (pstate),
+ parse_gdbarch (pstate), copy);
if (yylval.tsym.type != NULL)
return TYPENAME;
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 511f370..36b6021 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -859,7 +859,7 @@ darwin_resume (ptid_t ptid, int step, enum gdb_signal signal)
}
else
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ptid));
+ struct inferior *inf = find_inferior_ptid (ptid);
long tid = ptid_get_tid (ptid);
/* Stop the inferior (should be useless). */
diff --git a/gdb/defs.h b/gdb/defs.h
index 7920938..7b5bc06 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -277,11 +277,11 @@ extern void print_transfer_performance (struct ui_file *stream,
typedef void initialize_file_ftype (void);
-extern char *gdb_readline (char *);
+extern char *gdb_readline (const char *);
-extern char *gdb_readline_wrapper (char *);
+extern char *gdb_readline_wrapper (const char *);
-extern char *command_line_input (char *, int, char *);
+extern char *command_line_input (const char *, int, char *);
extern void print_prompt (void);
@@ -664,7 +664,7 @@ extern void (*deprecated_warning_hook) (const char *, va_list)
extern void (*deprecated_interactive_hook) (void);
extern void (*deprecated_readline_begin_hook) (char *, ...)
ATTRIBUTE_FPTR_PRINTF_1;
-extern char *(*deprecated_readline_hook) (char *);
+extern char *(*deprecated_readline_hook) (const char *);
extern void (*deprecated_readline_end_hook) (void);
extern void (*deprecated_register_changed_hook) (int regno);
extern void (*deprecated_context_hook) (int);
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 7dfaee0..31fe791 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-17 Doug Evans <xdje42@gmail.com>
+
+ * gdb.texinfo (Debugging Output): Document "debug symbol-lookup".
+
2014-12-12 Phil Muldoon <pmuldoon@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 56a81f0..e086c33 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -23186,6 +23186,14 @@ Turns on or off debugging messages for FR-V shared-library code.
@item show debug solib-frv
Display the current state of FR-V shared-library code debugging
messages.
+@item set debug symbol-lookup
+@cindex symbol lookup
+Turns on or off display of debugging messages related to symbol lookup.
+The default is 0 (off).
+A value of 1 provides basic information.
+A value greater than 1 provides more verbose information.
+@item show debug symbol-lookup
+Show the current state of symbol lookup debugging messages.
@item set debug symfile
@cindex symbol file functions
Turns on or off display of debugging messages related to symbol file functions.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index e36af5a..0e8f937 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -8093,7 +8093,7 @@ process_full_type_unit (struct dwarf2_per_cu_data *per_cu,
}
else
{
- augment_type_symtab (sig_type->type_unit_group->compunit_symtab);
+ augment_type_symtab ();
cust = sig_type->type_unit_group->compunit_symtab;
}
@@ -9149,7 +9149,7 @@ setup_type_unit_groups (struct die_info *die, struct dwarf2_cu *cu)
else
{
gdb_assert (tu_group->symtabs == NULL);
- restart_symtab (0);
+ restart_symtab (tu_group->compunit_symtab, "", 0);
}
/* Note: The compunit symtab will get allocated at the end. */
return;
@@ -9190,7 +9190,7 @@ setup_type_unit_groups (struct die_info *die, struct dwarf2_cu *cu)
}
else
{
- restart_symtab (0);
+ restart_symtab (tu_group->compunit_symtab, "", 0);
for (i = 0; i < lh->num_file_names; ++i)
{
diff --git a/gdb/elfread.c b/gdb/elfread.c
index b4ec067..93e5045 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1236,10 +1236,6 @@ elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags,
We have been initialized by a call to elf_symfile_init, which
currently does nothing.
- SECTION_OFFSETS is a set of offsets to apply to relocate the symbols
- in each section. We simplify it down to a single offset for all
- symbols. FIXME.
-
This function only does the minimum work necessary for letting the
user "name" things symbolically; it does not read the entire symtab.
Instead, it reads the external and static symbols and puts them in partial
@@ -1418,14 +1414,7 @@ elf_symfile_finish (struct objfile *objfile)
dwarf2_free_objfile (objfile);
}
-/* ELF specific initialization routine for reading symbols.
-
- It is passed a pointer to a struct sym_fns which contains, among other
- things, the BFD for the file whose symbols are being read, and a slot for
- a pointer to "private data" which we can fill with goodies.
-
- For now at least, we have nothing in particular to do, so this function is
- just a stub. */
+/* ELF specific initialization routine for reading symbols. */
static void
elf_symfile_init (struct objfile *objfile)
diff --git a/gdb/event-top.c b/gdb/event-top.c
index cb438ac..55caf72 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -288,7 +288,7 @@ gdb_rl_callback_handler_reinstall (void)
3. On prompting for pagination. */
void
-display_gdb_prompt (char *new_prompt)
+display_gdb_prompt (const char *new_prompt)
{
char *actual_gdb_prompt = NULL;
struct cleanup *old_chain;
diff --git a/gdb/event-top.h b/gdb/event-top.h
index 919287e..0c8baae 100644
--- a/gdb/event-top.h
+++ b/gdb/event-top.h
@@ -27,7 +27,7 @@ struct cmd_list_element;
/* Exported functions from event-top.c.
FIXME: these should really go into top.h. */
-extern void display_gdb_prompt (char *new_prompt);
+extern void display_gdb_prompt (const char *new_prompt);
void gdb_setup_readline (void);
void gdb_disable_readline (void);
extern void async_init_signals (void);
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index f229afa..ab3801a 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -1230,8 +1230,8 @@ yylex (void)
}
yylval.tsym.type
- = language_lookup_primitive_type_by_name (parse_language (pstate),
- parse_gdbarch (pstate), tmp);
+ = language_lookup_primitive_type (parse_language (pstate),
+ parse_gdbarch (pstate), tmp);
if (yylval.tsym.type != NULL)
return TYPENAME;
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 657708e..93110af 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -379,6 +379,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->deprecated_fp_regnum = -1;
gdbarch->call_dummy_location = AT_ENTRY_POINT;
gdbarch->print_registers_info = default_print_registers_info;
+ gdbarch->print_float_info = default_print_float_info;
gdbarch->register_sim_regno = legacy_register_sim_regno;
gdbarch->cannot_fetch_register = cannot_register_not;
gdbarch->cannot_store_register = cannot_register_not;
@@ -531,7 +532,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of call_dummy_location, invalid_p == 0 */
/* Skip verify of push_dummy_code, has predicate. */
/* Skip verify of print_registers_info, invalid_p == 0 */
- /* Skip verify of print_float_info, has predicate. */
+ /* Skip verify of print_float_info, invalid_p == 0 */
/* Skip verify of print_vector_info, has predicate. */
/* Skip verify of register_sim_regno, invalid_p == 0 */
/* Skip verify of cannot_fetch_register, invalid_p == 0 */
@@ -1089,9 +1090,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: pointer_to_address = <%s>\n",
host_address_to_string (gdbarch->pointer_to_address));
fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
- gdbarch_print_float_info_p (gdbarch));
- fprintf_unfiltered (file,
"gdbarch_dump: print_float_info = <%s>\n",
host_address_to_string (gdbarch->print_float_info));
fprintf_unfiltered (file,
@@ -2235,13 +2233,6 @@ set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
gdbarch->print_registers_info = print_registers_info;
}
-int
-gdbarch_print_float_info_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->print_float_info != NULL;
-}
-
void
gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
{
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index a40863d..c22fc7d 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -377,8 +377,6 @@ typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, stru
extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
-extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch);
-
typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index a643d00..685f08f 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -479,7 +479,7 @@ v:int:call_dummy_location::::AT_ENTRY_POINT::0
M:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache:sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache
m:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all::default_print_registers_info::0
-M:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
+m:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args::default_print_float_info::0
M:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
# MAP a GDB RAW register number onto a simulator register number. See
# also include/...-sim.h.
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 6a5005e..a95bce5 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,23 @@
+2014-12-16 Joel Brobecker <brobecker@adacore.com>
+
+ * linux-low.c (linux_low_filter_event): Update call to
+ linux_enable_event_reporting following the addition of
+ a new parameter to that function.
+
+2014-12-16 Catalin Udma <catalin.udma@freescale.com>
+
+ PR server/17457
+ * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
+ (AARCH64_FPCR_REGNO): Likewise.
+ (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
+ (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
+ (aarch64_store_fpregset): Likewise.
+
+2014-12-15 Joel Brobecker <brobecker@adacore.com>
+
+ * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
+ Remove FIXME comment about assumption about N.
+
2014-12-13 Joel Brobecker <brobecker@adacore.com>
* configure.ac: If large-file support is disabled in GDBserver,
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index 654b319..4fe023f 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -46,8 +46,10 @@ extern const struct target_desc *tdesc_aarch64;
#define AARCH64_PC_REGNO 32
#define AARCH64_CPSR_REGNO 33
#define AARCH64_V0_REGNO 34
+#define AARCH64_FPSR_REGNO (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM)
+#define AARCH64_FPCR_REGNO (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 1)
-#define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM)
+#define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 2)
static int
aarch64_regmap [] =
@@ -255,6 +257,8 @@ aarch64_fill_fpregset (struct regcache *regcache, void *buf)
for (i = 0; i < AARCH64_V_REGS_NUM; i++)
collect_register (regcache, AARCH64_V0_REGNO + i, &regset->vregs[i]);
+ collect_register (regcache, AARCH64_FPSR_REGNO, &regset->fpsr);
+ collect_register (regcache, AARCH64_FPCR_REGNO, &regset->fpcr);
}
static void
@@ -265,6 +269,8 @@ aarch64_store_fpregset (struct regcache *regcache, const void *buf)
for (i = 0; i < AARCH64_V_REGS_NUM; i++)
supply_register (regcache, AARCH64_V0_REGNO + i, &regset->vregs[i]);
+ supply_register (regcache, AARCH64_FPSR_REGNO, &regset->fpsr);
+ supply_register (regcache, AARCH64_FPCR_REGNO, &regset->fpcr);
}
/* Enable miscellaneous debugging output. The name is historical - it
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 5ea9200..65f72a2 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -1878,7 +1878,9 @@ linux_low_filter_event (ptid_t filter_ptid, int lwpid, int wstat)
if (WIFSTOPPED (wstat) && child->must_set_ptrace_flags)
{
- linux_enable_event_reporting (lwpid);
+ struct process_info *proc = find_process_pid (pid_of (thread));
+
+ linux_enable_event_reporting (lwpid, proc->attached);
child->must_set_ptrace_flags = 0;
}
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
index 6178e03..3b83669 100644
--- a/gdb/gdbserver/lynx-low.c
+++ b/gdb/gdbserver/lynx-low.c
@@ -320,10 +320,11 @@ lynx_attach (unsigned long pid)
static void
lynx_resume (struct thread_resume *resume_info, size_t n)
{
- /* FIXME: Assume for now that n == 1. */
ptid_t ptid = resume_info[0].thread;
- const int request = (resume_info[0].kind == resume_step
- ? PTRACE_SINGLESTEP : PTRACE_CONT);
+ const int request
+ = (resume_info[0].kind == resume_step
+ ? (n == 1 ? PTRACE_SINGLESTEP_ONE : PTRACE_SINGLESTEP)
+ : PTRACE_CONT);
const int signal = resume_info[0].sig;
/* If given a minus_one_ptid, then try using the current_process'
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index c5a390a..0048f6a 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1310,7 +1310,7 @@ lookup_typename (const struct language_defn *language,
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
return SYMBOL_TYPE (sym);
- type = language_lookup_primitive_type_by_name (language, gdbarch, name);
+ type = language_lookup_primitive_type (language, gdbarch, name);
if (type)
return type;
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index f9ffbf9..5178178 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -1455,9 +1455,9 @@ classify_name (struct parser_state *par_state, const struct block *block)
copy = copy_name (yylval.sval);
/* Try primitive types first so they win over bad/weird debug info. */
- type = language_lookup_primitive_type_by_name (parse_language (par_state),
- parse_gdbarch (par_state),
- copy);
+ type = language_lookup_primitive_type (parse_language (par_state),
+ parse_gdbarch (par_state),
+ copy);
if (type != NULL)
{
/* NOTE: We take advantage of the fact that yylval coming in was a
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 0f58553..cd2b344 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1256,14 +1256,6 @@ h8300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
return breakpoint;
}
-static void
-h8300_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
- struct frame_info *frame, const char *args)
-{
- fprintf_filtered (file, "\
-No floating-point info available for this processor.\n");
-}
-
static struct gdbarch *
h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
@@ -1375,7 +1367,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_type (gdbarch, h8300_register_type);
set_gdbarch_print_registers_info (gdbarch, h8300_print_registers_info);
- set_gdbarch_print_float_info (gdbarch, h8300_print_float_info);
/*
* Frame Info
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index de0d24d..9b65f1a 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1199,9 +1199,12 @@ jump_command (char *arg, int from_tty)
if (sfn != NULL)
{
+ struct obj_section *section;
+
fixup_symbol_section (sfn, 0);
- if (section_is_overlay (SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (sfn), sfn)) &&
- !section_is_mapped (SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (sfn), sfn)))
+ section = SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (sfn), sfn);
+ if (section_is_overlay (section)
+ && !section_is_mapped (section))
{
if (!query (_("WARNING!!! Destination is in "
"unmapped overlay! Jump anyway? ")))
@@ -2864,43 +2867,41 @@ interrupt_command (char *args, int from_tty)
}
}
-static void
-print_float_info (struct ui_file *file,
- struct frame_info *frame, const char *args)
+/* See inferior.h. */
+
+void
+default_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
+ int regnum;
+ int printed_something = 0;
- if (gdbarch_print_float_info_p (gdbarch))
- gdbarch_print_float_info (gdbarch, file, frame, args);
- else
+ for (regnum = 0;
+ regnum < gdbarch_num_regs (gdbarch)
+ + gdbarch_num_pseudo_regs (gdbarch);
+ regnum++)
{
- int regnum;
- int printed_something = 0;
-
- for (regnum = 0;
- regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
- regnum++)
+ if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
{
- if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
- {
- printed_something = 1;
- gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
- }
+ printed_something = 1;
+ gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
}
- if (!printed_something)
- fprintf_filtered (file, "No floating-point info "
- "available for this processor.\n");
}
+ if (!printed_something)
+ fprintf_filtered (file, "No floating-point info "
+ "available for this processor.\n");
}
static void
float_info (char *args, int from_tty)
{
+ struct frame_info *frame;
+
if (!target_has_registers)
error (_("The program has no registers now."));
- print_float_info (gdb_stdout, get_selected_frame (NULL), args);
+ frame = get_selected_frame (NULL);
+ gdbarch_print_float_info (get_frame_arch (frame), gdb_stdout, frame, args);
}
static void
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 44f4560..49c479d 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -367,6 +367,14 @@ find_inferior_pid (int pid)
return NULL;
}
+/* See inferior.h */
+
+struct inferior *
+find_inferior_ptid (ptid_t ptid)
+{
+ return find_inferior_pid (ptid_get_pid (ptid));
+}
+
/* See inferior.h. */
struct inferior *
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 0129549..b607fbf 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -106,6 +106,14 @@ extern void default_print_registers_info (struct gdbarch *gdbarch,
struct frame_info *frame,
int regnum, int all);
+/* Default implementation of gdbarch_print_float_info. Print
+ the values of all floating point registers. */
+
+extern void default_print_float_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ const char *args);
+
extern void child_terminal_info (struct target_ops *self, const char *, int);
extern void term_info (char *, int);
@@ -465,6 +473,9 @@ extern int valid_gdb_inferior_id (int num);
/* Search function to lookup an inferior by target 'pid'. */
extern struct inferior *find_inferior_pid (int pid);
+/* Search function to lookup an inferior whose pid is equal to 'ptid.pid'. */
+extern struct inferior *find_inferior_ptid (ptid_t ptid);
+
/* Search function to lookup an inferior by GDB 'num'. */
extern struct inferior *find_inferior_id (int num);
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 74f9e12..413b052 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3262,7 +3262,7 @@ fetch_inferior_event (void *client_data)
if (!ecs->wait_some_more)
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ecs->ptid));
+ struct inferior *inf = find_inferior_ptid (ecs->ptid);
delete_just_stopped_threads_infrun_breakpoints ();
@@ -3581,7 +3581,7 @@ fill_in_stop_func (struct gdbarch *gdbarch,
static enum stop_kind
get_inferior_stop_soon (ptid_t ptid)
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ptid));
+ struct inferior *inf = find_inferior_ptid (ptid);
gdb_assert (inf != NULL);
return inf->control.stop_soon;
@@ -3815,7 +3815,7 @@ handle_inferior_event (struct execution_control_state *ecs)
}
inferior_ptid = ecs->ptid;
- set_current_inferior (find_inferior_pid (ptid_get_pid (ecs->ptid)));
+ set_current_inferior (find_inferior_ptid (ecs->ptid));
set_current_program_space (current_inferior ()->pspace);
handle_vfork_child_exec_or_exit (0);
target_terminal_ours (); /* Must do this before mourn anyway. */
@@ -3899,7 +3899,7 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
if (displaced && ptid_equal (displaced->step_ptid, ecs->ptid))
{
struct inferior *parent_inf
- = find_inferior_pid (ptid_get_pid (ecs->ptid));
+ = find_inferior_ptid (ecs->ptid);
struct regcache *child_regcache;
CORE_ADDR parent_pc;
@@ -4495,7 +4495,7 @@ handle_signal_stop (struct execution_control_state *ecs)
if (random_signal)
{
/* Signal not for debugging purposes. */
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ecs->ptid));
+ struct inferior *inf = find_inferior_ptid (ecs->ptid);
enum gdb_signal stop_signal = ecs->event_thread->suspend.stop_signal;
if (debug_infrun)
diff --git a/gdb/language.c b/gdb/language.c
index 83dd4d5..df45ddd 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -988,21 +988,38 @@ language_bool_type (const struct language_defn *la,
}
struct type *
-language_lookup_primitive_type_by_name (const struct language_defn *la,
- struct gdbarch *gdbarch,
- const char *name)
+language_lookup_primitive_type (const struct language_defn *la,
+ struct gdbarch *gdbarch,
+ const char *name)
{
struct language_gdbarch *ld = gdbarch_data (gdbarch,
language_gdbarch_data);
struct type *const *p;
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "language_lookup_primitive_type (%s, %s, %s)",
+ la->la_name, host_address_to_string (gdbarch), name);
+ }
+
for (p = ld->arch_info[la->la_language].primitive_type_vector;
(*p) != NULL;
p++)
{
if (strcmp (TYPE_NAME (*p), name) == 0)
- return (*p);
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, " = %s\n",
+ host_address_to_string (*p));
+ }
+ return (*p);
+ }
}
+
+ if (symbol_lookup_debug)
+ fprintf_unfiltered (gdb_stdlog, " = NULL\n");
return (NULL);
}
diff --git a/gdb/language.h b/gdb/language.h
index 9ed7e22..aa07d8d 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -435,9 +435,9 @@ struct type *language_bool_type (const struct language_defn *l,
struct type *language_string_char_type (const struct language_defn *l,
struct gdbarch *gdbarch);
-struct type *language_lookup_primitive_type_by_name (const struct language_defn *l,
- struct gdbarch *gdbarch,
- const char *name);
+struct type *language_lookup_primitive_type (const struct language_defn *l,
+ struct gdbarch *gdbarch,
+ const char *name);
/* These macros define the behaviour of the expression
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 21797c1..845d566 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -321,25 +321,27 @@ pull_pid_from_list (struct simple_pid_list **listp, int pid, int *statusp)
}
/* Initialize ptrace warnings and check for supported ptrace
- features given PID. */
+ features given PID.
+
+ ATTACHED should be nonzero iff we attached to the inferior. */
static void
-linux_init_ptrace (pid_t pid)
+linux_init_ptrace (pid_t pid, int attached)
{
- linux_enable_event_reporting (pid);
+ linux_enable_event_reporting (pid, attached);
linux_ptrace_init_warnings ();
}
static void
linux_child_post_attach (struct target_ops *self, int pid)
{
- linux_init_ptrace (pid);
+ linux_init_ptrace (pid, 1);
}
static void
linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
{
- linux_init_ptrace (ptid_get_pid (ptid));
+ linux_init_ptrace (ptid_get_pid (ptid), 0);
}
/* Return the number of known LWPs in the tgid given by PID. */
@@ -1435,7 +1437,7 @@ resume_lwp (struct lwp_info *lp, int step, enum gdb_signal signo)
{
if (lp->stopped)
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (lp->ptid));
+ struct inferior *inf = find_inferior_ptid (lp->ptid);
if (inf->vfork_child != NULL)
{
@@ -2388,7 +2390,7 @@ linux_nat_set_status_is_event (struct target_ops *t,
static int
stop_wait_callback (struct lwp_info *lp, void *data)
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (lp->ptid));
+ struct inferior *inf = find_inferior_ptid (lp->ptid);
/* If this is a vfork parent, bail out, it is not going to report
any SIGSTOP until the vfork is done with. */
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 485f5ca..6b5e475 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1942,9 +1942,9 @@ linux_infcall_mmap (CORE_ADDR size, unsigned prot)
CORE_ADDR retval;
enum
{
- ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, ARG_MAX
+ ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, ARG_LAST
};
- struct value *arg[ARG_MAX];
+ struct value *arg[ARG_LAST];
arg[ARG_ADDR] = value_from_pointer (builtin_type (gdbarch)->builtin_data_ptr,
0);
@@ -1961,7 +1961,7 @@ linux_infcall_mmap (CORE_ADDR size, unsigned prot)
arg[ARG_FD] = value_from_longest (builtin_type (gdbarch)->builtin_int, -1);
arg[ARG_OFFSET] = value_from_longest (builtin_type (gdbarch)->builtin_int64,
0);
- addr_val = call_function_by_hand (mmap_val, ARG_MAX, arg);
+ addr_val = call_function_by_hand (mmap_val, ARG_LAST, arg);
retval = value_as_address (addr_val);
if (retval == (CORE_ADDR) -1)
error (_("Failed inferior mmap call for %s bytes, errno is changed."),
diff --git a/gdb/memattr.c b/gdb/memattr.c
index 25e4554..9d2a2d4 100644
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -447,9 +447,9 @@ mem_info_command (char *args, int from_tty)
m->number,
m->enabled_p ? 'y' : 'n');
if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
- tmp = hex_string_custom ((unsigned long) m->lo, 8);
+ tmp = hex_string_custom (m->lo, 8);
else
- tmp = hex_string_custom ((unsigned long) m->lo, 16);
+ tmp = hex_string_custom (m->lo, 16);
printf_filtered ("%s ", tmp);
@@ -458,14 +458,14 @@ mem_info_command (char *args, int from_tty)
if (m->hi == 0)
tmp = "0x100000000";
else
- tmp = hex_string_custom ((unsigned long) m->hi, 8);
+ tmp = hex_string_custom (m->hi, 8);
}
else
{
if (m->hi == 0)
tmp = "0x10000000000000000";
else
- tmp = hex_string_custom ((unsigned long) m->hi, 16);
+ tmp = hex_string_custom (m->hi, 16);
}
printf_filtered ("%s ", tmp);
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 60f0666..09ff7bf 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -371,7 +371,7 @@ static void
mi_new_thread (struct thread_info *t)
{
struct mi_interp *mi = top_level_interpreter_data ();
- struct inferior *inf = find_inferior_pid (ptid_get_pid (t->ptid));
+ struct inferior *inf = find_inferior_ptid (t->ptid);
gdb_assert (inf);
@@ -391,7 +391,7 @@ mi_thread_exit (struct thread_info *t, int silent)
if (silent)
return;
- inf = find_inferior_pid (ptid_get_pid (t->ptid));
+ inf = find_inferior_ptid (t->ptid);
mi = top_level_interpreter_data ();
old_chain = make_cleanup_restore_target_terminal ();
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 2463be4..2a421fc 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -203,6 +203,14 @@ lookup_minimal_symbol (const char *name, const char *sfile,
and the second over the demangled hash table. */
int pass;
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_minimal_symbol (%s, %s, %s)\n",
+ name, sfile != NULL ? sfile : "NULL",
+ objfile_debug_name (objfile));
+ }
+
for (pass = 1; pass <= 2 && found_symbol.minsym == NULL; pass++)
{
/* Select hash list according to pass. */
@@ -282,13 +290,42 @@ lookup_minimal_symbol (const char *name, const char *sfile,
/* External symbols are best. */
if (found_symbol.minsym != NULL)
- return found_symbol;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_minimal_symbol (...) = %s"
+ " (external)\n",
+ host_address_to_string (found_symbol.minsym));
+ }
+ return found_symbol;
+ }
/* File-local symbols are next best. */
if (found_file_symbol.minsym != NULL)
- return found_file_symbol;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_minimal_symbol (...) = %s"
+ " (file-local)\n",
+ host_address_to_string
+ (found_file_symbol.minsym));
+ }
+ return found_file_symbol;
+ }
/* Symbols for shared library trampolines are next best. */
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_minimal_symbol (...) = %s%s\n",
+ trampoline_symbol.minsym != NULL
+ ? host_address_to_string (trampoline_symbol.minsym)
+ : "NULL",
+ trampoline_symbol.minsym != NULL
+ ? " (trampoline)" : "");
+ }
return trampoline_symbol;
}
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index eb99910..60f43ac 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -73,6 +73,9 @@ static int micromips_insn_at_pc_has_delay_slot (struct gdbarch *gdbarch,
static int mips16_insn_at_pc_has_delay_slot (struct gdbarch *gdbarch,
CORE_ADDR addr, int mustbe32);
+static void mips_print_float_info (struct gdbarch *, struct ui_file *,
+ struct frame_info *, const char *);
+
/* A useful bit in the CP0 status register (MIPS_PS_REGNUM). */
/* This bit is set if we are emulating 32-bit FPRs on a 64-bit chip. */
#define ST0_FR (1 << 26)
@@ -6387,6 +6390,94 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
&opts, 0, file);
}
+/* Print IEEE exception condition bits in FLAGS. */
+
+static void
+print_fpu_flags (struct ui_file *file, int flags)
+{
+ if (flags & (1 << 0))
+ fputs_filtered (" inexact", file);
+ if (flags & (1 << 1))
+ fputs_filtered (" uflow", file);
+ if (flags & (1 << 2))
+ fputs_filtered (" oflow", file);
+ if (flags & (1 << 3))
+ fputs_filtered (" div0", file);
+ if (flags & (1 << 4))
+ fputs_filtered (" inval", file);
+ if (flags & (1 << 5))
+ fputs_filtered (" unimp", file);
+ fputc_filtered ('\n', file);
+}
+
+/* Print interesting information about the floating point processor
+ (if present) or emulator. */
+
+static void
+mips_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
+{
+ int fcsr = mips_regnum (gdbarch)->fp_control_status;
+ enum mips_fpu_type type = MIPS_FPU_TYPE (gdbarch);
+ ULONGEST fcs = 0;
+ int i;
+
+ if (fcsr == -1 || !read_frame_register_unsigned (frame, fcsr, &fcs))
+ type = MIPS_FPU_NONE;
+
+ fprintf_filtered (file, "fpu type: %s\n",
+ type == MIPS_FPU_DOUBLE ? "double-precision"
+ : type == MIPS_FPU_SINGLE ? "single-precision"
+ : "none / unused");
+
+ if (type == MIPS_FPU_NONE)
+ return;
+
+ fprintf_filtered (file, "reg size: %d bits\n",
+ register_size (gdbarch, mips_regnum (gdbarch)->fp0) * 8);
+
+ fputs_filtered ("cond :", file);
+ if (fcs & (1 << 23))
+ fputs_filtered (" 0", file);
+ for (i = 1; i <= 7; i++)
+ if (fcs & (1 << (24 + i)))
+ fprintf_filtered (file, " %d", i);
+ fputc_filtered ('\n', file);
+
+ fputs_filtered ("cause :", file);
+ print_fpu_flags (file, (fcs >> 12) & 0x3f);
+ fputs ("mask :", stdout);
+ print_fpu_flags (file, (fcs >> 7) & 0x1f);
+ fputs ("flags :", stdout);
+ print_fpu_flags (file, (fcs >> 2) & 0x1f);
+
+ fputs_filtered ("rounding: ", file);
+ switch (fcs & 3)
+ {
+ case 0: fputs_filtered ("nearest\n", file); break;
+ case 1: fputs_filtered ("zero\n", file); break;
+ case 2: fputs_filtered ("+inf\n", file); break;
+ case 3: fputs_filtered ("-inf\n", file); break;
+ }
+
+ fputs_filtered ("flush :", file);
+ if (fcs & (1 << 21))
+ fputs_filtered (" nearest", file);
+ if (fcs & (1 << 22))
+ fputs_filtered (" override", file);
+ if (fcs & (1 << 24))
+ fputs_filtered (" zero", file);
+ if ((fcs & (0xb << 21)) == 0)
+ fputs_filtered (" no", file);
+ fputc_filtered ('\n', file);
+
+ fprintf_filtered (file, "nan2008 : %s\n", fcs & (1 << 18) ? "yes" : "no");
+ fprintf_filtered (file, "abs2008 : %s\n", fcs & (1 << 19) ? "yes" : "no");
+ fputc_filtered ('\n', file);
+
+ default_print_float_info (gdbarch, file, frame, args);
+}
+
/* Replacement for generic do_registers_info.
Print regs in pretty columns. */
@@ -8737,6 +8828,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_dummy_code (gdbarch, mips_push_dummy_code);
set_gdbarch_frame_align (gdbarch, mips_frame_align);
+ set_gdbarch_print_float_info (gdbarch, mips_print_float_info);
+
set_gdbarch_convert_register_p (gdbarch, mips_convert_register_p);
set_gdbarch_register_to_value (gdbarch, mips_register_to_value);
set_gdbarch_value_to_register (gdbarch, mips_value_to_register);
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index 8bc3f16..a0e0c32 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -307,6 +307,7 @@ linux_child_function (gdb_byte *child_stack)
static void linux_test_for_tracesysgood (int child_pid);
static void linux_test_for_tracefork (int child_pid);
+static void linux_test_for_exitkill (int child_pid);
/* Determine ptrace features available on this target. */
@@ -338,6 +339,8 @@ linux_check_ptrace_features (void)
linux_test_for_tracefork (child_pid);
+ linux_test_for_exitkill (child_pid);
+
/* Clean things up and kill any pending children. */
do
{
@@ -449,19 +452,44 @@ linux_test_for_tracefork (int child_pid)
"(%d, status 0x%x)"), ret, status);
}
-/* Enable reporting of all currently supported ptrace events. */
+/* Determine if PTRACE_O_EXITKILL can be used. */
+
+static void
+linux_test_for_exitkill (int child_pid)
+{
+ int ret;
+
+ ret = ptrace (PTRACE_SETOPTIONS, child_pid, (PTRACE_TYPE_ARG3) 0,
+ (PTRACE_TYPE_ARG4) PTRACE_O_EXITKILL);
+
+ if (ret == 0)
+ current_ptrace_options |= PTRACE_O_EXITKILL;
+}
+
+/* Enable reporting of all currently supported ptrace events.
+ ATTACHED should be nonzero if we have attached to the inferior. */
void
-linux_enable_event_reporting (pid_t pid)
+linux_enable_event_reporting (pid_t pid, int attached)
{
+ int ptrace_options;
+
/* Check if we have initialized the ptrace features for this
target. If not, do it now. */
if (current_ptrace_options == -1)
linux_check_ptrace_features ();
+ ptrace_options = current_ptrace_options;
+ if (attached)
+ {
+ /* When attached to our inferior, we do not want the inferior
+ to die with us if we terminate unexpectedly. */
+ ptrace_options &= ~PTRACE_O_EXITKILL;
+ }
+
/* Set the options. */
ptrace (PTRACE_SETOPTIONS, pid, (PTRACE_TYPE_ARG3) 0,
- (PTRACE_TYPE_ARG4) (uintptr_t) current_ptrace_options);
+ (PTRACE_TYPE_ARG4) (uintptr_t) ptrace_options);
}
/* Disable reporting of all currently supported ptrace events. */
diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
index 31a77cd..588d38a 100644
--- a/gdb/nat/linux-ptrace.h
+++ b/gdb/nat/linux-ptrace.h
@@ -69,6 +69,11 @@ struct buffer;
#endif /* PTRACE_EVENT_FORK */
+#ifndef PTRACE_O_EXITKILL
+/* Only defined in Linux Kernel 3.8 or later. */
+#define PTRACE_O_EXITKILL 0x00100000
+#endif
+
#if (defined __bfin__ || defined __frv__ || defined __sh__) \
&& !defined PTRACE_GETFDPIC
#define PTRACE_GETFDPIC 31
@@ -85,7 +90,7 @@ struct buffer;
extern void linux_ptrace_attach_fail_reason (pid_t pid, struct buffer *buffer);
extern void linux_ptrace_init_warnings (void);
-extern void linux_enable_event_reporting (pid_t pid);
+extern void linux_enable_event_reporting (pid_t pid, int attached);
extern void linux_disable_event_reporting (pid_t pid);
extern int linux_supports_tracefork (void);
extern int linux_supports_traceclone (void);
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index a5df305..4dcd2e1 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1503,6 +1503,14 @@ objfile_name (const struct objfile *objfile)
return objfile->original_name;
}
+/* See objfiles.h. */
+
+const char *
+objfile_debug_name (const struct objfile *objfile)
+{
+ return lbasename (objfile->original_name);
+}
+
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_objfiles;
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index a888311..084af39 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -701,6 +701,10 @@ void set_objfile_per_bfd (struct objfile *obj);
const char *objfile_name (const struct objfile *objfile);
+/* Return the name to print for OBJFILE in debugging messages. */
+
+extern const char *objfile_debug_name (const struct objfile *objfile);
+
/* Set the objfile's notion of the "main" name and language. */
extern void set_objfile_main_name (struct objfile *objfile,
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 1c966cc..675514c 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -1710,8 +1710,8 @@ yylex (void)
return TYPENAME;
}
yylval.tsym.type
- = language_lookup_primitive_type_by_name (parse_language (pstate),
- parse_gdbarch (pstate), tmp);
+ = language_lookup_primitive_type (parse_language (pstate),
+ parse_gdbarch (pstate), tmp);
if (yylval.tsym.type != NULL)
{
free (uptokstart);
diff --git a/gdb/proc-service.c b/gdb/proc-service.c
index 5819489..1dc98d8 100644
--- a/gdb/proc-service.c
+++ b/gdb/proc-service.c
@@ -114,7 +114,7 @@ ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj,
{
struct bound_minimal_symbol ms;
struct cleanup *old_chain = save_current_program_space ();
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ph->ptid));
+ struct inferior *inf = find_inferior_ptid (ph->ptid);
ps_err_e result;
set_current_program_space (inf->pspace);
diff --git a/gdb/python/lib/gdb/prompt.py b/gdb/python/lib/gdb/prompt.py
index d99f2ea..04adbfb 100644
--- a/gdb/python/lib/gdb/prompt.py
+++ b/gdb/python/lib/gdb/prompt.py
@@ -21,7 +21,7 @@ import os
def _prompt_pwd(ignore):
"The current working directory."
- return os.getcwdu()
+ return os.getcwd()
def _prompt_object_attr(func, what, attr, nattr):
"""Internal worker for fetching GDB attributes."""
diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c
index d98a196..ab419bc 100644
--- a/gdb/python/py-gdb-readline.c
+++ b/gdb/python/py-gdb-readline.c
@@ -29,7 +29,11 @@
static char *
gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
+#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 4
+ const char *prompt)
+#else
char *prompt)
+#endif
{
int n;
char *p = NULL, *q;
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 65d28e3..8b98a91 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -1662,7 +1662,7 @@ record_btrace_step_thread (struct thread_info *tp)
if (replay == NULL)
return btrace_step_no_history ();
- inf = find_inferior_pid (ptid_get_pid (tp->ptid));
+ inf = find_inferior_ptid (tp->ptid);
aspace = inf->aspace;
/* Determine the end of the instruction trace. */
@@ -1699,7 +1699,7 @@ record_btrace_step_thread (struct thread_info *tp)
if (replay == NULL)
replay = record_btrace_start_replaying (tp);
- inf = find_inferior_pid (ptid_get_pid (tp->ptid));
+ inf = find_inferior_ptid (tp->ptid);
aspace = inf->aspace;
for (;;)
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 8901548..92c41ad 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -774,7 +774,7 @@ gdbsim_close_inferior (struct inferior *inf, void *arg)
Thus we need to verify the existence of an inferior using the
pid in question before setting inferior_ptid via
switch_to_thread() or mourning the inferior. */
- if (find_inferior_pid (ptid_get_pid (ptid)) != NULL)
+ if (find_inferior_ptid (ptid) != NULL)
{
switch_to_thread (ptid);
generic_mourn_inferior ();
@@ -881,7 +881,7 @@ gdbsim_resume (struct target_ops *ops,
either have multiple inferiors to resume or an error condition. */
if (sim_data)
- gdbsim_resume_inferior (find_inferior_pid (ptid_get_pid (ptid)), &rd);
+ gdbsim_resume_inferior (find_inferior_ptid (ptid), &rd);
else if (ptid_equal (ptid, minus_one_ptid))
iterate_over_inferiors (gdbsim_resume_inferior, &rd);
else
@@ -928,7 +928,7 @@ gdbsim_stop (struct target_ops *self, ptid_t ptid)
}
else
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ptid));
+ struct inferior *inf = find_inferior_ptid (ptid);
if (inf == NULL)
error (_("Can't stop pid %d. No inferior found."),
diff --git a/gdb/sol2-tdep.c b/gdb/sol2-tdep.c
index bf7d6a1..a508978 100644
--- a/gdb/sol2-tdep.c
+++ b/gdb/sol2-tdep.c
@@ -60,7 +60,7 @@ sol2_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
/* GDB didn't use to put a NT_PSTATUS note in Solaris cores. If
that's missing, then we're dealing with a fake PID corelow.c made
up. */
- inf = find_inferior_pid (ptid_get_pid (ptid));
+ inf = find_inferior_ptid (ptid);
if (inf == NULL || inf->fake_pid_p)
{
xsnprintf (buf, sizeof buf, "<core>");
diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index 8bca5b2..53c7561 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -59,14 +59,6 @@ symfile_debug_installed (struct objfile *objfile)
&& objfile_data (objfile, symfile_debug_objfile_data_key) != NULL);
}
-/* Utility to return the name to print for OBJFILE. */
-
-static const char *
-debug_objfile_name (const struct objfile *objfile)
-{
- return lbasename (objfile->original_name);
-}
-
/* Utility return the name to print for SYMTAB. */
static const char *
@@ -87,7 +79,7 @@ debug_qf_has_symbols (struct objfile *objfile)
retval = debug_data->real_sf->qf->has_symbols (objfile);
fprintf_filtered (gdb_stdlog, "qf->has_symbols (%s) = %d\n",
- debug_objfile_name (objfile), retval);
+ objfile_debug_name (objfile), retval);
return retval;
}
@@ -100,7 +92,7 @@ debug_qf_find_last_source_symtab (struct objfile *objfile)
struct symtab *retval;
fprintf_filtered (gdb_stdlog, "qf->find_last_source_symtab (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
retval = debug_data->real_sf->qf->find_last_source_symtab (objfile);
@@ -117,7 +109,7 @@ debug_qf_forget_cached_source_info (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "qf->forget_cached_source_info (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->qf->forget_cached_source_info (objfile);
}
@@ -136,7 +128,7 @@ debug_qf_map_symtabs_matching_filename (struct objfile *objfile,
fprintf_filtered (gdb_stdlog,
"qf->map_symtabs_matching_filename (%s, \"%s\", \"%s\", %s, %s)\n",
- debug_objfile_name (objfile), name,
+ objfile_debug_name (objfile), name,
real_path ? real_path : NULL,
host_address_to_string (callback),
host_address_to_string (data));
@@ -161,7 +153,7 @@ debug_qf_lookup_symbol (struct objfile *objfile, int kind, const char *name,
fprintf_filtered (gdb_stdlog,
"qf->lookup_symbol (%s, %d, \"%s\", %s)\n",
- debug_objfile_name (objfile), kind, name,
+ objfile_debug_name (objfile), kind, name,
domain_name (domain));
retval = debug_data->real_sf->qf->lookup_symbol (objfile, kind, name,
@@ -182,7 +174,7 @@ debug_qf_print_stats (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "qf->print_stats (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->qf->print_stats (objfile);
}
@@ -194,7 +186,7 @@ debug_qf_dump (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "qf->dump (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->qf->dump (objfile);
}
@@ -208,7 +200,7 @@ debug_qf_relocate (struct objfile *objfile,
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "qf->relocate (%s, %s, %s)\n",
- debug_objfile_name (objfile),
+ objfile_debug_name (objfile),
host_address_to_string (new_offsets),
host_address_to_string (delta));
@@ -224,7 +216,7 @@ debug_qf_expand_symtabs_for_function (struct objfile *objfile,
fprintf_filtered (gdb_stdlog,
"qf->expand_symtabs_for_function (%s, \"%s\")\n",
- debug_objfile_name (objfile), func_name);
+ objfile_debug_name (objfile), func_name);
debug_data->real_sf->qf->expand_symtabs_for_function (objfile, func_name);
}
@@ -236,7 +228,7 @@ debug_qf_expand_all_symtabs (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "qf->expand_all_symtabs (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->qf->expand_all_symtabs (objfile);
}
@@ -250,7 +242,7 @@ debug_qf_expand_symtabs_with_fullname (struct objfile *objfile,
fprintf_filtered (gdb_stdlog,
"qf->expand_symtabs_with_fullname (%s, \"%s\")\n",
- debug_objfile_name (objfile), fullname);
+ objfile_debug_name (objfile), fullname);
debug_data->real_sf->qf->expand_symtabs_with_fullname (objfile, fullname);
}
@@ -270,7 +262,7 @@ debug_qf_map_matching_symbols (struct objfile *objfile,
fprintf_filtered (gdb_stdlog,
"qf->map_matching_symbols (%s, \"%s\", %s, %d, %s, %s, %s, %s)\n",
- debug_objfile_name (objfile), name,
+ objfile_debug_name (objfile), name,
domain_name (namespace), global,
host_address_to_string (callback),
host_address_to_string (data),
@@ -296,7 +288,7 @@ debug_qf_expand_symtabs_matching
fprintf_filtered (gdb_stdlog,
"qf->expand_symtabs_matching (%s, %s, %s, %s, %s)\n",
- debug_objfile_name (objfile),
+ objfile_debug_name (objfile),
host_address_to_string (file_matcher),
host_address_to_string (symbol_matcher),
search_domain_name (kind),
@@ -321,7 +313,7 @@ debug_qf_find_pc_sect_compunit_symtab (struct objfile *objfile,
fprintf_filtered (gdb_stdlog,
"qf->find_pc_sect_compunit_symtab (%s, %s, %s, %s, %d)\n",
- debug_objfile_name (objfile),
+ objfile_debug_name (objfile),
host_address_to_string (msymbol.minsym),
hex_string (pc),
host_address_to_string (section),
@@ -350,7 +342,7 @@ debug_qf_map_symbol_filenames (struct objfile *objfile,
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog,
"qf->map_symbol_filenames (%s, %s, %s, %d)\n",
- debug_objfile_name (objfile),
+ objfile_debug_name (objfile),
host_address_to_string (fun),
host_address_to_string (data),
need_fullname);
@@ -391,7 +383,7 @@ debug_sym_get_probes (struct objfile *objfile)
fprintf_filtered (gdb_stdlog,
"probes->sym_get_probes (%s) = %s\n",
- debug_objfile_name (objfile),
+ objfile_debug_name (objfile),
host_address_to_string (retval));
return retval;
@@ -411,7 +403,7 @@ debug_sym_new_init (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "sf->sym_new_init (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->sym_new_init (objfile);
}
@@ -423,7 +415,7 @@ debug_sym_init (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "sf->sym_init (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->sym_init (objfile);
}
@@ -435,7 +427,7 @@ debug_sym_read (struct objfile *objfile, int symfile_flags)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "sf->sym_read (%s, 0x%x)\n",
- debug_objfile_name (objfile), symfile_flags);
+ objfile_debug_name (objfile), symfile_flags);
debug_data->real_sf->sym_read (objfile, symfile_flags);
}
@@ -447,7 +439,7 @@ debug_sym_read_psymbols (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "sf->sym_read_psymbols (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->sym_read_psymbols (objfile);
}
@@ -459,7 +451,7 @@ debug_sym_finish (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "sf->sym_finish (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->sym_finish (objfile);
}
@@ -472,7 +464,7 @@ debug_sym_offsets (struct objfile *objfile,
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "sf->sym_offsets (%s, %s)\n",
- debug_objfile_name (objfile),
+ objfile_debug_name (objfile),
host_address_to_string (info));
debug_data->real_sf->sym_offsets (objfile, info);
@@ -494,7 +486,7 @@ debug_sym_read_linetable (struct objfile *objfile)
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog, "sf->sym_read_linetable (%s)\n",
- debug_objfile_name (objfile));
+ objfile_debug_name (objfile));
debug_data->real_sf->sym_read_linetable (objfile);
}
@@ -510,7 +502,7 @@ debug_sym_relocate (struct objfile *objfile, asection *sectp, bfd_byte *buf)
fprintf_filtered (gdb_stdlog,
"sf->sym_relocate (%s, %s, %s) = %s\n",
- debug_objfile_name (objfile),
+ objfile_debug_name (objfile),
host_address_to_string (sectp),
host_address_to_string (buf),
host_address_to_string (retval));
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 1e8c230..081bc4e 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -353,12 +353,12 @@ struct sym_fns
void (*sym_finish) (struct objfile *);
+
/* This function produces a file-dependent section_offsets
- structure, allocated in the objfile's storage, and based on the
- parameter. The parameter is currently a CORE_ADDR (FIXME!) for
- backward compatibility with the higher levels of GDB. It should
- probably be changed to a string, where NULL means the default,
- and others are parsed in a file dependent way. */
+ structure, allocated in the objfile's storage.
+
+ The section_addr_info structure contains the offset of loadable and
+ allocated sections, relative to the absolute offsets found in the BFD. */
void (*sym_offsets) (struct objfile *, const struct section_addr_info *);
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 54e4be4..d64fdbd 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -105,6 +105,9 @@ struct main_info
/* When non-zero, print debugging messages related to symtab creation. */
unsigned int symtab_create_debug = 0;
+/* When non-zero, print debugging messages related to symbol lookup. */
+unsigned int symbol_lookup_debug = 0;
+
/* Non-zero if a file may be known by two different basenames.
This is the uncommon case, and significantly slows down gdb.
Default set to "off" to not slow down the common case. */
@@ -1313,6 +1316,16 @@ lookup_language_this (const struct language_defn *lang,
if (lang->la_name_of_this == NULL || block == NULL)
return NULL;
+ if (symbol_lookup_debug > 1)
+ {
+ struct objfile *objfile = lookup_objfile_from_block (block);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_language_this (%s, %s (objfile %s))",
+ lang->la_name, host_address_to_string (block),
+ objfile_debug_name (objfile));
+ }
+
while (block)
{
struct symbol *sym;
@@ -1320,6 +1333,13 @@ lookup_language_this (const struct language_defn *lang,
sym = block_lookup_symbol (block, lang->la_name_of_this, VAR_DOMAIN);
if (sym != NULL)
{
+ if (symbol_lookup_debug > 1)
+ {
+ fprintf_unfiltered (gdb_stdlog, " = %s (%s, block %s)\n",
+ SYMBOL_PRINT_NAME (sym),
+ host_address_to_string (sym),
+ host_address_to_string (block));
+ }
block_found = block;
return sym;
}
@@ -1328,6 +1348,8 @@ lookup_language_this (const struct language_defn *lang,
block = BLOCK_SUPERBLOCK (block);
}
+ if (symbol_lookup_debug > 1)
+ fprintf_unfiltered (gdb_stdlog, " = NULL\n");
return NULL;
}
@@ -1387,6 +1409,18 @@ lookup_symbol_aux (const char *name, const struct block *block,
struct symbol *sym;
const struct language_defn *langdef;
+ if (symbol_lookup_debug)
+ {
+ struct objfile *objfile = lookup_objfile_from_block (block);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_aux (%s, %s (objfile %s), %s, %s)\n",
+ name, host_address_to_string (block),
+ objfile != NULL
+ ? objfile_debug_name (objfile) : "NULL",
+ domain_name (domain), language_str (language));
+ }
+
/* Make sure we do something sensible with is_a_field_of_this, since
the callers that set this parameter to some non-null value will
certainly use it later. If we don't set it, the contents of
@@ -1399,7 +1433,14 @@ lookup_symbol_aux (const char *name, const struct block *block,
sym = lookup_local_symbol (name, block, domain, language);
if (sym != NULL)
- return sym;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, "lookup_symbol_aux (...) = %s\n",
+ host_address_to_string (sym));
+ }
+ return sym;
+ }
/* If requested to do so by the caller and if appropriate for LANGUAGE,
check to see if NAME is a field of `this'. */
@@ -1430,7 +1471,14 @@ lookup_symbol_aux (const char *name, const struct block *block,
langdef->la_name_of_this);
if (check_field (t, name, is_a_field_of_this))
- return NULL;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_aux (...) = NULL\n");
+ }
+ return NULL;
+ }
}
}
@@ -1439,12 +1487,25 @@ lookup_symbol_aux (const char *name, const struct block *block,
sym = langdef->la_lookup_symbol_nonlocal (name, block, domain);
if (sym != NULL)
- return sym;
+ {
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, "lookup_symbol_aux (...) = %s\n",
+ host_address_to_string (sym));
+ }
+ return sym;
+ }
/* Now search all static file-level symbols. Not strictly correct,
but more useful than an error. */
- return lookup_static_symbol (name, domain);
+ sym = lookup_static_symbol (name, domain);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, "lookup_symbol_aux (...) = %s\n",
+ sym != NULL ? host_address_to_string (sym) : "NULL");
+ }
+ return sym;
}
/* Check to see if the symbol is defined in BLOCK or its superiors.
@@ -1522,13 +1583,31 @@ lookup_symbol_in_block (const char *name, const struct block *block,
{
struct symbol *sym;
+ if (symbol_lookup_debug > 1)
+ {
+ struct objfile *objfile = lookup_objfile_from_block (block);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_in_block (%s, %s (objfile %s), %s)",
+ name, host_address_to_string (block),
+ objfile_debug_name (objfile),
+ domain_name (domain));
+ }
+
sym = block_lookup_symbol (block, name, domain);
if (sym)
{
+ if (symbol_lookup_debug > 1)
+ {
+ fprintf_unfiltered (gdb_stdlog, " = %s\n",
+ host_address_to_string (sym));
+ }
block_found = block;
return fixup_symbol_section (sym, NULL);
}
+ if (symbol_lookup_debug > 1)
+ fprintf_unfiltered (gdb_stdlog, " = NULL\n");
return NULL;
}
@@ -1568,6 +1647,16 @@ lookup_symbol_in_objfile_symtabs (struct objfile *objfile, int block_index,
gdb_assert (block_index == GLOBAL_BLOCK || block_index == STATIC_BLOCK);
+ if (symbol_lookup_debug > 1)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_in_objfile_symtabs (%s, %s, %s, %s)",
+ objfile_debug_name (objfile),
+ block_index == GLOBAL_BLOCK
+ ? "GLOBAL_BLOCK" : "STATIC_BLOCK",
+ name, domain_name (domain));
+ }
+
ALL_OBJFILE_COMPUNITS (objfile, cust)
{
const struct blockvector *bv;
@@ -1579,11 +1668,19 @@ lookup_symbol_in_objfile_symtabs (struct objfile *objfile, int block_index,
sym = block_lookup_symbol_primary (block, name, domain);
if (sym)
{
+ if (symbol_lookup_debug > 1)
+ {
+ fprintf_unfiltered (gdb_stdlog, " = %s (block %s)\n",
+ host_address_to_string (sym),
+ host_address_to_string (block));
+ }
block_found = block;
return fixup_symbol_section (sym, objfile);
}
}
+ if (symbol_lookup_debug > 1)
+ fprintf_unfiltered (gdb_stdlog, " = NULL\n");
return NULL;
}
@@ -1665,15 +1762,42 @@ lookup_symbol_via_quick_fns (struct objfile *objfile, int block_index,
if (!objfile->sf)
return NULL;
+
+ if (symbol_lookup_debug > 1)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_via_quick_fns (%s, %s, %s, %s)\n",
+ objfile_debug_name (objfile),
+ block_index == GLOBAL_BLOCK
+ ? "GLOBAL_BLOCK" : "STATIC_BLOCK",
+ name, domain_name (domain));
+ }
+
cust = objfile->sf->qf->lookup_symbol (objfile, block_index, name, domain);
if (cust == NULL)
- return NULL;
+ {
+ if (symbol_lookup_debug > 1)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_via_quick_fns (...) = NULL\n");
+ }
+ return NULL;
+ }
bv = COMPUNIT_BLOCKVECTOR (cust);
block = BLOCKVECTOR_BLOCK (bv, block_index);
sym = block_lookup_symbol (block, name, domain);
if (!sym)
error_in_psymtab_expansion (block_index, name, cust);
+
+ if (symbol_lookup_debug > 1)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_via_quick_fns (...) = %s (block %s)\n",
+ host_address_to_string (sym),
+ host_address_to_string (block));
+ }
+
block_found = block;
return fixup_symbol_section (sym, objfile);
}
@@ -1734,11 +1858,32 @@ lookup_symbol_in_static_block (const char *name,
const domain_enum domain)
{
const struct block *static_block = block_static_block (block);
+ struct symbol *sym;
- if (static_block != NULL)
- return lookup_symbol_in_block (name, static_block, domain);
- else
+ if (static_block == NULL)
return NULL;
+
+ if (symbol_lookup_debug)
+ {
+ struct objfile *objfile = lookup_objfile_from_block (static_block);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_in_static_block (%s, %s (objfile %s),"
+ " %s)\n",
+ name,
+ host_address_to_string (block),
+ objfile_debug_name (objfile),
+ domain_name (domain));
+ }
+
+ sym = lookup_symbol_in_block (name, static_block, domain);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_in_static_block (...) = %s\n",
+ sym != NULL ? host_address_to_string (sym) : "NULL");
+ }
+ return sym;
}
/* Perform the standard symbol lookup of NAME in OBJFILE:
@@ -1752,14 +1897,41 @@ lookup_symbol_in_objfile (struct objfile *objfile, int block_index,
{
struct symbol *result;
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_in_objfile (%s, %s, %s, %s)\n",
+ objfile_debug_name (objfile),
+ block_index == GLOBAL_BLOCK
+ ? "GLOBAL_BLOCK" : "STATIC_BLOCK",
+ name, domain_name (domain));
+ }
+
result = lookup_symbol_in_objfile_symtabs (objfile, block_index,
name, domain);
- if (result == NULL)
+ if (result != NULL)
{
- result = lookup_symbol_via_quick_fns (objfile, block_index,
- name, domain);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_in_objfile (...) = %s"
+ " (in symtabs)\n",
+ host_address_to_string (result));
+ }
+ return result;
}
+ result = lookup_symbol_via_quick_fns (objfile, block_index,
+ name, domain);
+ if (symbol_lookup_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "lookup_symbol_in_objfile (...) = %s%s\n",
+ result != NULL
+ ? host_address_to_string (result)
+ : "NULL",
+ result != NULL ? " (via quick fns)" : "");
+ }
return result;
}
@@ -3406,7 +3578,8 @@ compare_search_syms (const void *sa, const void *sb)
struct symbol_search *sym_b = *(struct symbol_search **) sb;
int c;
- c = FILENAME_CMP (sym_a->symtab->filename, sym_b->symtab->filename);
+ c = FILENAME_CMP (SYMBOL_SYMTAB (sym_a->symbol)->filename,
+ SYMBOL_SYMTAB (sym_b->symbol)->filename);
if (c != 0)
return c;
@@ -3722,7 +3895,6 @@ search_symbols (const char *regexp, enum search_domain kind,
struct symbol_search *psr = (struct symbol_search *)
xmalloc (sizeof (struct symbol_search));
psr->block = i;
- psr->symtab = real_symtab;
psr->symbol = sym;
memset (&psr->msymbol, 0, sizeof (psr->msymbol));
psr->next = NULL;
@@ -3780,7 +3952,6 @@ search_symbols (const char *regexp, enum search_domain kind,
psr->block = i;
psr->msymbol.minsym = msymbol;
psr->msymbol.objfile = objfile;
- psr->symtab = NULL;
psr->symbol = NULL;
psr->next = NULL;
if (tail == NULL)
@@ -3806,9 +3977,10 @@ search_symbols (const char *regexp, enum search_domain kind,
static void
print_symbol_info (enum search_domain kind,
- struct symtab *s, struct symbol *sym,
+ struct symbol *sym,
int block, const char *last)
{
+ struct symtab *s = SYMBOL_SYMTAB (sym);
const char *s_filename = symtab_to_filename_for_display (s);
if (last == NULL || filename_cmp (last, s_filename) != 0)
@@ -3903,11 +4075,11 @@ symtab_symbol_info (char *regexp, enum search_domain kind, int from_tty)
else
{
print_symbol_info (kind,
- p->symtab,
p->symbol,
p->block,
last_filename);
- last_filename = symtab_to_filename_for_display (p->symtab);
+ last_filename
+ = symtab_to_filename_for_display (SYMBOL_SYMTAB (p->symbol));
}
}
@@ -3993,7 +4165,8 @@ rbreak_command (char *regexp, int from_tty)
{
if (p->msymbol.minsym == NULL)
{
- const char *fullname = symtab_to_fullname (p->symtab);
+ struct symtab *symtab = SYMBOL_SYMTAB (p->symbol);
+ const char *fullname = symtab_to_fullname (symtab);
int newlen = (strlen (fullname)
+ strlen (SYMBOL_LINKAGE_NAME (p->symbol))
@@ -4010,10 +4183,9 @@ rbreak_command (char *regexp, int from_tty)
strcat (string, "'");
break_command (string, from_tty);
print_symbol_info (FUNCTIONS_DOMAIN,
- p->symtab,
p->symbol,
p->block,
- symtab_to_filename_for_display (p->symtab));
+ symtab_to_filename_for_display (symtab));
}
else
{
@@ -5252,5 +5424,13 @@ A value greater than 1 provides more verbose information."),
NULL,
&setdebuglist, &showdebuglist);
+ add_setshow_zuinteger_cmd ("symbol-lookup", no_class, &symbol_lookup_debug,
+ _("\
+Set debugging of symbol lookup."), _("\
+Show debugging of symbol lookup."), _("\
+When enabled (non-zero), symbol lookups are logged."),
+ NULL, NULL,
+ &setdebuglist, &showdebuglist);
+
observer_attach_executable_changed (symtab_observer_executable_changed);
}
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 4f90140..1446201 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1457,9 +1457,7 @@ struct symbol_search
/* Information describing what was found.
- If symtab and symbol are NOT NULL, then information was found
- for this match. */
- struct symtab *symtab;
+ If symbol is NOT NULL, then information was found for this match. */
struct symbol *symbol;
/* If msymbol is non-null, then a match was made on something for
@@ -1507,6 +1505,8 @@ struct objfile *lookup_objfile_from_block (const struct block *block);
extern unsigned int symtab_create_debug;
+extern unsigned int symbol_lookup_debug;
+
extern int basenames_may_differ;
int compare_filenames_for_search (const char *filename,
diff --git a/gdb/target.c b/gdb/target.c
index 7161e62..38c6c16 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1173,7 +1173,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
return TARGET_XFER_E_IO;
if (!ptid_equal (inferior_ptid, null_ptid))
- inf = find_inferior_pid (ptid_get_pid (inferior_ptid));
+ inf = find_inferior_ptid (inferior_ptid);
else
inf = NULL;
@@ -2649,7 +2649,7 @@ default_thread_address_space (struct target_ops *self, ptid_t ptid)
struct inferior *inf;
/* Fall-back to the "main" address space of the inferior. */
- inf = find_inferior_pid (ptid_get_pid (ptid));
+ inf = find_inferior_ptid (ptid);
if (inf == NULL || inf->aspace == NULL)
internal_error (__FILE__, __LINE__,
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 5e8953c..518def1 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,82 @@
+2014-12-18 Nigel Stephens <nigel@mips.com>
+ Maciej W. Rozycki <macro@codesourcery.com>
+
+ * gdb.base/float.exp: Handle the new output from "info float" on
+ MIPS targets.
+
+2014-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix MinGW compilation.
+ * gdb.compile/compile-ops.exp: Update untested message if
+ !skip_compile_feature_tests.
+ * gdb.compile/compile-setjmp.exp: Likewise.
+ * gdb.compile/compile-tls.exp: Likewise.
+ * gdb.compile/compile.exp: Likewise.
+ * lib/gdb.exp (skip_compile_feature_tests): Check also "Command not
+ supported on this host".
+
+2014-12-16 Doug Evans <xdje42@gmail.com>
+
+ * boards/stabs.exp: New file.
+
+2014-12-16 Andreas Arnez <arnez@vnet.linux.ibm.com>
+
+ * gdb.base/completion.exp: Adjust to format changes of "maint
+ print user-registers".
+
+2014-12-16 Catalin Udma <catalin.udma@freescale.com>
+
+ PR server/17457
+ * gdb.arch/aarch64-fp.c: New file.
+ * gdb.arch/aarch64-fp.exp: New file.
+
+2014-12-15 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ Merge dg-extract-results.{sh,py} from GCC upstream (r210243,
+ r210637, r210913, r211666, r215400, r215817).
+
+ 2014-05-08 Richard Sandiford <rdsandiford@googlemail.com>
+ * dg-extract-results.py: New file.
+ * dg-extract-results.sh: Use it if the environment seems
+ suitable.
+
+ 2014-05-20 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * dg-extract-results.py (parse_run): Handle warnings that
+ are printed before a test harness is run.
+
+ 2014-05-25 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * dg-extract-results.py (Named): Remove __cmp__ method.
+ (output_variation): Use a key to sort variation.harnesses.
+
+ 2014-06-14 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * dg-extract-results.py: For Python 3, force sys.stdout to
+ handle surrogate escape sequences.
+ (safe_open): New function.
+ (output_segment, main): Use it.
+
+ 2014-09-19 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * dg-extract-results.py (Prog.result_re): Include options
+ in test name.
+
+ 2014-10-02 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * dg-extract-results.py (output_variation): Always sort if
+ do_sum.
+
+2014-12-15 Simon Marchi <simon.marchi@ericsson.com>
+
+ * lib/gdb.exp (default_gdb_start): After starting gdb, loop
+ as long as we get pagination notifications.
+
+2014-12-15 Jason Merrill <jason@redhat.com>
+
+ * Makefile.in (check-gdb.%): Restore.
+ * README: Mention it.
+
2014-12-13 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/str_uninit: New testcase.
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index 1c923cd..07d3942 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -188,6 +188,10 @@ DO_RUNTEST = \
@GMAKE_TRUE@endif
@GMAKE_FALSE@expanded_tests_or_none = $(TESTS)
+# Shorthand for running all the tests in a single directory.
+@GMAKE_TRUE@check-gdb.%:
+@GMAKE_TRUE@ $(MAKE) check TESTS="gdb.$*/*.exp"
+
check-single:
$(DO_RUNTEST) $(RUNTESTFLAGS) $(expanded_tests_or_none)
diff --git a/gdb/testsuite/README b/gdb/testsuite/README
index 9a5059a..fa17781 100644
--- a/gdb/testsuite/README
+++ b/gdb/testsuite/README
@@ -160,7 +160,9 @@ list of tests to run.
If using GNU make then the contents are wildcard-expanded using
GNU make's $(wildcard) function. Test paths must be fully specified,
relative to the "testsuite" subdirectory. This allows one to run all
-tests in a subdirectory by passing "gdb.subdir/*.exp".
+tests in a subdirectory by passing "gdb.subdir/*.exp", or more simply
+by using the check-gdb.subdir target in the Makefile.
+
If for some strange reason one wanted to run all tests that begin with
the letter "d" that is also possible: TESTS="*/d*.exp".
diff --git a/gdb/testsuite/boards/stabs.exp b/gdb/testsuite/boards/stabs.exp
new file mode 100644
index 0000000..d04989a
--- /dev/null
+++ b/gdb/testsuite/boards/stabs.exp
@@ -0,0 +1,45 @@
+# Copyright 2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is a dejagnu "board file" and is used to run the testsuite
+# with stabs support. Stabs is used less and less these days, ideally
+# it will eventually disappear (hey, one can dream). Until then, this
+# board file is a simple way to run the testsuite with stabs.
+#
+# Example usage:
+# bash$ make check RUNTESTFLAGS='--target_board=stabs'
+#
+# Another way:
+# make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gstabs+"
+# While this way doesn't require a board file, this file exists because
+# it's easier for some to find.
+#
+# Note: make check RUNTESTFLAGS=CFLAGS_FOR_TARGET=-gstabs+
+# "works" but kinda accidentally. The right way to set the flag for
+# specifying debug information is with the debug_flags board config parameter.
+
+# This is copied from baseboards/unix.exp.
+# At the moment this only supports things that unix.exp supports.
+load_generic_config "unix"
+process_multilib_options ""
+set_board_info compiler "[find_gcc]"
+
+# Use -gstabs+ instead of -gstabs for better c++ support.
+set_board_info debug_flags "-gstabs+"
+
+# This is needed otherwise dejagnu tries to rsh to host "stabs". Blech.
+# Double blech: set_board_info only sets the value if not already set.
+unset_board_info isremote
+set_board_info isremote 0
diff --git a/gdb/testsuite/dg-extract-results.py b/gdb/testsuite/dg-extract-results.py
new file mode 100644
index 0000000..7db5e64
--- /dev/null
+++ b/gdb/testsuite/dg-extract-results.py
@@ -0,0 +1,585 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This script is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+
+import sys
+import getopt
+import re
+import io
+from datetime import datetime
+from operator import attrgetter
+
+# True if unrecognised lines should cause a fatal error. Might want to turn
+# this on by default later.
+strict = False
+
+# True if the order of .log segments should match the .sum file, false if
+# they should keep the original order.
+sort_logs = True
+
+# A version of open() that is safe against whatever binary output
+# might be added to the log.
+def safe_open (filename):
+ if sys.version_info >= (3, 0):
+ return open (filename, 'r', errors = 'surrogateescape')
+ return open (filename, 'r')
+
+# Force stdout to handle escape sequences from a safe_open file.
+if sys.version_info >= (3, 0):
+ sys.stdout = io.TextIOWrapper (sys.stdout.buffer,
+ errors = 'surrogateescape')
+
+class Named:
+ def __init__ (self, name):
+ self.name = name
+
+class ToolRun (Named):
+ def __init__ (self, name):
+ Named.__init__ (self, name)
+ # The variations run for this tool, mapped by --target_board name.
+ self.variations = dict()
+
+ # Return the VariationRun for variation NAME.
+ def get_variation (self, name):
+ if name not in self.variations:
+ self.variations[name] = VariationRun (name)
+ return self.variations[name]
+
+class VariationRun (Named):
+ def __init__ (self, name):
+ Named.__init__ (self, name)
+ # A segment of text before the harness runs start, describing which
+ # baseboard files were loaded for the target.
+ self.header = None
+ # The harnesses run for this variation, mapped by filename.
+ self.harnesses = dict()
+ # A list giving the number of times each type of result has
+ # been seen.
+ self.counts = []
+
+ # Return the HarnessRun for harness NAME.
+ def get_harness (self, name):
+ if name not in self.harnesses:
+ self.harnesses[name] = HarnessRun (name)
+ return self.harnesses[name]
+
+class HarnessRun (Named):
+ def __init__ (self, name):
+ Named.__init__ (self, name)
+ # Segments of text that make up the harness run, mapped by a test-based
+ # key that can be used to order them.
+ self.segments = dict()
+ # Segments of text that make up the harness run but which have
+ # no recognized test results. These are typically harnesses that
+ # are completely skipped for the target.
+ self.empty = []
+ # A list of results. Each entry is a pair in which the first element
+ # is a unique sorting key and in which the second is the full
+ # PASS/FAIL line.
+ self.results = []
+
+ # Add a segment of text to the harness run. If the segment includes
+ # test results, KEY is an example of one of them, and can be used to
+ # combine the individual segments in order. If the segment has no
+ # test results (e.g. because the harness doesn't do anything for the
+ # current configuration) then KEY is None instead. In that case
+ # just collect the segments in the order that we see them.
+ def add_segment (self, key, segment):
+ if key:
+ assert key not in self.segments
+ self.segments[key] = segment
+ else:
+ self.empty.append (segment)
+
+class Segment:
+ def __init__ (self, filename, start):
+ self.filename = filename
+ self.start = start
+ self.lines = 0
+
+class Prog:
+ def __init__ (self):
+ # The variations specified on the command line.
+ self.variations = []
+ # The variations seen in the input files.
+ self.known_variations = set()
+ # The tools specified on the command line.
+ self.tools = []
+ # Whether to create .sum rather than .log output.
+ self.do_sum = True
+ # Regexps used while parsing.
+ self.test_run_re = re.compile (r'^Test Run By (\S+) on (.*)$')
+ self.tool_re = re.compile (r'^\t\t=== (.*) tests ===$')
+ self.result_re = re.compile (r'^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED'
+ r'|WARNING|ERROR|UNSUPPORTED|UNTESTED'
+ r'|KFAIL):\s*(.+)')
+ self.completed_re = re.compile (r'.* completed at (.*)')
+ # Pieces of text to write at the head of the output.
+ # start_line is a pair in which the first element is a datetime
+ # and in which the second is the associated 'Test Run By' line.
+ self.start_line = None
+ self.native_line = ''
+ self.target_line = ''
+ self.host_line = ''
+ self.acats_premable = ''
+ # Pieces of text to write at the end of the output.
+ # end_line is like start_line but for the 'runtest completed' line.
+ self.acats_failures = []
+ self.version_output = ''
+ self.end_line = None
+ # Known summary types.
+ self.count_names = [
+ '# of expected passes\t\t',
+ '# of unexpected failures\t',
+ '# of unexpected successes\t',
+ '# of expected failures\t\t',
+ '# of unknown successes\t\t',
+ '# of known failures\t\t',
+ '# of untested testcases\t\t',
+ '# of unresolved testcases\t',
+ '# of unsupported tests\t\t'
+ ]
+ self.runs = dict()
+
+ def usage (self):
+ name = sys.argv[0]
+ sys.stderr.write ('Usage: ' + name
+ + ''' [-t tool] [-l variant-list] [-L] log-or-sum-file ...
+
+ tool The tool (e.g. g++, libffi) for which to create a
+ new test summary file. If not specified then output
+ is created for all tools.
+ variant-list One or more test variant names. If the list is
+ not specified then one is constructed from all
+ variants in the files for <tool>.
+ sum-file A test summary file with the format of those
+ created by runtest from DejaGnu.
+ If -L is used, merge *.log files instead of *.sum. In this
+ mode the exact order of lines may not be preserved, just different
+ Running *.exp chunks should be in correct order.
+''')
+ sys.exit (1)
+
+ def fatal (self, what, string):
+ if not what:
+ what = sys.argv[0]
+ sys.stderr.write (what + ': ' + string + '\n')
+ sys.exit (1)
+
+ # Parse the command-line arguments.
+ def parse_cmdline (self):
+ try:
+ (options, self.files) = getopt.getopt (sys.argv[1:], 'l:t:L')
+ if len (self.files) == 0:
+ self.usage()
+ for (option, value) in options:
+ if option == '-l':
+ self.variations.append (value)
+ elif option == '-t':
+ self.tools.append (value)
+ else:
+ self.do_sum = False
+ except getopt.GetoptError as e:
+ self.fatal (None, e.msg)
+
+ # Try to parse time string TIME, returning an arbitrary time on failure.
+ # Getting this right is just a nice-to-have so failures should be silent.
+ def parse_time (self, time):
+ try:
+ return datetime.strptime (time, '%c')
+ except ValueError:
+ return datetime.now()
+
+ # Parse an integer and abort on failure.
+ def parse_int (self, filename, value):
+ try:
+ return int (value)
+ except ValueError:
+ self.fatal (filename, 'expected an integer, got: ' + value)
+
+ # Return a list that represents no test results.
+ def zero_counts (self):
+ return [0 for x in self.count_names]
+
+ # Return the ToolRun for tool NAME.
+ def get_tool (self, name):
+ if name not in self.runs:
+ self.runs[name] = ToolRun (name)
+ return self.runs[name]
+
+ # Add the result counts in list FROMC to TOC.
+ def accumulate_counts (self, toc, fromc):
+ for i in range (len (self.count_names)):
+ toc[i] += fromc[i]
+
+ # Parse the list of variations after 'Schedule of variations:'.
+ # Return the number seen.
+ def parse_variations (self, filename, file):
+ num_variations = 0
+ while True:
+ line = file.readline()
+ if line == '':
+ self.fatal (filename, 'could not parse variation list')
+ if line == '\n':
+ break
+ self.known_variations.add (line.strip())
+ num_variations += 1
+ return num_variations
+
+ # Parse from the first line after 'Running target ...' to the end
+ # of the run's summary.
+ def parse_run (self, filename, file, tool, variation, num_variations):
+ header = None
+ harness = None
+ segment = None
+ final_using = 0
+
+ # If this is the first run for this variation, add any text before
+ # the first harness to the header.
+ if not variation.header:
+ segment = Segment (filename, file.tell())
+ variation.header = segment
+
+ # Parse up until the first line of the summary.
+ if num_variations == 1:
+ end = '\t\t=== ' + tool.name + ' Summary ===\n'
+ else:
+ end = ('\t\t=== ' + tool.name + ' Summary for '
+ + variation.name + ' ===\n')
+ while True:
+ line = file.readline()
+ if line == '':
+ self.fatal (filename, 'no recognised summary line')
+ if line == end:
+ break
+
+ # Look for the start of a new harness.
+ if line.startswith ('Running ') and line.endswith (' ...\n'):
+ # Close off the current harness segment, if any.
+ if harness:
+ segment.lines -= final_using
+ harness.add_segment (first_key, segment)
+ name = line[len ('Running '):-len(' ...\n')]
+ harness = variation.get_harness (name)
+ segment = Segment (filename, file.tell())
+ first_key = None
+ final_using = 0
+ continue
+
+ # Record test results. Associate the first test result with
+ # the harness segment, so that if a run for a particular harness
+ # has been split up, we can reassemble the individual segments
+ # in a sensible order.
+ #
+ # dejagnu sometimes issues warnings about the testing environment
+ # before running any tests. Treat them as part of the header
+ # rather than as a test result.
+ match = self.result_re.match (line)
+ if match and (harness or not line.startswith ('WARNING:')):
+ if not harness:
+ self.fatal (filename, 'saw test result before harness name')
+ name = match.group (2)
+ # Ugly hack to get the right order for gfortran.
+ if name.startswith ('gfortran.dg/g77/'):
+ name = 'h' + name
+ key = (name, len (harness.results))
+ harness.results.append ((key, line))
+ if not first_key and sort_logs:
+ first_key = key
+
+ # 'Using ...' lines are only interesting in a header. Splitting
+ # the test up into parallel runs leads to more 'Using ...' lines
+ # than there would be in a single log.
+ if line.startswith ('Using '):
+ final_using += 1
+ else:
+ final_using = 0
+
+ # Add other text to the current segment, if any.
+ if segment:
+ segment.lines += 1
+
+ # Close off the final harness segment, if any.
+ if harness:
+ segment.lines -= final_using
+ harness.add_segment (first_key, segment)
+
+ # Parse the rest of the summary (the '# of ' lines).
+ if len (variation.counts) == 0:
+ variation.counts = self.zero_counts()
+ while True:
+ before = file.tell()
+ line = file.readline()
+ if line == '':
+ break
+ if line == '\n':
+ continue
+ if not line.startswith ('# '):
+ file.seek (before)
+ break
+ found = False
+ for i in range (len (self.count_names)):
+ if line.startswith (self.count_names[i]):
+ count = line[len (self.count_names[i]):-1].strip()
+ variation.counts[i] += self.parse_int (filename, count)
+ found = True
+ break
+ if not found:
+ self.fatal (filename, 'unknown test result: ' + line[:-1])
+
+ # Parse an acats run, which uses a different format from dejagnu.
+ # We have just skipped over '=== acats configuration ==='.
+ def parse_acats_run (self, filename, file):
+ # Parse the preamble, which describes the configuration and logs
+ # the creation of support files.
+ record = (self.acats_premable == '')
+ if record:
+ self.acats_premable = '\t\t=== acats configuration ===\n'
+ while True:
+ line = file.readline()
+ if line == '':
+ self.fatal (filename, 'could not parse acats preamble')
+ if line == '\t\t=== acats tests ===\n':
+ break
+ if record:
+ self.acats_premable += line
+
+ # Parse the test results themselves, using a dummy variation name.
+ tool = self.get_tool ('acats')
+ variation = tool.get_variation ('none')
+ self.parse_run (filename, file, tool, variation, 1)
+
+ # Parse the failure list.
+ while True:
+ before = file.tell()
+ line = file.readline()
+ if line.startswith ('*** FAILURES: '):
+ self.acats_failures.append (line[len ('*** FAILURES: '):-1])
+ continue
+ file.seek (before)
+ break
+
+ # Parse the final summary at the end of a log in order to capture
+ # the version output that follows it.
+ def parse_final_summary (self, filename, file):
+ record = (self.version_output == '')
+ while True:
+ line = file.readline()
+ if line == '':
+ break
+ if line.startswith ('# of '):
+ continue
+ if record:
+ self.version_output += line
+ if line == '\n':
+ break
+
+ # Parse a .log or .sum file.
+ def parse_file (self, filename, file):
+ tool = None
+ target = None
+ num_variations = 1
+ while True:
+ line = file.readline()
+ if line == '':
+ return
+
+ # Parse the list of variations, which comes before the test
+ # runs themselves.
+ if line.startswith ('Schedule of variations:'):
+ num_variations = self.parse_variations (filename, file)
+ continue
+
+ # Parse a testsuite run for one tool/variation combination.
+ if line.startswith ('Running target '):
+ name = line[len ('Running target '):-1]
+ if not tool:
+ self.fatal (filename, 'could not parse tool name')
+ if name not in self.known_variations:
+ self.fatal (filename, 'unknown target: ' + name)
+ self.parse_run (filename, file, tool,
+ tool.get_variation (name),
+ num_variations)
+ # If there is only one variation then there is no separate
+ # summary for it. Record any following version output.
+ if num_variations == 1:
+ self.parse_final_summary (filename, file)
+ continue
+
+ # Parse the start line. In the case where several files are being
+ # parsed, pick the one with the earliest time.
+ match = self.test_run_re.match (line)
+ if match:
+ time = self.parse_time (match.group (2))
+ if not self.start_line or self.start_line[0] > time:
+ self.start_line = (time, line)
+ continue
+
+ # Parse the form used for native testing.
+ if line.startswith ('Native configuration is '):
+ self.native_line = line
+ continue
+
+ # Parse the target triplet.
+ if line.startswith ('Target is '):
+ self.target_line = line
+ continue
+
+ # Parse the host triplet.
+ if line.startswith ('Host is '):
+ self.host_line = line
+ continue
+
+ # Parse the acats premable.
+ if line == '\t\t=== acats configuration ===\n':
+ self.parse_acats_run (filename, file)
+ continue
+
+ # Parse the tool name.
+ match = self.tool_re.match (line)
+ if match:
+ tool = self.get_tool (match.group (1))
+ continue
+
+ # Skip over the final summary (which we instead create from
+ # individual runs) and parse the version output.
+ if tool and line == '\t\t=== ' + tool.name + ' Summary ===\n':
+ if file.readline() != '\n':
+ self.fatal (filename, 'expected blank line after summary')
+ self.parse_final_summary (filename, file)
+ continue
+
+ # Parse the completion line. In the case where several files
+ # are being parsed, pick the one with the latest time.
+ match = self.completed_re.match (line)
+ if match:
+ time = self.parse_time (match.group (1))
+ if not self.end_line or self.end_line[0] < time:
+ self.end_line = (time, line)
+ continue
+
+ # Sanity check to make sure that important text doesn't get
+ # dropped accidentally.
+ if strict and line.strip() != '':
+ self.fatal (filename, 'unrecognised line: ' + line[:-1])
+
+ # Output a segment of text.
+ def output_segment (self, segment):
+ with safe_open (segment.filename) as file:
+ file.seek (segment.start)
+ for i in range (segment.lines):
+ sys.stdout.write (file.readline())
+
+ # Output a summary giving the number of times each type of result has
+ # been seen.
+ def output_summary (self, tool, counts):
+ for i in range (len (self.count_names)):
+ name = self.count_names[i]
+ # dejagnu only prints result types that were seen at least once,
+ # but acats always prints a number of unexpected failures.
+ if (counts[i] > 0
+ or (tool.name == 'acats'
+ and name.startswith ('# of unexpected failures'))):
+ sys.stdout.write ('%s%d\n' % (name, counts[i]))
+
+ # Output unified .log or .sum information for a particular variation,
+ # with a summary at the end.
+ def output_variation (self, tool, variation):
+ self.output_segment (variation.header)
+ for harness in sorted (variation.harnesses.values(),
+ key = attrgetter ('name')):
+ sys.stdout.write ('Running ' + harness.name + ' ...\n')
+ if self.do_sum:
+ harness.results.sort()
+ for (key, line) in harness.results:
+ sys.stdout.write (line)
+ else:
+ # Rearrange the log segments into test order (but without
+ # rearranging text within those segments).
+ for key in sorted (harness.segments.keys()):
+ self.output_segment (harness.segments[key])
+ for segment in harness.empty:
+ self.output_segment (segment)
+ if len (self.variations) > 1:
+ sys.stdout.write ('\t\t=== ' + tool.name + ' Summary for '
+ + variation.name + ' ===\n\n')
+ self.output_summary (tool, variation.counts)
+
+ # Output unified .log or .sum information for a particular tool,
+ # with a summary at the end.
+ def output_tool (self, tool):
+ counts = self.zero_counts()
+ if tool.name == 'acats':
+ # acats doesn't use variations, so just output everything.
+ # It also has a different approach to whitespace.
+ sys.stdout.write ('\t\t=== ' + tool.name + ' tests ===\n')
+ for variation in tool.variations.values():
+ self.output_variation (tool, variation)
+ self.accumulate_counts (counts, variation.counts)
+ sys.stdout.write ('\t\t=== ' + tool.name + ' Summary ===\n')
+ else:
+ # Output the results in the usual dejagnu runtest format.
+ sys.stdout.write ('\n\t\t=== ' + tool.name + ' tests ===\n\n'
+ 'Schedule of variations:\n')
+ for name in self.variations:
+ if name in tool.variations:
+ sys.stdout.write (' ' + name + '\n')
+ sys.stdout.write ('\n')
+ for name in self.variations:
+ if name in tool.variations:
+ variation = tool.variations[name]
+ sys.stdout.write ('Running target '
+ + variation.name + '\n')
+ self.output_variation (tool, variation)
+ self.accumulate_counts (counts, variation.counts)
+ sys.stdout.write ('\n\t\t=== ' + tool.name + ' Summary ===\n\n')
+ self.output_summary (tool, counts)
+
+ def main (self):
+ self.parse_cmdline()
+ try:
+ # Parse the input files.
+ for filename in self.files:
+ with safe_open (filename) as file:
+ self.parse_file (filename, file)
+
+ # Decide what to output.
+ if len (self.variations) == 0:
+ self.variations = sorted (self.known_variations)
+ else:
+ for name in self.variations:
+ if name not in self.known_variations:
+ self.fatal (None, 'no results for ' + name)
+ if len (self.tools) == 0:
+ self.tools = sorted (self.runs.keys())
+
+ # Output the header.
+ if self.start_line:
+ sys.stdout.write (self.start_line[1])
+ sys.stdout.write (self.native_line)
+ sys.stdout.write (self.target_line)
+ sys.stdout.write (self.host_line)
+ sys.stdout.write (self.acats_premable)
+
+ # Output the main body.
+ for name in self.tools:
+ if name not in self.runs:
+ self.fatal (None, 'no results for ' + name)
+ self.output_tool (self.runs[name])
+
+ # Output the footer.
+ if len (self.acats_failures) > 0:
+ sys.stdout.write ('*** FAILURES: '
+ + ' '.join (self.acats_failures) + '\n')
+ sys.stdout.write (self.version_output)
+ if self.end_line:
+ sys.stdout.write (self.end_line[1])
+ except IOError as e:
+ self.fatal (e.filename, e.strerror)
+
+Prog().main()
diff --git a/gdb/testsuite/dg-extract-results.sh b/gdb/testsuite/dg-extract-results.sh
index 42190ae..e85fb37 100755
--- a/gdb/testsuite/dg-extract-results.sh
+++ b/gdb/testsuite/dg-extract-results.sh
@@ -26,6 +26,15 @@
PROGNAME=dg-extract-results.sh
+# Try to use the python version if possible, since it tends to be faster.
+PYTHON_VER=`echo "$0" | sed 's/sh$/py/'`
+if test "$PYTHON_VER" != "$0" &&
+ test -f "$PYTHON_VER" &&
+ python -c 'import sys; sys.exit (0 if sys.version_info >= (2, 6) else 1)' \
+ > /dev/null 2> /dev/null; then
+ exec python $PYTHON_VER "$@"
+fi
+
usage() {
cat <<EOF >&2
Usage: $PROGNAME [-t tool] [-l variant-list] [-L] sum-file ...
diff --git a/gdb/testsuite/gdb.arch/aarch64-fp.c b/gdb/testsuite/gdb.arch/aarch64-fp.c
new file mode 100644
index 0000000..c52647d
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/aarch64-fp.c
@@ -0,0 +1,38 @@
+/* This file is part of GDB, the GNU debugger.
+
+ Copyright 2008-2014 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+int
+main (void)
+{
+ char buf0[] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f};
+ char buf1[] = {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f};
+ long val;
+ void *addr;
+
+ addr = &buf0[0];
+ __asm __volatile ("ldr %x0, [%1]" : "=r" (val) : "r" (&addr));
+ __asm __volatile ("ldr q0, [x0]");
+
+ addr = &buf1[0];
+ __asm __volatile ("ldr %x0, [%1]" : "=r" (val) : "r" (&addr));
+ __asm __volatile ("ldr q1, [x0]");
+
+ return 1;
+}
+
diff --git a/gdb/testsuite/gdb.arch/aarch64-fp.exp b/gdb/testsuite/gdb.arch/aarch64-fp.exp
new file mode 100644
index 0000000..c9785a9
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/aarch64-fp.exp
@@ -0,0 +1,85 @@
+# Copyright 2008-2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# This file is part of the gdb testsuite.
+
+# PR server/17457
+# Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr
+
+if {![istarget "aarch64*"]} {
+ verbose "Skipping ${gdb_test_file_name}."
+ return
+}
+
+standard_testfile
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
+ return -1
+}
+
+if ![runto_main] {
+ untested "could not run to main"
+ return -1
+}
+
+set endianness "little"
+set test "show endian"
+gdb_test_multiple $test $test {
+ -re "(.* )(big|little)( endian.*)$gdb_prompt $" {
+ set endianness $expect_out(2,string)
+ pass "endianness"
+ }
+}
+
+gdb_test "break ${srcfile}:[gdb_get_line_number "return"]" \
+ "Breakpoint $decimal at 0x\[0-9a-fA-F\]+: file .*${srcfile}.*\\\." \
+ "set the breakpoint after setting the fp registers"
+
+gdb_test "continue" \
+ "Continuing.*Breakpoint $decimal.*" \
+ "continue until breakpoint"
+
+if {$endianness == "little"} {
+ set reg_value0 "0x1f1e1d1c1b1a19181716151413121110"
+ set reg_value1 "0x2f2e2d2c2b2a29282726252423222120"
+} else {
+ set reg_value0 "0x101112131415161718191a1b1c1d1e1f"
+ set reg_value1 "0x202122232425262728292a2b2c2d2e2f"
+}
+
+gdb_test "info registers q0" \
+ "q0.*{u = $reg_value0, s = $reg_value0.*" \
+ "check register q0 value"
+
+gdb_test "info registers q1" \
+ "q1.*{u = $reg_value1, s = $reg_value1.*" \
+ "check register q1 value"
+
+gdb_test "info registers v0" \
+ "v0.*$reg_value0}}}" \
+ "check register v0 value"
+
+gdb_test "info registers v1" \
+ "v1.*$reg_value1}}}" \
+ "check register v1 value"
+
+gdb_test "info registers fpsr" \
+ "fpsr.*0x\[0-9a-fA-F\].*" \
+ "check register fpsr value"
+
+gdb_test "info registers fpcr" \
+ "fpcr.*0x\[0-9a-fA-F\].*" \
+ "check register fpcr value"
+
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 08e1a52..9c79a29 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -145,17 +145,14 @@ set regs_output [capture_command_output "mt print registers" \
append regs_output "\n"
append regs_output [capture_command_output "mt print reggroups" \
".*Group.*Type\[^\n]*\n"]
+append regs_output "\n"
+append regs_output [capture_command_output "mt print user-registers" \
+ ".*Name.*Nr\[^\n]*\n"]
set all_regs {}
foreach {- reg} [regexp -all -inline -line {^\s+(\w+)} $regs_output] {
lappend all_regs $reg
}
-set regs_output [capture_command_output "mt print user-registers" \
- ".*Nr.*Name\[^\n]*\n"]
-foreach {- reg} [regexp -all -inline -line {^\s+\d+\s+(\w+)} $regs_output] {
- lappend all_regs $reg
-}
-
set all_regs [join [lsort -unique $all_regs]]
# ... and then compare them to the completion of "info registers".
diff --git a/gdb/testsuite/gdb.base/float.exp b/gdb/testsuite/gdb.base/float.exp
index 5da9630..fbbd682 100644
--- a/gdb/testsuite/gdb.base/float.exp
+++ b/gdb/testsuite/gdb.base/float.exp
@@ -68,7 +68,14 @@ if { [istarget "aarch64*-*-*"] } then {
}
}
} elseif [istarget "mips*-*-*"] then {
- gdb_test "info float" "f0:.*flt:.*dbl:.*" "info float"
+ gdb_test_multiple "info float" "info float" {
+ -re "fpu type: none / unused\r\n$gdb_prompt $" {
+ pass "info float (without FPU)"
+ }
+ -re "fpu type:.*cause.*mask.*flags.*round.*flush.*f0:.*flt:.*dbl:.*$gdb_prompt $" {
+ pass "info float (with FPU)"
+ }
+ }
} elseif [istarget "powerpc*-*-*"] then {
gdb_test_multiple "info float" "info_float" {
-re "f0.*f1.*f31.*fpscr.*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.compile/compile-ops.exp b/gdb/testsuite/gdb.compile/compile-ops.exp
index c295836..4fc950f 100644
--- a/gdb/testsuite/gdb.compile/compile-ops.exp
+++ b/gdb/testsuite/gdb.compile/compile-ops.exp
@@ -411,7 +411,7 @@ if ![runto func] {
}
if {[skip_compile_feature_tests]} {
- untested "could not find libcc1 shared library"
+ untested "compile command not supported (could not find libcc1 shared library?)"
return -1
}
diff --git a/gdb/testsuite/gdb.compile/compile-setjmp.exp b/gdb/testsuite/gdb.compile/compile-setjmp.exp
index 557c1f0..8f876e2 100644
--- a/gdb/testsuite/gdb.compile/compile-setjmp.exp
+++ b/gdb/testsuite/gdb.compile/compile-setjmp.exp
@@ -24,7 +24,7 @@ if ![runto_main] {
}
if {[skip_compile_feature_tests]} {
- untested "could not find libcc1 shared library"
+ untested "compile command not supported (could not find libcc1 shared library?)"
return -1
}
diff --git a/gdb/testsuite/gdb.compile/compile-tls.exp b/gdb/testsuite/gdb.compile/compile-tls.exp
index e9613f5..d95a351 100644
--- a/gdb/testsuite/gdb.compile/compile-tls.exp
+++ b/gdb/testsuite/gdb.compile/compile-tls.exp
@@ -27,7 +27,7 @@ if ![runto_main] then {
}
if {[skip_compile_feature_tests]} {
- untested "could not find libcc1 shared library"
+ untested "compile command not supported (could not find libcc1 shared library?)"
return -1
}
diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
index d0dd791..040b727 100644
--- a/gdb/testsuite/gdb.compile/compile.exp
+++ b/gdb/testsuite/gdb.compile/compile.exp
@@ -57,7 +57,7 @@ if ![runto_main] {
}
if {[skip_compile_feature_tests]} {
- untested "could not find libcc1 shared library"
+ untested "compile command not supported (could not find libcc1 shared library?)"
return -1
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6a13d1e..08087f2 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1451,7 +1451,7 @@ proc default_gdb_spawn { } {
# Default gdb_start procedure.
proc default_gdb_start { } {
- global gdb_prompt
+ global gdb_prompt pagination_prompt
global gdb_spawn_id
if [info exists gdb_spawn_id] {
@@ -1466,20 +1466,29 @@ proc default_gdb_start { } {
# When running over NFS, particularly if running many simultaneous
# tests on different hosts all using the same server, things can
# get really slow. Give gdb at least 3 minutes to start up.
- gdb_expect 360 {
- -re "\[\r\n\]$gdb_prompt $" {
- verbose "GDB initialized."
- }
- -re "$gdb_prompt $" {
- perror "GDB never initialized."
- unset gdb_spawn_id
- return -1
- }
- timeout {
- perror "(timeout) GDB never initialized after 10 seconds."
- remote_close host
- unset gdb_spawn_id
- return -1
+ set loop_again 1
+ while { $loop_again } {
+ set loop_again 0
+ gdb_expect 360 {
+ -re "$pagination_prompt" {
+ verbose "Hit pagination during startup. Pressing enter to continue."
+ send_gdb "\n"
+ set loop_again 1
+ }
+ -re "\[\r\n\]$gdb_prompt $" {
+ verbose "GDB initialized."
+ }
+ -re "$gdb_prompt $" {
+ perror "GDB never initialized."
+ unset gdb_spawn_id
+ return -1
+ }
+ timeout {
+ perror "(timeout) GDB never initialized after 10 seconds."
+ remote_close host
+ unset gdb_spawn_id
+ return -1
+ }
}
}
@@ -2529,6 +2538,9 @@ proc skip_compile_feature_tests {} {
"Could not load libcc1.*\r\n$gdb_prompt $" {
set result 1
}
+ -re "Command not supported on this host\\..*\r\n$gdb_prompt $" {
+ set result 1
+ }
-re "\r\n$gdb_prompt $" {
}
}
diff --git a/gdb/thread.c b/gdb/thread.c
index a3040a7..782fc70 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -747,7 +747,7 @@ thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid)
/* It can happen that what we knew as the target inferior id
changes. E.g, target remote may only discover the remote process
pid after adding the inferior to GDB's list. */
- inf = find_inferior_pid (ptid_get_pid (old_ptid));
+ inf = find_inferior_ptid (old_ptid);
inf->pid = ptid_get_pid (new_ptid);
tp = find_thread_ptid (old_ptid);
@@ -1179,7 +1179,7 @@ switch_to_thread (ptid_t ptid)
{
struct inferior *inf;
- inf = find_inferior_pid (ptid_get_pid (ptid));
+ inf = find_inferior_ptid (ptid);
gdb_assert (inf != NULL);
set_current_program_space (inf->pspace);
set_current_inferior (inf);
@@ -1290,7 +1290,7 @@ do_restore_current_thread_cleanup (void *arg)
then don't revert back to it, but instead simply drop back to no
thread selected. */
if (tp
- && find_inferior_pid (ptid_get_pid (tp->ptid)) != NULL)
+ && find_inferior_ptid (tp->ptid) != NULL)
restore_current_thread (old->inferior_ptid);
else
{
diff --git a/gdb/top.c b/gdb/top.c
index 83d858a..7f38562 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -215,7 +215,7 @@ void (*deprecated_warning_hook) (const char *, va_list);
window and it can close it. */
void (*deprecated_readline_begin_hook) (char *, ...);
-char *(*deprecated_readline_hook) (char *);
+char *(*deprecated_readline_hook) (const char *);
void (*deprecated_readline_end_hook) (void);
/* Called as appropriate to notify the interface that we have attached
@@ -620,7 +620,7 @@ prevent_dont_repeat (void)
A NULL return means end of file. */
char *
-gdb_readline (char *prompt_arg)
+gdb_readline (const char *prompt_arg)
{
int c;
char *result;
@@ -812,7 +812,7 @@ gdb_readline_wrapper_cleanup (void *arg)
}
char *
-gdb_readline_wrapper (char *prompt)
+gdb_readline_wrapper (const char *prompt)
{
struct cleanup *back_to;
struct gdb_readline_wrapper_cleanup *cleanup;
@@ -912,14 +912,14 @@ gdb_rl_operate_and_get_next (int count, int key)
simple input as the user has requested. */
char *
-command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
+command_line_input (const char *prompt_arg, int repeat, char *annotation_suffix)
{
static char *linebuffer = 0;
static unsigned linelength = 0;
+ const char *prompt = prompt_arg;
char *p;
char *p1;
char *rl;
- char *local_prompt = prompt_arg;
char *nline;
char got_eof = 0;
@@ -929,15 +929,19 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
if (annotation_level > 1 && instream == stdin)
{
- local_prompt = alloca ((prompt_arg == NULL ? 0 : strlen (prompt_arg))
+ char *local_prompt;
+
+ local_prompt = alloca ((prompt == NULL ? 0 : strlen (prompt))
+ strlen (annotation_suffix) + 40);
- if (prompt_arg == NULL)
+ if (prompt == NULL)
local_prompt[0] = '\0';
else
- strcpy (local_prompt, prompt_arg);
+ strcpy (local_prompt, prompt);
strcat (local_prompt, "\n\032\032");
strcat (local_prompt, annotation_suffix);
strcat (local_prompt, "\n");
+
+ prompt = local_prompt;
}
if (linebuffer == 0)
@@ -979,15 +983,15 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
/* Don't use fancy stuff if not talking to stdin. */
if (deprecated_readline_hook && input_from_terminal_p ())
{
- rl = (*deprecated_readline_hook) (local_prompt);
+ rl = (*deprecated_readline_hook) (prompt);
}
else if (command_editing_p && input_from_terminal_p ())
{
- rl = gdb_readline_wrapper (local_prompt);
+ rl = gdb_readline_wrapper (prompt);
}
else
{
- rl = gdb_readline (local_prompt);
+ rl = gdb_readline (prompt);
}
if (annotation_level > 1 && instream == stdin)
@@ -1021,7 +1025,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
break;
p--; /* Put on top of '\'. */
- local_prompt = (char *) 0;
+ prompt = NULL;
}
#ifdef STOP_SIGNAL
@@ -1064,7 +1068,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
if (expanded < 0)
{
xfree (history_value);
- return command_line_input (prompt_arg, repeat,
+ return command_line_input (prompt, repeat,
annotation_suffix);
}
if (strlen (history_value) > linelength)
diff --git a/gdb/user-regs.c b/gdb/user-regs.c
index adaa959..6cdea16 100644
--- a/gdb/user-regs.c
+++ b/gdb/user-regs.c
@@ -229,9 +229,9 @@ maintenance_print_user_registers (char *args, int from_tty)
regs = gdbarch_data (gdbarch, user_regs_data);
regnum = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
- fprintf_unfiltered (gdb_stdout, " Nr Name\n");
+ fprintf_unfiltered (gdb_stdout, " %-11s %3s\n", "Name", "Nr");
for (reg = regs->first; reg != NULL; reg = reg->next, ++regnum)
- fprintf_unfiltered (gdb_stdout, "%3d %s\n", regnum, reg->name);
+ fprintf_unfiltered (gdb_stdout, " %-11s %3d\n", reg->name, regnum);
}
extern initialize_file_ftype _initialize_user_regs; /* -Wmissing-prototypes */
diff --git a/gdb/valops.c b/gdb/valops.c
index 4d3059e..2f81a59f 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3570,15 +3570,6 @@ value_maybe_namespace_elt (const struct type *curtype,
get_selected_block (0), VAR_DOMAIN);
if (sym == NULL)
- {
- char *concatenated_name = alloca (strlen (namespace_name) + 2
- + strlen (name) + 1);
-
- sprintf (concatenated_name, "%s::%s", namespace_name, name);
- sym = lookup_static_symbol (concatenated_name, VAR_DOMAIN);
- }
-
- if (sym == NULL)
return NULL;
else if ((noside == EVAL_AVOID_SIDE_EFFECTS)
&& (SYMBOL_CLASS (sym) == LOC_TYPEDEF))
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 8f56043..9edf043 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,12 @@
+2014-12-16 Cary Coutant <ccoutant@google.com>
+
+ * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
+ (Mapfile::print_output_data): Use current_data_size() to avoid
+ assert for sections requiring postprocessing; if address is not valid,
+ print 0.
+ (Mapfile::print_output_section): Use current_data_size(); print note
+ that addresses and sizes are before compression.
+
2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
* aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
diff --git a/gold/mapfile.cc b/gold/mapfile.cc
index dc995e9..c6d7ed2 100644
--- a/gold/mapfile.cc
+++ b/gold/mapfile.cc
@@ -258,8 +258,11 @@ Mapfile::print_input_section(Relobj* relobj, unsigned int shndx)
}
char sizebuf[50];
+ section_size_type size;
+ if (!relobj->section_is_compressed(shndx, &size))
+ size = relobj->section_size(shndx);
snprintf(sizebuf, sizeof sizebuf, "0x%llx",
- static_cast<unsigned long long>(relobj->section_size(shndx)));
+ static_cast<unsigned long long>(size));
fprintf(this->map_file_, "0x%0*llx %10s %s\n",
parameters->target().get_size() / 4,
@@ -328,11 +331,13 @@ Mapfile::print_output_data(const Output_data* od, const char* name)
char sizebuf[50];
snprintf(sizebuf, sizeof sizebuf, "0x%llx",
- static_cast<unsigned long long>(od->data_size()));
+ static_cast<unsigned long long>(od->current_data_size()));
fprintf(this->map_file_, "0x%0*llx %10s\n",
parameters->target().get_size() / 4,
- static_cast<unsigned long long>(od->address()),
+ (od->is_address_valid()
+ ? static_cast<unsigned long long>(od->address())
+ : 0),
sizebuf);
}
@@ -387,7 +392,7 @@ Mapfile::print_output_section(const Output_section* os)
char sizebuf[50];
snprintf(sizebuf, sizeof sizebuf, "0x%llx",
- static_cast<unsigned long long>(os->data_size()));
+ static_cast<unsigned long long>(os->current_data_size()));
fprintf(this->map_file_, "0x%0*llx %10s",
parameters->target().get_size() / 4,
@@ -398,6 +403,9 @@ Mapfile::print_output_section(const Output_section* os)
parameters->target().get_size() / 4,
static_cast<unsigned long long>(os->load_address()));
+ if (os->requires_postprocessing())
+ fprintf(this->map_file_, " (before compression)");
+
putc('\n', this->map_file_);
}
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 76fdf19..9fc98c6 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-16 Matthew Fortune <matthew.fortune@imgtec.com>
+
+ * mips-opc.c (mips_builtin_opcodes): Add JALRC alias for
+ JIALC. Remove the operand from NAL.
+
2014-12-12 Anthony Green <green@moxielogic.com>
* moxie-opc.c: Define zex instructions.
diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
index 6e0299e..c4f67ad 100644
--- a/opcodes/mips-opc.c
+++ b/opcodes/mips-opc.c
@@ -430,7 +430,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
{"move", "d,s", 0x00000025, 0xfc1f07ff, WR_1|RD_2, INSN2_ALIAS, I1, 0, 0 },/* or */
{"b", "p", 0x10000000, 0xffff0000, UBD, INSN2_ALIAS, I1, 0, 0 },/* beq 0,0 */
{"b", "p", 0x04010000, 0xffff0000, UBD, INSN2_ALIAS, I1, 0, 0 },/* bgez 0 */
-{"nal", "p", 0x04100000, 0xffff0000, WR_31|CBD, INSN2_ALIAS, I1, 0, 0 },/* bltzal 0 */
+{"nal", "", 0x04100000, 0xffffffff, WR_31|CBD, INSN2_ALIAS, I1, 0, 0 },/* bltzal 0 */
{"bal", "p", 0x04110000, 0xffff0000, WR_31|UBD, INSN2_ALIAS, I1, 0, 0 },/* bgezal 0*/
{"bc", "+'", 0xc8000000, 0xfc000000, NODS, 0, I37, 0, 0 },
{"balc", "+'", 0xe8000000, 0xfc000000, WR_31|NODS, 0, I37, 0, 0 },
@@ -3254,6 +3254,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
{"jic", "t,j", 0xd8000000, 0xffe00000, RD_1|NODS, 0, I37, 0, 0 },
{"bnezc", "-s,+\"", 0xf8000000, 0xfc000000, RD_1|NODS, FS, I37, 0, 0 },
+{"jalrc", "t", 0xf8000000, 0xffe0ffff, RD_1|NODS, 0, I37, 0, 0 },
{"jialc", "t,j", 0xf8000000, 0xffe00000, RD_1|NODS, 0, I37, 0, 0 },
{"cmp.af.s", "D,S,T", 0x46800000, 0xffe0003f, WR_1|RD_2|RD_3|FP_S, 0, I37, 0, 0 },