Rebase to pre-7.9 snapshot 7.8.50.20150108.

- Fix jit-reader.h for multi-lib.
This commit is contained in:
Jan Kratochvil 2015-01-08 21:53:17 +01:00
parent 1445be5574
commit 2f7f533ae7
39 changed files with 2236 additions and 3921 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/gdb-libstdc++-v3-python-r155978.tar.bz2
/gdb-7.8.1.20141228.tar.xz
/gdb-7.8.50.20150108.tar.xz

View File

@ -1,29 +1,10 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231832
Index: gdb-7.5.50.20130118/gdb/symmisc.c
Index: gdb-7.8.50.20141228/include/obstack.h
===================================================================
--- gdb-7.5.50.20130118.orig/gdb/symmisc.c 2013-01-18 23:54:57.478974289 +0100
+++ gdb-7.5.50.20130118/gdb/symmisc.c 2013-01-18 23:55:41.650930254 +0100
@@ -148,10 +148,10 @@ print_objfile_statistics (void)
if (OBJSTAT (objfile, sz_strtab) > 0)
printf_filtered (_(" Space used by a.out string tables: %d\n"),
OBJSTAT (objfile, sz_strtab));
- printf_filtered (_(" Total memory used for objfile obstack: %d\n"),
- obstack_memory_used (&objfile->objfile_obstack));
- printf_filtered (_(" Total memory used for BFD obstack: %d\n"),
- obstack_memory_used (&objfile->per_bfd->storage_obstack));
+ printf_filtered (_(" Total memory used for objfile obstack: %ld\n"),
+ (long) obstack_memory_used (&objfile->objfile_obstack));
+ printf_filtered (_(" Total memory used for BFD obstack: %ld\n"),
+ (long) obstack_memory_used (&objfile->per_bfd->storage_obstack));
printf_filtered (_(" Total memory used for psymbol cache: %d\n"),
bcache_memory_used (psymbol_bcache_get_bcache
(objfile->psymbol_cache)));
Index: gdb-7.5.50.20130118/include/obstack.h
===================================================================
--- gdb-7.5.50.20130118.orig/include/obstack.h 2013-01-18 23:54:57.478974289 +0100
+++ gdb-7.5.50.20130118/include/obstack.h 2013-01-18 23:55:10.256999188 +0100
--- gdb-7.8.50.20141228.orig/include/obstack.h 2015-01-01 17:02:53.254820447 +0100
+++ gdb-7.8.50.20141228/include/obstack.h 2015-01-01 17:02:53.880820084 +0100
@@ -188,31 +188,31 @@ struct obstack /* control current objec
/* Declare the external functions we use; they are in obstack.c. */
@ -129,10 +110,10 @@ Index: gdb-7.5.50.20130118/include/obstack.h
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
obstack_blank_fast (__o, __len); \
Index: gdb-7.5.50.20130118/libiberty/obstack.c
Index: gdb-7.8.50.20141228/libiberty/obstack.c
===================================================================
--- gdb-7.5.50.20130118.orig/libiberty/obstack.c 2013-01-18 23:54:57.478974289 +0100
+++ gdb-7.5.50.20130118/libiberty/obstack.c 2013-01-18 23:55:10.256999188 +0100
--- gdb-7.8.50.20141228.orig/libiberty/obstack.c 2015-01-01 17:02:53.254820447 +0100
+++ gdb-7.8.50.20141228/libiberty/obstack.c 2015-01-01 17:02:53.880820084 +0100
@@ -44,9 +44,11 @@
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <gnu-versions.h>

View File

@ -11,11 +11,11 @@
* gdb.texinfo (File Options): Document --readnever.
Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo
Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/doc/gdb.texinfo 2014-01-27 22:42:53.150573603 +0100
+++ gdb-7.6.90.20140127/gdb/doc/gdb.texinfo 2014-01-27 22:42:56.694576319 +0100
@@ -1031,6 +1031,12 @@ Read each symbol file's entire symbol ta
--- gdb-7.8.50.20141228.orig/gdb/doc/gdb.texinfo 2015-01-01 17:01:08.308881292 +0100
+++ gdb-7.8.50.20141228/gdb/doc/gdb.texinfo 2015-01-01 17:01:10.302880126 +0100
@@ -1032,6 +1032,12 @@ Read each symbol file's entire symbol ta
the default, which is to read it incrementally as it is needed.
This makes startup slower, but makes future operations faster.
@ -28,11 +28,11 @@ Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo
@end table
@node Mode Options
Index: gdb-7.6.90.20140127/gdb/main.c
Index: gdb-7.8.50.20141228/gdb/main.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/main.c 2014-01-27 22:42:53.153573606 +0100
+++ gdb-7.6.90.20140127/gdb/main.c 2014-01-27 22:42:56.695576319 +0100
@@ -473,6 +473,7 @@ captured_main (void *data)
--- gdb-7.8.50.20141228.orig/gdb/main.c 2015-01-01 17:01:08.312881290 +0100
+++ gdb-7.8.50.20141228/gdb/main.c 2015-01-01 17:01:10.303880125 +0100
@@ -590,6 +590,7 @@ captured_main (void *data)
{"xdb", no_argument, &xdb_commands, 1},
{"dbx", no_argument, &dbx_commands, 1},
{"readnow", no_argument, &readnow_symbol_files, 1},
@ -40,7 +40,7 @@ Index: gdb-7.6.90.20140127/gdb/main.c
{"r", no_argument, &readnow_symbol_files, 1},
{"quiet", no_argument, &quiet, 1},
{"q", no_argument, &quiet, 1},
@@ -1164,6 +1165,7 @@ Selection of debuggee and its files:\n\n
@@ -1245,6 +1246,7 @@ Selection of debuggee and its files:\n\n
--se=FILE Use FILE as symbol file and executable file.\n\
--symbols=SYMFILE Read symbols from SYMFILE.\n\
--readnow Fully read symbol files on first access.\n\
@ -48,11 +48,11 @@ Index: gdb-7.6.90.20140127/gdb/main.c
--write Set writing into executable and core files.\n\n\
"), stream);
fputs_unfiltered (_("\
Index: gdb-7.6.90.20140127/gdb/symfile.c
Index: gdb-7.8.50.20141228/gdb/symfile.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/symfile.c 2014-01-27 22:42:53.154573607 +0100
+++ gdb-7.6.90.20140127/gdb/symfile.c 2014-01-27 22:42:56.696576320 +0100
@@ -82,6 +82,7 @@ static void clear_symtab_users_cleanup (
--- gdb-7.8.50.20141228.orig/gdb/symfile.c 2015-01-01 17:01:08.313881289 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.c 2015-01-01 17:01:10.304880125 +0100
@@ -80,6 +80,7 @@ static void clear_symtab_users_cleanup (
/* Global variables owned by this file. */
int readnow_symbol_files; /* Read full symbols immediately. */
@ -60,19 +60,19 @@ Index: gdb-7.6.90.20140127/gdb/symfile.c
/* Functions this file defines. */
Index: gdb-7.6.90.20140127/gdb/dwarf2read.c
Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/dwarf2read.c 2014-01-27 22:42:56.700576323 +0100
+++ gdb-7.6.90.20140127/gdb/dwarf2read.c 2014-01-27 22:44:21.915641560 +0100
@@ -70,6 +70,7 @@
--- gdb-7.8.50.20141228.orig/gdb/dwarf2read.c 2015-01-01 17:01:08.319881285 +0100
+++ gdb-7.8.50.20141228/gdb/dwarf2read.c 2015-01-01 17:01:26.888870511 +0100
@@ -69,6 +69,7 @@
#include "source.h"
#include "filestuff.h"
#include "build-id.h"
+#include "top.h"
#include <fcntl.h>
#include <string.h>
@@ -1975,7 +1976,8 @@ dwarf2_has_info (struct objfile *objfile
#include <sys/types.h>
@@ -1989,7 +1990,8 @@ dwarf2_has_info (struct objfile *objfile
(void *) names);
dwarf2_per_objfile->objfile = objfile;
}
@ -82,11 +82,11 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2read.c
&& dwarf2_per_objfile->info.s.asection != NULL
&& !dwarf2_per_objfile->abbrev.is_virtual
&& dwarf2_per_objfile->abbrev.s.asection != NULL);
Index: gdb-7.6.90.20140127/gdb/top.h
Index: gdb-7.8.50.20141228/gdb/top.h
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/top.h 2014-01-27 22:42:53.159573610 +0100
+++ gdb-7.6.90.20140127/gdb/top.h 2014-01-27 22:42:56.701576324 +0100
@@ -59,6 +59,7 @@ extern void set_prompt (const char *s);
--- gdb-7.8.50.20141228.orig/gdb/top.h 2015-01-01 17:01:08.320881284 +0100
+++ gdb-7.8.50.20141228/gdb/top.h 2015-01-01 17:01:10.310880121 +0100
@@ -67,6 +67,7 @@ extern void set_prompt (const char *s);
/* From random places. */
extern int readnow_symbol_files;

View File

@ -1,8 +1,8 @@
Index: gdb-7.7.50.20140609/gdb/testsuite/configure.ac
Index: gdb-7.8.50.20141228/gdb/testsuite/configure.ac
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/configure.ac 2014-06-13 20:05:33.058506817 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/configure.ac 2014-06-13 20:05:59.991532595 +0200
@@ -97,6 +97,6 @@ AC_OUTPUT([Makefile \
--- gdb-7.8.50.20141228.orig/gdb/testsuite/configure.ac 2015-01-01 17:00:26.123908948 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/configure.ac 2015-01-01 17:00:43.168897773 +0100
@@ -106,6 +106,6 @@ AC_OUTPUT([Makefile \
gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile \
gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile \
gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \
@ -10,20 +10,20 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/configure.ac
+ gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \
gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \
gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
Index: gdb-7.7.50.20140609/gdb/testsuite/configure
Index: gdb-7.8.50.20141228/gdb/testsuite/configure
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/configure 2014-06-13 20:05:29.956503899 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/configure 2014-06-13 20:06:24.492555709 +0200
@@ -3448,7 +3448,7 @@ done
--- gdb-7.8.50.20141228.orig/gdb/testsuite/configure 2015-01-01 17:00:26.124908947 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/configure 2015-01-01 17:00:59.467887088 +0100
@@ -3458,7 +3458,7 @@ if test "${build}" = "${host}" -a "${hos
fi
-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.compile/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.compile/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -4179,6 +4179,7 @@ do
@@ -4190,6 +4190,7 @@ do
"gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;;
"gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
"gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
@ -31,10 +31,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/configure
"gdb.perf/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.perf/Makefile" ;;
"gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;;
"gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;;
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.c
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.c 2014-06-13 20:05:33.060506819 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.c 2015-01-01 17:00:43.169897773 +0100
@@ -0,0 +1,20 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
@ -56,10 +56,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.c
+ }
+ return 0;
+}
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach2.c
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach2.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach2.c 2014-06-13 20:05:33.060506819 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach2.c 2015-01-01 17:00:43.170897772 +0100
@@ -0,0 +1,24 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
@ -85,10 +85,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach2.c
+ }
+ return (0);
+}
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.c
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.c 2014-06-13 20:05:33.061506820 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.c 2015-01-01 17:00:43.170897772 +0100
@@ -0,0 +1,146 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -236,10 +236,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.c
+ }
+ return 0;
+}
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break1.c
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break1.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break1.c 2014-06-13 20:05:33.061506820 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break1.c 2015-01-01 17:00:43.170897772 +0100
@@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -285,10 +285,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break1.c
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+void marker4 (d) long d; {} /* set breakpoint 13 here */
+#endif
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/coremaker.c
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/coremaker.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/coremaker.c 2014-06-13 20:05:33.061506820 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/coremaker.c 2015-01-01 17:00:43.170897772 +0100
@@ -0,0 +1,142 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc.
@ -432,10 +432,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/coremaker.c
+ return 0;
+}
+
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.exp 2014-06-13 20:05:33.061506820 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/attach.exp 2015-01-01 17:00:43.171897771 +0100
@@ -0,0 +1,417 @@
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+
@ -854,10 +854,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.exp
+do_call_attach_tests
+
+return 0
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.exp 2014-06-13 20:05:33.062506821 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/break.exp 2015-01-01 17:00:43.172897771 +0100
@@ -0,0 +1,962 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004
@ -1821,10 +1821,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.exp
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+}
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/corefile.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/corefile.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/corefile.exp 2014-06-13 20:05:33.063506822 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/corefile.exp 2015-01-01 17:00:43.172897771 +0100
@@ -0,0 +1,233 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
@ -2059,10 +2059,10 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/corefile.exp
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
+
+gdb_test "core" "No core file now."
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/Makefile.in
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/Makefile.in
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/Makefile.in 2014-06-13 20:05:33.063506822 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.pie/Makefile.in 2015-01-01 17:00:43.172897771 +0100
@@ -0,0 +1,19 @@
+VPATH = @srcdir@
+srcdir = @srcdir@

View File

@ -23,11 +23,11 @@ instead.
Port to GDB-6.7.
Index: gdb-7.6.90.20140127/gdb/amd64-linux-tdep.c
Index: gdb-7.8.50.20141228/gdb/amd64-linux-tdep.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/amd64-linux-tdep.c 2014-02-04 23:40:06.263483469 +0100
+++ gdb-7.6.90.20140127/gdb/amd64-linux-tdep.c 2014-02-04 23:47:18.438009290 +0100
@@ -289,6 +289,80 @@ amd64_linux_register_reggroup_p (struct
--- gdb-7.8.50.20141228.orig/gdb/amd64-linux-tdep.c 2015-01-01 17:01:51.506856241 +0100
+++ gdb-7.8.50.20141228/gdb/amd64-linux-tdep.c 2015-01-01 17:01:54.769854349 +0100
@@ -290,6 +290,80 @@ amd64_linux_register_reggroup_p (struct
/* Set the program counter for process PTID to PC. */
@ -108,7 +108,7 @@ Index: gdb-7.6.90.20140127/gdb/amd64-linux-tdep.c
static void
amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{
@@ -1607,6 +1681,8 @@ amd64_linux_init_abi_common(struct gdbar
@@ -1657,6 +1731,8 @@ amd64_linux_init_abi_common(struct gdbar
tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET;
@ -117,11 +117,11 @@ Index: gdb-7.6.90.20140127/gdb/amd64-linux-tdep.c
/* Add the %orig_rax register used for syscall restarting. */
set_gdbarch_write_pc (gdbarch, amd64_linux_write_pc);
Index: gdb-7.6.90.20140127/gdb/amd64-tdep.c
Index: gdb-7.8.50.20141228/gdb/amd64-tdep.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/amd64-tdep.c 2014-02-04 23:40:06.265483471 +0100
+++ gdb-7.6.90.20140127/gdb/amd64-tdep.c 2014-02-04 23:45:40.846891653 +0100
@@ -2359,6 +2359,7 @@ amd64_frame_unwind_stop_reason (struct f
--- gdb-7.8.50.20141228.orig/gdb/amd64-tdep.c 2015-01-01 17:01:51.507856240 +0100
+++ gdb-7.8.50.20141228/gdb/amd64-tdep.c 2015-01-01 17:01:54.770854349 +0100
@@ -2492,6 +2492,7 @@ amd64_frame_unwind_stop_reason (struct f
{
struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache);
@ -129,7 +129,7 @@ Index: gdb-7.6.90.20140127/gdb/amd64-tdep.c
if (!cache->base_p)
return UNWIND_UNAVAILABLE;
@@ -2367,6 +2368,10 @@ amd64_frame_unwind_stop_reason (struct f
@@ -2500,6 +2501,10 @@ amd64_frame_unwind_stop_reason (struct f
if (cache->base == 0)
return UNWIND_OUTERMOST;
@ -140,7 +140,7 @@ Index: gdb-7.6.90.20140127/gdb/amd64-tdep.c
return UNWIND_NO_REASON;
}
@@ -2498,6 +2503,7 @@ amd64_sigtramp_frame_this_id (struct fra
@@ -2631,6 +2636,7 @@ amd64_sigtramp_frame_this_id (struct fra
{
struct amd64_frame_cache *cache =
amd64_sigtramp_frame_cache (this_frame, this_cache);
@ -148,7 +148,7 @@ Index: gdb-7.6.90.20140127/gdb/amd64-tdep.c
if (!cache->base_p)
(*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame));
@@ -2506,6 +2512,11 @@ amd64_sigtramp_frame_this_id (struct fra
@@ -2639,6 +2645,11 @@ amd64_sigtramp_frame_this_id (struct fra
/* This marks the outermost frame. */
return;
}
@ -160,11 +160,11 @@ Index: gdb-7.6.90.20140127/gdb/amd64-tdep.c
else
(*this_id) = frame_id_build (cache->base + 16, get_frame_pc (this_frame));
}
Index: gdb-7.6.90.20140127/gdb/i386-tdep.c
Index: gdb-7.8.50.20141228/gdb/i386-tdep.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/i386-tdep.c 2014-02-04 23:40:06.267483473 +0100
+++ gdb-7.6.90.20140127/gdb/i386-tdep.c 2014-02-04 23:43:33.048734974 +0100
@@ -7830,6 +7830,9 @@ i386_gdbarch_init (struct gdbarch_info i
--- gdb-7.8.50.20141228.orig/gdb/i386-tdep.c 2015-01-01 17:01:51.509856239 +0100
+++ gdb-7.8.50.20141228/gdb/i386-tdep.c 2015-01-01 17:01:54.772854348 +0100
@@ -8286,6 +8286,9 @@ i386_gdbarch_init (struct gdbarch_info i
tdep->xsave_xcr0_offset = -1;
@ -174,175 +174,24 @@ Index: gdb-7.6.90.20140127/gdb/i386-tdep.c
tdep->record_regmap = i386_record_regmap;
set_gdbarch_long_long_align_bit (gdbarch, 32);
Index: gdb-7.6.90.20140127/gdb/i386-tdep.h
Index: gdb-7.8.50.20141228/gdb/i386-tdep.h
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/i386-tdep.h 2014-02-04 23:40:06.268483475 +0100
+++ gdb-7.6.90.20140127/gdb/i386-tdep.h 2014-02-04 23:43:33.048734974 +0100
@@ -192,6 +192,9 @@ struct gdbarch_tdep
int (*i386_sysenter_record) (struct regcache *regcache);
/* Parse syscall args. */
int (*i386_syscall_record) (struct regcache *regcache);
--- gdb-7.8.50.20141228.orig/gdb/i386-tdep.h 2015-01-01 17:01:54.772854348 +0100
+++ gdb-7.8.50.20141228/gdb/i386-tdep.h 2015-01-01 17:02:15.826842143 +0100
@@ -240,6 +240,9 @@ struct gdbarch_tdep
/* Regsets. */
const struct regset *fpregset;
+
+ /* Detect OS dependent outermost frames; such as `clone'. */
+ int (*outermost_frame_p) (struct frame_info *this_frame);
};
/* Floating-point registers. */
Index: gdb-7.6.90.20140127/gdb/ia64-tdep.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/ia64-tdep.c 2014-02-04 23:40:06.270483477 +0100
+++ gdb-7.6.90.20140127/gdb/ia64-tdep.c 2014-02-04 23:43:33.049734975 +0100
@@ -2176,6 +2176,138 @@ static const struct frame_unwind ia64_fr
default_frame_sniffer
};
+/* Detect the outermost frame; during unwind of
+ #6 0x2000000000347100 in __clone2 () from /lib/libc.so.6.1
+ avoid the additional bogus frame
+ #7 0x0000000000000000 in ?? () */
+
+static char linux_clone2_code[] =
+{
+/* libc/sysdeps/unix/sysv/linux/ia64/clone2.S */
+ 0x09, 0x00, 0x20, 0x12, 0x90, 0x11, 0x00, 0x40,
+ 0x28, 0x20, 0x23, 0x00, 0x00, 0x00, 0x04, 0x00,
+/* st4 [r9]=r8 */
+/* st4 [r10]=r8 */
+/* ;; */
+/* #endif */
+ 0x02, 0x50, 0x21, 0x40, 0x18, 0x14, 0x90, 0x02,
+ 0x90, 0x00, 0x42, 0x00, 0x00, 0x00, 0x04, 0x00,
+/* 1: ld8 out1=[in0],8 |* Retrieve code pointer. *| */
+/* mov out0=in4 |* Pass proper argument to fn *| */
+/* ;; */
+ 0x11, 0x08, 0x00, 0x40, 0x18, 0x10, 0x60, 0x50,
+ 0x05, 0x80, 0x03, 0x00, 0x68, 0x00, 0x80, 0x12,
+/* ld8 gp=[in0] |* Load function gp. *| */
+/* mov b6=out1 */
+/* br.call.dptk.many rp=b6 |* Call fn(arg) in the child *| */
+/* ;; */
+ 0x10, 0x48, 0x01, 0x10, 0x00, 0x21, 0x10, 0x00,
+ 0xa0, 0x00, 0x42, 0x00, 0x98, 0xdf, 0xf7, 0x5b,
+/* mov out0=r8 |* Argument to _exit *| */
+/* mov gp=loc0 */
+/* .globl HIDDEN_JUMPTARGET(_exit) */
+/* br.call.dpnt.many rp=HIDDEN_JUMPTARGET(_exit) */
+/* |* call _exit with result from fn. *| */
+ 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x02, 0x00, 0x80, 0x00, 0x00, 0x84, 0x00
+/* ret |* Not reached. *| */
+};
+
+#define LINUX_CLONE_PRE_SLOTS 3 /* Number of slots before PC. */
+#define LINUX_CLONE_LEN (sizeof linux_clone2_code)
+
+static int
+ia64_linux_clone2_running (struct frame_info *this_frame)
+{
+ CORE_ADDR pc = get_frame_pc (this_frame);
+ char buf[LINUX_CLONE_LEN];
+ struct minimal_symbol *minsym;
+ long long instr;
+
+ if (!safe_frame_unwind_memory (this_frame, pc - LINUX_CLONE_PRE_SLOTS * 16,
+ buf, LINUX_CLONE_LEN))
+ return 0;
+
+ if (memcmp (buf, linux_clone2_code, LINUX_CLONE_PRE_SLOTS * 16) != 0)
+ return 0;
+
+ /* Adjust the expected "_exit" address. */
+ minsym = lookup_minimal_symbol_text ("_exit", NULL);
+ if (minsym == NULL)
+ return 0;
+
+ instr = slotN_contents (&linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16], 2);
+ instr &= ~(((1L << 20) - 1) << 13);
+ /* Address is relative to the jump instruction slot, not the next one. */
+ instr |= (((SYMBOL_VALUE_ADDRESS (minsym) - (pc & ~0xfL)) >> 4)
+ & ((1L << 20) - 1)) << 13;
+ replace_slotN_contents (&linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16], instr,
+ 2);
+
+ if (memcmp (&buf[LINUX_CLONE_PRE_SLOTS * 16],
+ &linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16],
+ LINUX_CLONE_LEN - (LINUX_CLONE_PRE_SLOTS * 16)) != 0)
+ return 0;
+
+ return 1;
+}
+
+static int
+ia64_outermost_frame (struct frame_info *this_frame)
+{
+ CORE_ADDR pc = get_frame_pc (this_frame);
+ char *name;
+
+ find_pc_partial_function (pc, &name, NULL, NULL);
+
+ /* If we have NAME, we can optimize the search.
+ `clone' NAME still needs to have the code checked as its name may be
+ present in the user code.
+ `__clone' NAME should not be present in the user code but in the initial
+ parts of the `__clone' implementation the unwind still makes sense.
+ More detailed unwinding decision would be too much sensitive to possible
+ subtle changes in specific glibc revisions. */
+ if (name == NULL || strcmp (name, "clone2") == 0
+ || strcmp ("__clone2", name) == 0)
+ return (ia64_linux_clone2_running (this_frame) != 0);
+
+ return 0;
+}
+
+static void
+ia64_clone2_frame_this_id (struct frame_info *this_frame, void **this_cache,
+ struct frame_id *this_id)
+{
+ /* Leave the default outermost frame at *THIS_ID. */
+}
+
+static struct value *
+ia64_clone2_frame_prev_register (struct frame_info *this_frame,
+ void **this_cache, int regnum)
+{
+ return frame_unwind_got_register (this_frame, regnum, regnum);
+}
+
+static int
+ia64_clone2_frame_sniffer (const struct frame_unwind *self,
+ struct frame_info *this_frame,
+ void **this_prologue_cache)
+{
+ if (ia64_outermost_frame (this_frame))
+ return 1;
+
+ return 0;
+}
+
+static const struct frame_unwind ia64_clone2_frame_unwind =
+{
+ NORMAL_FRAME,
+ &ia64_clone2_frame_this_id,
+ &ia64_clone2_frame_prev_register,
+ NULL,
+ &ia64_clone2_frame_sniffer
+};
+
/* Signal trampolines. */
static void
@@ -4023,6 +4155,7 @@ ia64_gdbarch_init (struct gdbarch_info i
set_gdbarch_dummy_id (gdbarch, ia64_dummy_id);
set_gdbarch_unwind_pc (gdbarch, ia64_unwind_pc);
+ frame_unwind_append_unwinder (gdbarch, &ia64_clone2_frame_unwind);
#ifdef HAVE_LIBUNWIND_IA64_H
frame_unwind_append_unwinder (gdbarch,
&ia64_libunwind_sigtramp_frame_unwind);
Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.threads/bt-clone-stop.c
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.threads/bt-clone-stop.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.threads/bt-clone-stop.c 2014-02-04 23:43:33.050734976 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.threads/bt-clone-stop.c 2015-01-01 17:01:54.773854347 +0100
@@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -383,10 +232,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.threads/bt-clone-stop.c
+ for (;;)
+ pause();
+}
Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.threads/bt-clone-stop.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.threads/bt-clone-stop.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2014-02-04 23:43:33.050734976 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2015-01-01 17:01:54.774854346 +0100
@@ -0,0 +1,61 @@
+# Copyright 2006 Free Software Foundation, Inc.
+

View File

@ -58,24 +58,10 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
* exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core".
Index: gdb-7.7.50.20140609/gdb/exceptions.h
Index: gdb-7.8.50.20141228/gdb/exec.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/exceptions.h 2014-06-13 20:26:46.988804553 +0200
+++ gdb-7.7.50.20140609/gdb/exceptions.h 2014-06-13 20:27:01.930820057 +0200
@@ -100,6 +100,9 @@ enum errors {
/* Requested feature, method, mechanism, etc. is not supported. */
NOT_SUPPORTED_ERROR,
+ /* Attempt to load a core file as executable. */
+ IS_CORE_ERROR,
+
/* Add more errors here. */
NR_ERRORS
};
Index: gdb-7.7.50.20140609/gdb/exec.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/exec.c 2014-06-13 20:26:44.831802315 +0200
+++ gdb-7.7.50.20140609/gdb/exec.c 2014-06-13 20:27:17.282836454 +0200
--- gdb-7.8.50.20141228.orig/gdb/exec.c 2015-01-03 23:18:38.097427908 +0100
+++ gdb-7.8.50.20141228/gdb/exec.c 2015-01-03 23:19:02.448556391 +0100
@@ -35,6 +35,7 @@
#include "progspace.h"
#include "gdb_bfd.h"
@ -84,7 +70,7 @@ Index: gdb-7.7.50.20140609/gdb/exec.c
#include <fcntl.h>
#include "readline/readline.h"
@@ -231,12 +232,27 @@ exec_file_attach (char *filename, int fr
@@ -222,12 +223,27 @@ exec_file_attach (const char *filename,
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{
@ -115,11 +101,11 @@ Index: gdb-7.7.50.20140609/gdb/exec.c
}
if (build_section_table (exec_bfd, &sections, &sections_end))
Index: gdb-7.7.50.20140609/gdb/main.c
Index: gdb-7.8.50.20141228/gdb/main.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/main.c 2014-06-13 20:26:44.831802315 +0200
+++ gdb-7.7.50.20140609/gdb/main.c 2014-06-13 20:26:46.990804555 +0200
@@ -341,6 +341,36 @@ typedef struct cmdarg {
--- gdb-7.8.50.20141228.orig/gdb/main.c 2015-01-03 23:18:38.098427913 +0100
+++ gdb-7.8.50.20141228/gdb/main.c 2015-01-03 23:22:10.157546792 +0100
@@ -426,6 +426,36 @@ typedef struct cmdarg {
/* Define type VEC (cmdarg_s). */
DEF_VEC_O (cmdarg_s);
@ -128,7 +114,7 @@ Index: gdb-7.7.50.20140609/gdb/main.c
+ core_file_command failed to find a matching executable. */
+
+static void
+exec_or_core_file_attach (char *filename, int from_tty)
+exec_or_core_file_attach (const char *filename, int from_tty)
+{
+ volatile struct gdb_exception e;
+
@ -142,7 +128,7 @@ Index: gdb-7.7.50.20140609/gdb/main.c
+ {
+ if (e.error == IS_CORE_ERROR)
+ {
+ core_file_command (filename, from_tty);
+ core_file_command ((char *) filename, from_tty);
+
+ /* Iff the core file found its executable suppress the error message
+ from exec_file_attach. */
@ -156,7 +142,7 @@ Index: gdb-7.7.50.20140609/gdb/main.c
static int
captured_main (void *data)
{
@@ -854,6 +884,8 @@ captured_main (void *data)
@@ -910,6 +940,8 @@ captured_main (void *data)
{
symarg = argv[optind];
execarg = argv[optind];
@ -165,11 +151,11 @@ Index: gdb-7.7.50.20140609/gdb/main.c
optind++;
}
@@ -1017,11 +1049,25 @@ captured_main (void *data)
@@ -1069,11 +1101,26 @@ captured_main (void *data)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
+ catch_command_errors_ftype *func;
+ catch_command_errors_const_ftype *func;
+
+ /* Call exec_or_core_file_attach only if the file was specified as
+ a command line argument (and not an a command line option). */
@ -184,13 +170,28 @@ Index: gdb-7.7.50.20140609/gdb/main.c
/* The exec file and the symbol-file are the same. If we can't
open it, better only print one error message.
- catch_command_errors returns non-zero on success! */
- if (catch_command_errors (exec_file_attach, execarg,
- !batch_flag, RETURN_MASK_ALL))
- if (catch_command_errors_const (exec_file_attach, execarg,
- !batch_flag, RETURN_MASK_ALL))
+ catch_command_errors returns non-zero on success!
+ Do not load EXECARG as a symbol file if it has been already processed
+ as a core file. */
+ if (catch_command_errors (func, execarg, !batch_flag, RETURN_MASK_ALL)
+ if (catch_command_errors_const (func, execarg, !batch_flag,
+ RETURN_MASK_ALL)
+ && core_bfd == NULL)
catch_command_errors_const (symbol_file_add_main, symarg,
!batch_flag, RETURN_MASK_ALL);
}
Index: gdb-7.8.50.20141228/gdb/common/common-exceptions.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/common/common-exceptions.h 2015-01-03 23:18:38.097427908 +0100
+++ gdb-7.8.50.20141228/gdb/common/common-exceptions.h 2015-01-03 23:19:02.449556396 +0100
@@ -99,6 +99,9 @@ enum errors {
/* Requested feature, method, mechanism, etc. is not supported. */
NOT_SUPPORTED_ERROR,
+ /* Attempt to load a core file as executable. */
+ IS_CORE_ERROR,
+
/* Add more errors here. */
NR_ERRORS
};

View File

@ -1,8 +1,8 @@
Index: gdb-7.7.50.20140609/gdb/event-top.c
Index: gdb-7.8.50.20141228/gdb/event-top.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/event-top.c 2014-06-13 20:10:19.632787642 +0200
+++ gdb-7.7.50.20140609/gdb/event-top.c 2014-06-13 20:11:49.605878557 +0200
@@ -38,6 +38,7 @@
--- gdb-7.8.50.20141228.orig/gdb/event-top.c 2015-01-01 17:12:24.881489087 +0100
+++ gdb-7.8.50.20141228/gdb/event-top.c 2015-01-01 17:12:28.821486803 +0100
@@ -37,6 +37,7 @@
#include "gdbcmd.h" /* for dont_repeat() */
#include "annotate.h"
#include "maint.h"
@ -10,7 +10,7 @@ Index: gdb-7.7.50.20140609/gdb/event-top.c
/* readline include files. */
#include "readline/readline.h"
@@ -176,6 +177,8 @@ rl_callback_read_char_wrapper (gdb_clien
@@ -180,6 +181,8 @@ rl_callback_read_char_wrapper (gdb_clien
void
cli_command_loop (void *data)
{
@ -19,7 +19,7 @@ Index: gdb-7.7.50.20140609/gdb/event-top.c
display_gdb_prompt (0);
/* Now it's time to start the event loop. */
@@ -243,6 +246,8 @@ display_gdb_prompt (char *new_prompt)
@@ -298,6 +301,8 @@ display_gdb_prompt (const char *new_prom
/* Reset the nesting depth used when trace-commands is set. */
reset_command_nest_depth ();
@ -28,11 +28,11 @@ Index: gdb-7.7.50.20140609/gdb/event-top.c
old_chain = make_cleanup (free_current_contents, &actual_gdb_prompt);
/* Do not call the python hook on an explicit prompt change as
Index: gdb-7.7.50.20140609/gdb/symfile.h
Index: gdb-7.8.50.20141228/gdb/symfile.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/symfile.h 2014-06-13 20:10:19.633787643 +0200
+++ gdb-7.7.50.20140609/gdb/symfile.h 2014-06-13 20:10:31.066799158 +0200
@@ -573,6 +573,8 @@ void map_symbol_filenames (symbol_filena
--- gdb-7.8.50.20141228.orig/gdb/symfile.h 2015-01-01 17:12:24.881489087 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.h 2015-01-01 17:12:28.822486802 +0100
@@ -577,6 +577,8 @@ void map_symbol_filenames (symbol_filena
/* build-id support. */
extern struct elf_build_id *build_id_addr_get (CORE_ADDR addr);
extern void debug_print_missing (const char *binary, const char *debug);
@ -41,11 +41,11 @@ Index: gdb-7.7.50.20140609/gdb/symfile.h
/* From dwarf2read.c */
Index: gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/gdb.exp 2014-06-13 20:10:19.634787644 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp 2014-06-13 20:10:31.067799159 +0200
@@ -1492,7 +1492,7 @@ proc default_gdb_start { } {
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/gdb.exp 2015-01-01 17:12:24.883489085 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp 2015-01-01 17:12:28.823486801 +0100
@@ -1522,7 +1522,7 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
}
@ -54,11 +54,11 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp
send_gdb "set build-id-verbose 0\n"
gdb_expect 10 {
-re "$gdb_prompt $" {
Index: gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:10:19.635787645 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:10:31.068799160 +0200
@@ -212,7 +212,7 @@ proc default_mi_gdb_start { args } {
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/mi-support.exp 2015-01-01 17:12:24.884489085 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp 2015-01-01 17:12:28.823486801 +0100
@@ -214,7 +214,7 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
}
@ -67,22 +67,22 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp
send_gdb "190-gdb-set build-id-verbose 0\n"
gdb_expect 10 {
-re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
Index: gdb-7.7.50.20140609/gdb/tui/tui-interp.c
Index: gdb-7.8.50.20141228/gdb/tui/tui-interp.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/tui/tui-interp.c 2014-06-13 20:10:31.068799160 +0200
+++ gdb-7.7.50.20140609/gdb/tui/tui-interp.c 2014-06-13 20:10:47.806816542 +0200
@@ -32,6 +32,7 @@
#include "exceptions.h"
--- gdb-7.8.50.20141228.orig/gdb/tui/tui-interp.c 2015-01-01 17:12:28.824486801 +0100
+++ gdb-7.8.50.20141228/gdb/tui/tui-interp.c 2015-01-01 17:12:43.240478444 +0100
@@ -31,6 +31,7 @@
#include "tui/tui-io.h"
#include "infrun.h"
#include "observer.h"
+#include "symfile.h"
static struct ui_out *tui_ui_out (struct interp *self);
Index: gdb-7.7.50.20140609/gdb/aclocal.m4
Index: gdb-7.8.50.20141228/gdb/aclocal.m4
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/aclocal.m4 2014-06-13 20:10:19.636787646 +0200
+++ gdb-7.7.50.20140609/gdb/aclocal.m4 2014-06-13 20:10:31.069799161 +0200
--- gdb-7.8.50.20141228.orig/gdb/aclocal.m4 2015-01-01 17:12:24.885489084 +0100
+++ gdb-7.8.50.20141228/gdb/aclocal.m4 2015-01-01 17:12:28.824486801 +0100
@@ -11,6 +11,221 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@ -305,10 +305,10 @@ Index: gdb-7.7.50.20140609/gdb/aclocal.m4
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
Index: gdb-7.7.50.20140609/gdb/config.in
Index: gdb-7.8.50.20141228/gdb/config.in
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/config.in 2014-06-13 20:10:19.637787647 +0200
+++ gdb-7.7.50.20140609/gdb/config.in 2014-06-13 20:10:31.069799161 +0200
--- gdb-7.8.50.20141228.orig/gdb/config.in 2015-01-01 17:12:24.885489084 +0100
+++ gdb-7.8.50.20141228/gdb/config.in 2015-01-01 17:12:28.824486801 +0100
@@ -33,6 +33,9 @@
/* Define to BFD's default target vector. */
#undef DEFAULT_BFD_VEC
@ -319,7 +319,7 @@ Index: gdb-7.7.50.20140609/gdb/config.in
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
@@ -210,6 +213,9 @@
@@ -207,6 +210,9 @@
/* Define if Python 2.7 is being used. */
#undef HAVE_LIBPYTHON2_7
@ -329,11 +329,11 @@ Index: gdb-7.7.50.20140609/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
Index: gdb-7.7.50.20140609/gdb/configure
Index: gdb-7.8.50.20141228/gdb/configure
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/configure 2014-06-13 20:10:19.642787652 +0200
+++ gdb-7.7.50.20140609/gdb/configure 2014-06-13 20:10:31.073799165 +0200
@@ -692,6 +692,11 @@ PKGVERSION
--- gdb-7.8.50.20141228.orig/gdb/configure 2015-01-01 17:12:24.891489081 +0100
+++ gdb-7.8.50.20141228/gdb/configure 2015-01-01 17:12:28.828486798 +0100
@@ -698,6 +698,11 @@ PKGVERSION
HAVE_NATIVE_GCORE_TARGET
TARGET_OBS
subdirs
@ -345,7 +345,7 @@ Index: gdb-7.7.50.20140609/gdb/configure
GDB_DATADIR
DEBUGDIR
MAKEINFO_EXTRA_FLAGS
@@ -795,6 +800,7 @@ with_gdb_datadir
@@ -801,6 +806,7 @@ with_gdb_datadir
with_relocated_sources
with_auto_load_dir
with_auto_load_safe_path
@ -353,7 +353,7 @@ Index: gdb-7.7.50.20140609/gdb/configure
enable_targets
enable_64_bit_bfd
enable_gdbcli
@@ -846,6 +852,11 @@ CPPFLAGS
@@ -852,6 +858,11 @@ CPPFLAGS
CPP
MAKEINFO
MAKEINFOFLAGS
@ -365,7 +365,7 @@ Index: gdb-7.7.50.20140609/gdb/configure
YACC
YFLAGS
XMKMF'
@@ -1516,6 +1527,8 @@ Optional Packages:
@@ -1522,6 +1533,8 @@ Optional Packages:
[--with-auto-load-dir]
--without-auto-load-safe-path
do not restrict auto-loaded files locations
@ -374,7 +374,7 @@ Index: gdb-7.7.50.20140609/gdb/configure
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
--with-curses use the curses library instead of the termcap
library
@@ -1565,6 +1578,13 @@ Some influential environment variables:
@@ -1571,6 +1584,13 @@ Some influential environment variables:
MAKEINFO Parent configure detects if it is of sufficient version.
MAKEINFOFLAGS
Parameters for MAKEINFO.
@ -388,7 +388,7 @@ Index: gdb-7.7.50.20140609/gdb/configure
YACC The `Yet Another C Compiler' implementation to use. Defaults to
the first program found out of: `bison -y', `byacc', `yacc'.
YFLAGS The list of arguments that will be passed by default to $YACC.
@@ -5160,6 +5180,491 @@ _ACEOF
@@ -5267,6 +5287,491 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
$as_echo "$with_auto_load_safe_path" >&6; }
@ -880,11 +880,11 @@ Index: gdb-7.7.50.20140609/gdb/configure
subdirs="$subdirs testsuite"
Index: gdb-7.7.50.20140609/gdb/configure.ac
Index: gdb-7.8.50.20141228/gdb/configure.ac
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/configure.ac 2014-06-13 20:10:19.643787653 +0200
+++ gdb-7.7.50.20140609/gdb/configure.ac 2014-06-13 20:10:31.074799166 +0200
@@ -165,6 +165,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
--- gdb-7.8.50.20141228.orig/gdb/configure.ac 2015-01-01 17:12:24.893489079 +0100
+++ gdb-7.8.50.20141228/gdb/configure.ac 2015-01-01 17:12:28.829486798 +0100
@@ -172,6 +172,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap
[Directories safe to hold auto-loaded files.])
AC_MSG_RESULT([$with_auto_load_safe_path])
@ -1084,11 +1084,11 @@ Index: gdb-7.7.50.20140609/gdb/configure.ac
AC_CONFIG_SUBDIRS(testsuite)
# Check whether to support alternative target configurations
Index: gdb-7.7.50.20140609/gdb/corelow.c
Index: gdb-7.8.50.20141228/gdb/corelow.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/corelow.c 2014-06-13 20:10:19.644787654 +0200
+++ gdb-7.7.50.20140609/gdb/corelow.c 2014-06-13 20:10:31.074799166 +0200
@@ -316,7 +316,7 @@ build_id_locate_exec (int from_tty)
--- gdb-7.8.50.20141228.orig/gdb/corelow.c 2015-01-01 17:12:24.894489079 +0100
+++ gdb-7.8.50.20141228/gdb/corelow.c 2015-01-01 17:12:28.829486798 +0100
@@ -310,7 +310,7 @@ build_id_locate_exec (int from_tty)
symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
}
else
@ -1097,11 +1097,11 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
do_cleanups (back_to);
Index: gdb-7.7.50.20140609/gdb/build-id.c
Index: gdb-7.8.50.20141228/gdb/build-id.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/build-id.c 2014-06-13 20:10:19.644787654 +0200
+++ gdb-7.7.50.20140609/gdb/build-id.c 2014-06-13 20:10:31.075799167 +0200
@@ -32,6 +32,7 @@
--- gdb-7.8.50.20141228.orig/gdb/build-id.c 2015-01-01 17:12:24.894489079 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.c 2015-01-01 17:12:28.830486797 +0100
@@ -31,6 +31,7 @@
#include "gdbcmd.h"
#include "observer.h"
#include <sys/stat.h>
@ -1109,7 +1109,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
#define BUILD_ID_VERBOSE_NONE 0
#define BUILD_ID_VERBOSE_FILENAMES 1
@@ -666,8 +667,360 @@ build_id_to_filename (const struct elf_b
@@ -664,8 +665,360 @@ build_id_to_filename (const struct elf_b
return result;
}
@ -1471,7 +1471,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
avoidance. */
struct missing_filepair
@@ -721,11 +1074,17 @@ missing_filepair_change (void)
@@ -719,11 +1072,17 @@ missing_filepair_change (void)
/* All their memory came just from missing_filepair_OBSTACK. */
missing_filepair_hash = NULL;
}
@ -1489,7 +1489,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
missing_filepair_change ();
}
@@ -792,14 +1151,34 @@ debug_print_missing (const char *binary,
@@ -790,14 +1149,34 @@ debug_print_missing (const char *binary,
*slot = missing_filepair;

View File

@ -1,8 +1,8 @@
Index: gdb-7.7.50.20140609/gdb/corelow.c
Index: gdb-7.8.50.20141228/gdb/corelow.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/corelow.c 2014-06-13 20:09:37.369745221 +0200
+++ gdb-7.7.50.20140609/gdb/corelow.c 2014-06-13 20:09:42.407750265 +0200
@@ -49,6 +49,10 @@
--- gdb-7.8.50.20141228.orig/gdb/corelow.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/corelow.c 2015-01-03 23:12:08.691349454 +0100
@@ -45,6 +45,10 @@
#include "gdb_bfd.h"
#include "completer.h"
#include "filestuff.h"
@ -13,7 +13,7 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
@@ -272,6 +276,53 @@ add_to_thread_list (bfd *abfd, asection
@@ -266,6 +270,53 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = ptid; /* Yes, make it current. */
}
@ -67,7 +67,7 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
/* This routine opens and sets up the core file bfd. */
static void
@@ -410,6 +461,14 @@ core_open (char *filename, int from_tty)
@@ -405,6 +456,14 @@ core_open (const char *arg, int from_tty
switch_to_thread (thread->ptid);
}
@ -82,7 +82,7 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
post_create_inferior (&core_ops, from_tty);
/* Now go through the target stack looking for threads since there
@@ -1029,4 +1088,11 @@ _initialize_corelow (void)
@@ -1035,4 +1094,11 @@ _initialize_corelow (void)
init_core_ops ();
add_target_with_completer (&core_ops, filename_completer);
@ -94,11 +94,11 @@ Index: gdb-7.7.50.20140609/gdb/corelow.c
+ NULL, NULL, NULL,
+ &setlist, &showlist);
}
Index: gdb-7.7.50.20140609/gdb/doc/gdb.texinfo
Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/doc/gdb.texinfo 2014-06-13 20:09:37.380745232 +0200
+++ gdb-7.7.50.20140609/gdb/doc/gdb.texinfo 2014-06-13 20:09:42.417750275 +0200
@@ -17547,6 +17547,27 @@ information files.
--- gdb-7.8.50.20141228.orig/gdb/doc/gdb.texinfo 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/doc/gdb.texinfo 2015-01-03 23:12:08.701349509 +0100
@@ -17930,6 +17930,27 @@ information files.
@end table
@ -126,19 +126,19 @@ Index: gdb-7.7.50.20140609/gdb/doc/gdb.texinfo
@cindex @code{.gnu_debuglink} sections
@cindex debug link sections
A debug link is a special section of the executable file named
Index: gdb-7.7.50.20140609/gdb/solib-svr4.c
Index: gdb-7.8.50.20141228/gdb/solib-svr4.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/solib-svr4.c 2014-06-13 20:09:37.382745234 +0200
+++ gdb-7.7.50.20140609/gdb/solib-svr4.c 2014-06-13 20:09:42.418750276 +0200
@@ -48,6 +48,7 @@
#include "exceptions.h"
--- gdb-7.8.50.20141228.orig/gdb/solib-svr4.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/solib-svr4.c 2015-01-03 23:12:08.702349514 +0100
@@ -45,6 +45,7 @@
#include "auxv.h"
#include "gdb_bfd.h"
#include "probe.h"
+#include "build-id.h"
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
@@ -1369,9 +1370,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
@@ -1366,9 +1367,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD
continue;
}
@ -194,11 +194,11 @@ Index: gdb-7.7.50.20140609/gdb/solib-svr4.c
xfree (buffer);
/* If this entry has no name, or its name matches the name
Index: gdb-7.7.50.20140609/gdb/elfread.c
Index: gdb-7.8.50.20141228/gdb/elfread.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/elfread.c 2014-06-13 20:09:37.383745235 +0200
+++ gdb-7.7.50.20140609/gdb/elfread.c 2014-06-13 20:09:42.418750276 +0200
@@ -1335,9 +1335,10 @@ elf_symfile_read (struct objfile *objfil
--- gdb-7.8.50.20141228.orig/gdb/elfread.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/elfread.c 2015-01-03 23:12:08.703349519 +0100
@@ -1339,9 +1339,10 @@ elf_symfile_read (struct objfile *objfil
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@ -211,7 +211,7 @@ Index: gdb-7.7.50.20140609/gdb/elfread.c
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1351,6 +1352,12 @@ elf_symfile_read (struct objfile *objfil
@@ -1355,6 +1356,12 @@ elf_symfile_read (struct objfile *objfil
symbol_file_add_separate (abfd, debugfile, symfile_flags, objfile);
do_cleanups (cleanup);
}
@ -224,11 +224,11 @@ Index: gdb-7.7.50.20140609/gdb/elfread.c
}
}
Index: gdb-7.7.50.20140609/gdb/symfile.h
Index: gdb-7.8.50.20141228/gdb/symfile.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/symfile.h 2014-06-13 20:09:42.419750277 +0200
+++ gdb-7.7.50.20140609/gdb/symfile.h 2014-06-13 20:10:04.478772510 +0200
@@ -570,6 +570,10 @@ void expand_symtabs_matching (expand_sym
--- gdb-7.8.50.20141228.orig/gdb/symfile.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.h 2015-01-03 23:12:08.703349519 +0100
@@ -574,6 +574,10 @@ void expand_symtabs_matching (expand_sym
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
@ -239,11 +239,11 @@ Index: gdb-7.7.50.20140609/gdb/symfile.h
/* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal
Index: gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/gdb.exp 2014-06-13 20:09:37.384745236 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp 2014-06-13 20:09:42.420750278 +0200
@@ -1492,6 +1492,16 @@ proc default_gdb_start { } {
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/gdb.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/gdb.exp 2015-01-03 23:12:08.704349525 +0100
@@ -1522,6 +1522,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
}
@ -260,11 +260,11 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp
return 0
}
Index: gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:09:37.385745237 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:09:42.421750279 +0200
@@ -212,6 +212,16 @@ proc default_mi_gdb_start { args } {
--- gdb-7.8.50.20141228.orig/gdb/testsuite/lib/mi-support.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/lib/mi-support.exp 2015-01-03 23:12:08.705349530 +0100
@@ -214,6 +214,16 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
}
@ -281,11 +281,11 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp
# If allowing the inferior to have its own PTY then assign the inferior
# its own terminal device here.
if { $separate_inferior_pty } {
Index: gdb-7.7.50.20140609/gdb/objfiles.h
Index: gdb-7.8.50.20141228/gdb/objfiles.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/objfiles.h 2014-06-13 20:09:37.385745237 +0200
+++ gdb-7.7.50.20140609/gdb/objfiles.h 2014-06-13 20:09:42.421750279 +0200
@@ -464,6 +464,10 @@ struct objfile
--- gdb-7.8.50.20141228.orig/gdb/objfiles.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/objfiles.h 2015-01-03 23:12:08.705349530 +0100
@@ -459,6 +459,10 @@ struct objfile
#define OBJF_NOT_FILENAME (1 << 6)
@ -296,10 +296,10 @@ Index: gdb-7.7.50.20140609/gdb/objfiles.h
/* Declarations for functions defined in objfiles.c */
extern struct objfile *allocate_objfile (bfd *, const char *name, int);
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.base/corefile.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/corefile.exp
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/testsuite/gdb.base/corefile.exp 2014-06-13 20:09:37.385745237 +0200
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.base/corefile.exp 2014-06-13 20:09:42.421750279 +0200
--- gdb-7.8.50.20141228.orig/gdb/testsuite/gdb.base/corefile.exp 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/corefile.exp 2015-01-03 23:12:08.705349530 +0100
@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile"
pass $test
}
@ -334,11 +334,11 @@ Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.base/corefile.exp
+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
+ pass $wholetest
+}
Index: gdb-7.7.50.20140609/gdb/build-id.c
Index: gdb-7.8.50.20141228/gdb/build-id.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/build-id.c 2014-06-13 20:09:37.386745238 +0200
+++ gdb-7.7.50.20140609/gdb/build-id.c 2014-06-13 20:09:42.422750280 +0200
@@ -27,11 +27,65 @@
--- gdb-7.8.50.20141228.orig/gdb/build-id.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.c 2015-01-03 23:12:40.792523085 +0100
@@ -26,11 +26,64 @@
#include "symfile.h"
#include "objfiles.h"
#include "filenames.h"
@ -359,11 +359,11 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
+ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
+ value);
+}
+
-/* See build-id.h. */
+/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
+ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */
-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+
+static struct elf_build_id *
+build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
+{
@ -389,24 +389,23 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
+ retval = xmalloc (sizeof *retval - 1 + size);
+ retval->size = size;
+ memcpy (retval->data, data, size);
+
+ return retval;
+ }
+ p = descdata + BFD_ALIGN (descsz, 4);
+ }
+ return NULL;
+}
+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
+ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+
+/* See build-id.h. */
+
static const struct elf_build_id *
const struct elf_build_id *
-build_id_bfd_get (bfd *abfd)
+build_id_bfd_shdr_get (bfd *abfd)
{
if (!bfd_check_format (abfd, bfd_object)
|| bfd_get_flavour (abfd) != bfd_target_elf_flavour
@@ -45,6 +99,348 @@ build_id_bfd_get (bfd *abfd)
@@ -44,6 +97,348 @@ build_id_bfd_get (bfd *abfd)
return elf_tdata (abfd)->build_id;
}
@ -755,7 +754,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
/* See build-id.h. */
int
@@ -53,7 +449,7 @@ build_id_verify (bfd *abfd, size_t check
@@ -52,7 +447,7 @@ build_id_verify (bfd *abfd, size_t check
const struct elf_build_id *found;
int retval = 0;
@ -764,7 +763,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
@@ -68,20 +464,56 @@ build_id_verify (bfd *abfd, size_t check
@@ -67,20 +462,56 @@ build_id_verify (bfd *abfd, size_t check
return retval;
}
@ -825,7 +824,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
@@ -94,8 +526,11 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -93,8 +524,11 @@ build_id_to_debug_bfd (size_t build_id_l
size_t debugdir_len = strlen (debugdir);
const gdb_byte *data = build_id;
size_t size = build_id_len;
@ -838,7 +837,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
memcpy (link, debugdir, debugdir_len);
s = &link[debugdir_len];
@@ -109,44 +544,282 @@ build_id_to_debug_bfd (size_t build_id_l
@@ -108,44 +542,282 @@ build_id_to_debug_bfd (size_t build_id_l
*s++ = '/';
while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++);
@ -909,7 +908,9 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
+ xfree (filename);
+ filename = NULL;
+ }
+
- gdb_bfd_unref (abfd);
- abfd = NULL;
+ if (filename != NULL)
+ {
+ /* LINK_ALL is not used below in this non-NULL FILENAME case. */
@ -935,9 +936,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
+ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
+ its possible use as an argument for installation command. */
+ link_all[len_orig] = ' ';
- gdb_bfd_unref (abfd);
- abfd = NULL;
+
+ strcpy (&link_all[len_orig + 1], link0_resolved);
+ xfree (link0_resolved);
+ }
@ -1138,7 +1137,7 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd),
@@ -166,3 +839,21 @@ find_separate_debug_file_by_buildid (str
@@ -165,3 +837,21 @@ find_separate_debug_file_by_buildid (str
}
return NULL;
}
@ -1160,11 +1159,24 @@ Index: gdb-7.7.50.20140609/gdb/build-id.c
+
+ observer_attach_executable_changed (debug_print_executable_changed);
+}
Index: gdb-7.7.50.20140609/gdb/build-id.h
Index: gdb-7.8.50.20141228/gdb/build-id.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/build-id.h 2014-06-13 20:09:37.386745238 +0200
+++ gdb-7.7.50.20140609/gdb/build-id.h 2014-06-13 20:09:42.422750280 +0200
@@ -32,13 +32,18 @@ extern int build_id_verify (bfd *abfd,
--- gdb-7.8.50.20141228.orig/gdb/build-id.h 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/build-id.h 2015-01-03 23:12:08.706349536 +0100
@@ -20,9 +20,10 @@
#ifndef BUILD_ID_H
#define BUILD_ID_H
-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
+ Locate NT_GNU_BUILD_ID from ABFD and return its content. */
-extern const struct elf_build_id *build_id_bfd_get (bfd *abfd);
+extern const struct elf_build_id *build_id_bfd_shdr_get (bfd *abfd);
/* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
Otherwise, issue a warning and return false. */
@@ -36,13 +37,18 @@ extern int build_id_verify (bfd *abfd,
the caller. */
extern bfd *build_id_to_debug_bfd (size_t build_id_len,
@ -1185,11 +1197,11 @@ Index: gdb-7.7.50.20140609/gdb/build-id.h
+ char **build_id_filename_return);
#endif /* BUILD_ID_H */
Index: gdb-7.7.50.20140609/gdb/dwarf2read.c
Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/dwarf2read.c 2014-06-13 20:09:37.389745241 +0200
+++ gdb-7.7.50.20140609/gdb/dwarf2read.c 2014-06-13 20:09:42.425750283 +0200
@@ -2446,7 +2446,7 @@ dwarf2_get_dwz_file (void)
--- gdb-7.8.50.20141228.orig/gdb/dwarf2read.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/dwarf2read.c 2015-01-03 23:12:08.711349563 +0100
@@ -2443,7 +2443,7 @@ dwarf2_get_dwz_file (void)
}
if (dwz_bfd == NULL)
@ -1198,3 +1210,25 @@ Index: gdb-7.7.50.20140609/gdb/dwarf2read.c
if (dwz_bfd == NULL)
error (_("could not find '.gnu_debugaltlink' file for %s"),
Index: gdb-7.8.50.20141228/gdb/python/py-objfile.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/python/py-objfile.c 2015-01-03 23:11:54.018270090 +0100
+++ gdb-7.8.50.20141228/gdb/python/py-objfile.c 2015-01-03 23:12:08.712349568 +0100
@@ -118,7 +118,7 @@ objfpy_get_build_id (PyObject *self, voi
TRY_CATCH (except, RETURN_MASK_ALL)
{
- build_id = build_id_bfd_get (objfile->obfd);
+ build_id = build_id_bfd_shdr_get (objfile->obfd);
}
GDB_PY_HANDLE_EXCEPTION (except);
@@ -467,7 +467,7 @@ objfpy_lookup_objfile_by_build_id (const
/* Don't return separate debug files. */
if (objfile->separate_debug_objfile_backlink != NULL)
continue;
- obfd_build_id = build_id_bfd_get (objfile->obfd);
+ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd);
if (obfd_build_id == NULL)
continue;
if (objfpy_build_id_matches (obfd_build_id, build_id))

View File

@ -3,23 +3,10 @@
Port to GDB-6.8pre.
Remove the `[' character from the GDB-6.8 default message.
Index: gdb-7.6.90.20140127/gdb/linux-nat.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/linux-nat.c 2014-02-04 23:47:39.275034491 +0100
+++ gdb-7.6.90.20140127/gdb/linux-nat.c 2014-02-04 23:48:11.943074132 +0100
@@ -426,7 +426,7 @@ holding the child stopped. Try \"set de
remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
}
- if (info_verbose || debug_linux_nat)
+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_linux_nat)
{
target_terminal_ours ();
fprintf_filtered (gdb_stdlog,
Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.base/fork-detach.c
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.base/fork-detach.c 2014-02-04 23:47:39.275034491 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.c 2015-01-06 19:31:40.703988534 +0100
@@ -0,0 +1,57 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -78,10 +65,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.base/fork-detach.c
+ }
+ return 0;
+}
Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.base/fork-detach.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.base/fork-detach.exp 2014-02-04 23:47:39.276034493 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/fork-detach.exp 2015-01-06 19:31:40.704988538 +0100
@@ -0,0 +1,36 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
@ -119,3 +106,16 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.base/fork-detach.exp
+gdb_test "" \
+ "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
+ "Info message caught"
Index: gdb-7.8.50.20141228/gdb/infrun.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/infrun.c 2015-01-06 19:31:40.262986644 +0100
+++ gdb-7.8.50.20141228/gdb/infrun.c 2015-01-06 19:43:54.865219096 +0100
@@ -456,7 +456,7 @@ holding the child stopped. Try \"set de
remove_breakpoints_pid (ptid_get_pid (inferior_ptid));
}
- if (info_verbose || debug_infrun)
+ if (1 /* Fedora Bug 235197 */ || info_verbose || debug_infrun)
{
target_terminal_ours_for_output ();
fprintf_filtered (gdb_stdlog,

View File

@ -21,11 +21,11 @@
Port to GDB-6.8pre.
Index: gdb-7.7.90.20140613/gdb/infrun.c
Index: gdb-7.8.50.20141228/gdb/infrun.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/infrun.c 2014-06-13 03:59:36.000000000 +0200
+++ gdb-7.7.90.20140613/gdb/infrun.c 2014-06-13 21:36:43.637294782 +0200
@@ -84,7 +84,7 @@ static int follow_fork (void);
--- gdb-7.8.50.20141228.orig/gdb/infrun.c 2014-12-28 21:33:41.301547880 +0100
+++ gdb-7.8.50.20141228/gdb/infrun.c 2015-01-01 17:00:08.212920690 +0100
@@ -86,7 +86,7 @@ static void follow_inferior_reset_breakp
static void set_schedlock_func (char *args, int from_tty,
struct cmd_list_element *c);
@ -34,17 +34,16 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
static void xdb_handle_command (char *args, int from_tty);
@@ -1742,7 +1742,8 @@ user_visible_resume_ptid (int step)
@@ -1998,7 +1998,7 @@ user_visible_resume_ptid (int step)
resume_ptid = inferior_ptid;
}
else if ((scheduler_mode == schedlock_on)
|| (scheduler_mode == schedlock_step
- && (step || singlestep_breakpoints_inserted_p)))
+ && (step == RESUME_STEP_USER
+ || singlestep_breakpoints_inserted_p)))
- || (scheduler_mode == schedlock_step && step))
+ || (scheduler_mode == schedlock_step && step == RESUME_STEP_USER))
{
/* User-settable 'scheduler' mode requires solo thread resume. */
resume_ptid = inferior_ptid;
@@ -1760,7 +1761,7 @@ user_visible_resume_ptid (int step)
@@ -2022,7 +2022,7 @@ user_visible_resume_ptid (int step)
STEP nonzero if we should step (zero to continue instead).
SIG is the signal to give the inferior (zero for none). */
void
@ -53,7 +52,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
{
struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
struct regcache *regcache = get_current_regcache ();
@@ -1800,9 +1801,13 @@ resume (int step, enum gdb_signal sig)
@@ -2064,9 +2064,13 @@ resume (int step, enum gdb_signal sig)
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
@ -69,7 +68,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
tp->control.trap_expected,
target_pid_to_str (inferior_ptid),
paddress (gdbarch, pc));
@@ -2188,6 +2193,7 @@ proceed (CORE_ADDR addr, enum gdb_signal
@@ -2543,6 +2547,7 @@ proceed (CORE_ADDR addr, enum gdb_signal
struct thread_info *tp;
CORE_ADDR pc;
struct address_space *aspace;
@ -77,7 +76,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
/* If we're stopped at a fork/vfork, follow the branch set by the
"set follow-fork-mode" command; otherwise, we'll just proceed
@@ -2230,13 +2236,19 @@ proceed (CORE_ADDR addr, enum gdb_signal
@@ -2586,13 +2591,19 @@ proceed (CORE_ADDR addr, enum gdb_signal
Note, we don't do this in reverse, because we won't
actually be executing the breakpoint insn anyway.
We'll be (un-)executing the previous instruction. */
@ -97,7 +96,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
}
else
{
@@ -2288,6 +2300,7 @@ proceed (CORE_ADDR addr, enum gdb_signal
@@ -2647,6 +2658,7 @@ proceed (CORE_ADDR addr, enum gdb_signal
tp->prev_pc = regcache_read_pc (get_current_regcache ());
switch_to_thread (step_over->ptid);
tp = step_over;
@ -105,9 +104,9 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
}
}
@@ -2375,9 +2388,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
/* Reset to normal state. */
init_infwait_state ();
@@ -2699,9 +2711,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
correctly when the inferior is stopped. */
tp->prev_pc = regcache_read_pc (get_current_regcache ());
+ if (tp->control.trap_expected || step)
+ resume_step = RESUME_STEP_USER;
@ -121,7 +120,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
/* Wait for it to stop (if not standalone)
and in any case decode why it stopped, and act accordingly. */
@@ -5359,13 +5376,16 @@ switch_back_to_stepped_thread (struct ex
@@ -5674,14 +5690,16 @@ switch_back_to_stepped_thread (struct ex
/* Is thread TP in the middle of single-stepping? */
@ -133,6 +132,7 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
+ if ((tp->control.step_range_end
&& tp->control.step_resume_breakpoint == NULL)
- || tp->control.trap_expected
- || tp->stepped_breakpoint
- || bpstat_should_step ());
+ || tp->control.trap_expected)
+ return RESUME_STEP_USER;
@ -142,11 +142,11 @@ Index: gdb-7.7.90.20140613/gdb/infrun.c
}
/* Inferior has stepped into a subroutine call with source code that
Index: gdb-7.7.90.20140613/gdb/linux-nat.c
Index: gdb-7.8.50.20141228/gdb/linux-nat.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/linux-nat.c 2014-06-13 03:59:37.000000000 +0200
+++ gdb-7.7.90.20140613/gdb/linux-nat.c 2014-06-13 21:31:19.449949814 +0200
@@ -2709,7 +2709,11 @@ static int
--- gdb-7.8.50.20141228.orig/gdb/linux-nat.c 2014-12-28 21:33:41.303547882 +0100
+++ gdb-7.8.50.20141228/gdb/linux-nat.c 2014-12-28 21:33:45.827551687 +0100
@@ -2519,7 +2519,11 @@ static int
select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
{
if (lp->last_resume_kind == resume_step
@ -159,10 +159,10 @@ Index: gdb-7.7.90.20140613/gdb/linux-nat.c
return 1;
else
return 0;
Index: gdb-7.7.90.20140613/gdb/linux-nat.h
Index: gdb-7.8.50.20141228/gdb/linux-nat.h
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/linux-nat.h 2014-06-13 03:59:37.000000000 +0200
+++ gdb-7.7.90.20140613/gdb/linux-nat.h 2014-06-13 21:31:19.449949814 +0200
--- gdb-7.8.50.20141228.orig/gdb/linux-nat.h 2014-12-28 21:33:41.304547882 +0100
+++ gdb-7.8.50.20141228/gdb/linux-nat.h 2014-12-28 21:33:45.827551687 +0100
@@ -18,6 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
@ -182,11 +182,11 @@ Index: gdb-7.7.90.20140613/gdb/linux-nat.h
/* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data
watchpoint trap. */
Index: gdb-7.7.90.20140613/gdb/infrun.h
Index: gdb-7.8.50.20141228/gdb/infrun.h
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/infrun.h 2014-06-13 03:59:36.000000000 +0200
+++ gdb-7.7.90.20140613/gdb/infrun.h 2014-06-13 21:31:19.449949814 +0200
@@ -89,7 +89,14 @@ extern void proceed (CORE_ADDR, enum gdb
--- gdb-7.8.50.20141228.orig/gdb/infrun.h 2014-12-28 21:33:45.827551687 +0100
+++ gdb-7.8.50.20141228/gdb/infrun.h 2014-12-28 21:34:13.516574981 +0100
@@ -92,7 +92,14 @@ extern void proceed (CORE_ADDR, enum gdb
/* The `resume' routine should only be called in special circumstances.
Normally, use `proceed', which handles a lot of bookkeeping. */
@ -200,12 +200,12 @@ Index: gdb-7.7.90.20140613/gdb/infrun.h
+ };
+extern void resume (enum resume_step, enum gdb_signal);
extern ptid_t user_visible_resume_ptid (int step);
diff --git a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
index 2a30604..ee1fd11 100644
--- a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
+++ b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
/* Return a ptid representing the set of threads that we will proceed,
in the perspective of the user/frontend. */
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp 2014-12-28 21:33:41.304547882 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp 2014-12-28 21:33:45.827551687 +0100
@@ -97,7 +97,7 @@ gdb_test "set debug infrun 1"
gdb_test \

View File

@ -1,8 +1,8 @@
Index: gdb-7.7.90.20140613/gdb/linux-nat.c
Index: gdb-7.8.50.20141228/gdb/linux-nat.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/linux-nat.c 2014-06-13 23:03:34.364177614 +0200
+++ gdb-7.7.90.20140613/gdb/linux-nat.c 2014-06-13 23:05:07.749279122 +0200
@@ -178,6 +178,9 @@ blocked. */
--- gdb-7.8.50.20141228.orig/gdb/linux-nat.c 2015-01-05 22:52:01.115978026 +0100
+++ gdb-7.8.50.20141228/gdb/linux-nat.c 2015-01-05 22:52:23.147074710 +0100
@@ -174,6 +174,9 @@ blocked. */
static struct target_ops *linux_ops;
static struct target_ops linux_ops_saved;
@ -12,23 +12,7 @@ Index: gdb-7.7.90.20140613/gdb/linux-nat.c
/* The method to call, if any, when a new thread is attached. */
static void (*linux_nat_new_thread) (struct lwp_info *);
@@ -683,7 +686,14 @@ holding the child stopped. Try \"set de
parent_inf->waiting_for_vfork_done = 0;
}
else if (detach_fork)
- target_detach (NULL, 0);
+ {
+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
+ In this point of code it cannot be 1 as we would not get FORK
+ executed without CONTINUE first which resets PID_WAS_STOPPED.
+ We would have to first TARGET_STOP and WAITPID it as with running
+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
+ target_detach (NULL, 0);
+ }
/* Note that the detach above makes PARENT_INF dangling. */
@@ -1107,6 +1117,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
@@ -915,6 +918,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
"LNPAW: Attaching to a stopped process\n");
@ -36,7 +20,7 @@ Index: gdb-7.7.90.20140613/gdb/linux-nat.c
/* The process is definitely stopped. It is in a job control
stop, unless the kernel predates the TASK_STOPPED /
@@ -1529,6 +1540,9 @@ get_pending_status (struct lwp_info *lp,
@@ -1337,6 +1341,9 @@ get_pending_status (struct lwp_info *lp,
gdb_signal_to_string (signo));
}
@ -46,7 +30,7 @@ Index: gdb-7.7.90.20140613/gdb/linux-nat.c
return 0;
}
@@ -1642,6 +1656,8 @@ linux_nat_detach (struct target_ops *ops
@@ -1450,6 +1457,8 @@ linux_nat_detach (struct target_ops *ops
}
else
linux_ops->to_detach (ops, args, from_tty);
@ -55,7 +39,7 @@ Index: gdb-7.7.90.20140613/gdb/linux-nat.c
}
/* Resume LP. */
@@ -1824,6 +1840,14 @@ linux_nat_resume (struct target_ops *ops
@@ -1631,6 +1640,14 @@ linux_nat_resume (struct target_ops *ops
return;
}
@ -70,7 +54,7 @@ Index: gdb-7.7.90.20140613/gdb/linux-nat.c
if (resume_many)
iterate_over_lwps (ptid, linux_nat_resume_callback, lp);
@@ -3870,6 +3894,8 @@ linux_nat_mourn_inferior (struct target_
@@ -3696,6 +3713,8 @@ linux_nat_mourn_inferior (struct target_
/* Let the arch-specific native code know this process is gone. */
linux_nat_forget_process (pid);
@ -79,10 +63,10 @@ Index: gdb-7.7.90.20140613/gdb/linux-nat.c
}
/* Convert a native/host siginfo object, into/from the siginfo in the
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.threads/attach-stopped.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.threads/attach-stopped.exp
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2014-06-13 23:03:34.365177615 +0200
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.threads/attach-stopped.exp 2014-06-13 23:03:37.162180660 +0200
--- gdb-7.8.50.20141228.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2015-01-05 22:52:01.115978026 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.threads/attach-stopped.exp 2015-01-05 22:52:23.148074714 +0100
@@ -61,7 +61,65 @@ proc corefunc { threadtype } {
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
@ -150,3 +134,19 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.threads/attach-stopped.exp
set test "$threadtype: attach2 to stopped, after setting file"
gdb_test_multiple "attach $testpid" "$test" {
Index: gdb-7.8.50.20141228/gdb/infrun.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/infrun.c 2015-01-05 22:42:48.773501429 +0100
+++ gdb-7.8.50.20141228/gdb/infrun.c 2015-01-05 22:53:47.274443903 +0100
@@ -600,6 +600,11 @@ holding the child stopped. Try \"set de
child_pid);
}
+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
+ In this point of code it cannot be 1 as we would not get FORK
+ executed without CONTINUE first which resets PID_WAS_STOPPED.
+ We would have to first TARGET_STOP and WAITPID it as with running
+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */
target_detach (NULL, 0);
}

View File

@ -0,0 +1,49 @@
http://sourceware.org/ml/gdb-patches/2015-01/msg00198.html
Subject: [PATCH] [PR corefiles/17808] i386: Fix internal error when prstatus in core file is too big
As reported in PR 17808, a test case with a forged (invalid) core file
can crash GDB with an assertion failure. In that particular case the
prstatus of an i386 core file looks like that from an AMD64 core file,
i.e., it is larger than GDB would expect.
The patch replaces the assertion by a warning and skips the invalid
core file register section. In this way it is guaranteed that no
bogus register values are read from the badly formatted section.
Note that this behavior deviates from the default policy: In general, if
some future kernel adds new registers to a register set, then a GDB
unaware of this extension would read the known subset and just ignore
the unknown bytes.
gdb/ChangeLog:
PR corefiles/17808
* i386-tdep.c (i386_supply_gregset): Instead of yielding an
internal error on unexpected input buffer size, ignore the data
and emit a warning.
---
gdb/i386-tdep.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 7d174c4..d02aaf2 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3727,7 +3727,12 @@ i386_supply_gregset (const struct regset *regset, struct regcache *regcache,
const gdb_byte *regs = gregs;
int i;
- gdb_assert (len == tdep->sizeof_gregset);
+ if (len != tdep->sizeof_gregset)
+ {
+ /* Buffer has unknown size: assume wrong format. */
+ warning (_("Bad size of general register section"));
+ return;
+ }
for (i = 0; i < tdep->gregset_num_regs; i++)
{
--
1.7.9.5

View File

@ -2,23 +2,24 @@ http://sourceware.org/gdb/wiki/ProjectArcher
http://sourceware.org/gdb/wiki/ArcherBranchManagement
GIT snapshot:
commit b88230edf4e2da948d633c283ba0893bf22bd7ae
commit ef5e5e4d5bfedecf54ef7f1380eaf89662b617d0
tromey/python
Index: gdb-7.8/README.archer
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8/README.archer 2014-07-29 19:29:04.861982779 +0200
diff --git a/README.archer b/README.archer
new file mode 100644
index 0000000..173b8ea
--- /dev/null
+++ b/README.archer
@@ -0,0 +1,2 @@
+This branch originally held the Python code for gdb. It still exists
+because a small amount of code here has not yet been merged upstream.
Index: gdb-7.8/gdb/Makefile.in
===================================================================
--- gdb-7.8.orig/gdb/Makefile.in 2014-07-29 19:29:02.665979655 +0200
+++ gdb-7.8/gdb/Makefile.in 2014-07-29 19:29:04.862982781 +0200
@@ -1476,6 +1476,12 @@ stamp-h: $(srcdir)/config.in config.stat
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index be69b6f..a4483e4 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1515,6 +1515,12 @@ stamp-h: $(srcdir)/config.in config.status
CONFIG_LINKS= \
$(SHELL) config.status
@ -31,35 +32,34 @@ Index: gdb-7.8/gdb/Makefile.in
config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
$(SHELL) config.status --recheck
Index: gdb-7.8/gdb/data-directory/Makefile.in
===================================================================
--- gdb-7.8.orig/gdb/data-directory/Makefile.in 2014-07-29 19:29:02.665979655 +0200
+++ gdb-7.8/gdb/data-directory/Makefile.in 2014-07-29 19:29:33.053022486 +0200
@@ -65,6 +65,8 @@ PYTHON_FILE_LIST = \
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index 00c70bb..f93ffdd 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -64,7 +64,10 @@ PYTHON_FILE_LIST = \
gdb/printing.py \
gdb/prompt.py \
gdb/xmethod.py \
+ gdb/types.py \
gdb/command/__init__.py \
+ gdb/command/ignore_errors.py \
+ gdb/command/pahole.py \
gdb/command/xmethods.py \
gdb/command/frame_filters.py \
gdb/command/type_printers.py \
@@ -74,7 +76,10 @@ PYTHON_FILE_LIST = \
@@ -74,6 +77,8 @@ PYTHON_FILE_LIST = \
gdb/function/__init__.py \
gdb/function/caller_is.py \
gdb/function/strfns.py \
gdb/printer/__init__.py \
- gdb/printer/bound_registers.py
+ gdb/printer/bound_registers.py \
+ gdb/function/caller_is.py \
+ gdb/function/in_scope.py \
+ gdb/types.py
gdb/printer/__init__.py \
gdb/printer/bound_registers.py
@HAVE_PYTHON_TRUE@PYTHON_FILES = $(PYTHON_FILE_LIST)
@HAVE_PYTHON_FALSE@PYTHON_FILES =
Index: gdb-7.8/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.8.orig/gdb/doc/gdb.texinfo 2014-07-29 19:29:02.675979669 +0200
+++ gdb-7.8/gdb/doc/gdb.texinfo 2014-07-29 19:29:04.871982794 +0200
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e086c33..5dfeb1d 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1225,6 +1225,16 @@ for remote debugging.
Run using @var{device} for your program's standard input and output.
@c FIXME: kingdon thinks there is more to -tty. Investigate.
@ -77,10 +77,10 @@ Index: gdb-7.8/gdb/doc/gdb.texinfo
@c resolve the situation of these eventually
@item -tui
@cindex @code{--tui}
Index: gdb-7.8/gdb/doc/python.texi
===================================================================
--- gdb-7.8.orig/gdb/doc/python.texi 2014-07-29 19:29:02.677979672 +0200
+++ gdb-7.8/gdb/doc/python.texi 2014-07-29 19:29:04.872982795 +0200
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 234ce5c..e940125 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -88,8 +88,6 @@ containing @code{end}. For example:
@smallexample
@ -90,10 +90,10 @@ Index: gdb-7.8/gdb/doc/python.texi
>print 23
>end
23
Index: gdb-7.8/gdb/gdb-gdb.gdb.in
===================================================================
--- gdb-7.8.orig/gdb/gdb-gdb.gdb.in 2014-07-29 19:29:02.677979672 +0200
+++ gdb-7.8/gdb/gdb-gdb.gdb.in 2014-07-29 19:29:04.872982795 +0200
diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
index 05a38b2..9801fdf 100644
--- a/gdb/gdb-gdb.gdb.in
+++ b/gdb/gdb-gdb.gdb.in
@@ -1,5 +1,15 @@
echo Setting up the environment for debugging gdb.\n
@ -110,11 +110,11 @@ Index: gdb-7.8/gdb/gdb-gdb.gdb.in
if !$gdb_init_done
set variable $gdb_init_done = 1
Index: gdb-7.8/gdb/main.c
===================================================================
--- gdb-7.8.orig/gdb/main.c 2014-07-29 19:29:02.678979673 +0200
+++ gdb-7.8/gdb/main.c 2014-07-29 19:29:04.872982795 +0200
@@ -37,6 +37,7 @@
diff --git a/gdb/main.c b/gdb/main.c
index accd927..ed211f6 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -33,6 +33,7 @@
#include "interps.h"
#include "main.h"
@ -122,7 +122,7 @@ Index: gdb-7.8/gdb/main.c
#include "source.h"
#include "cli/cli-cmds.h"
#include "objfiles.h"
@@ -417,6 +418,8 @@ captured_main (void *data)
@@ -444,6 +445,8 @@ captured_main (void *data)
char *cdarg = NULL;
char *ttyarg = NULL;
@ -131,7 +131,7 @@ Index: gdb-7.8/gdb/main.c
/* These are static so that we can take their address in an
initializer. */
static int print_help;
@@ -624,10 +627,14 @@ captured_main (void *data)
@@ -649,10 +652,14 @@ captured_main (void *data)
{"args", no_argument, &set_args, 1},
{"l", required_argument, 0, 'l'},
{"return-child-result", no_argument, &return_child_result, 1},
@ -147,7 +147,7 @@ Index: gdb-7.8/gdb/main.c
{
int option_index;
@@ -645,6 +652,9 @@ captured_main (void *data)
@@ -670,6 +677,9 @@ captured_main (void *data)
case 0:
/* Long option that just sets a flag. */
break;
@ -157,7 +157,7 @@ Index: gdb-7.8/gdb/main.c
case OPT_SE:
symarg = optarg;
execarg = optarg;
@@ -849,7 +859,31 @@ captured_main (void *data)
@@ -851,7 +861,31 @@ captured_main (void *data)
/* Now that gdb_init has created the initial inferior, we're in
position to set args for that inferior. */
@ -190,7 +190,7 @@ Index: gdb-7.8/gdb/main.c
{
/* The remaining options are the command-line options for the
inferior. The first one is the sym/exec file, and the rest
@@ -1135,7 +1169,8 @@ captured_main (void *data)
@@ -1129,7 +1163,8 @@ captured_main (void *data)
/* Read in the old history after all the command files have been
read. */
@ -200,7 +200,7 @@ Index: gdb-7.8/gdb/main.c
if (batch_flag)
{
@@ -1146,13 +1181,25 @@ captured_main (void *data)
@@ -1140,13 +1175,25 @@ captured_main (void *data)
/* Show time and/or space usage. */
do_cleanups (pre_stat_chain);
@ -232,7 +232,7 @@ Index: gdb-7.8/gdb/main.c
}
/* No exit -- exit is through quit_command. */
}
@@ -1186,6 +1233,12 @@ print_gdb_help (struct ui_file *stream)
@@ -1180,6 +1227,12 @@ print_gdb_help (struct ui_file *stream)
fputs_unfiltered (_("\
This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\
@ -245,7 +245,7 @@ Index: gdb-7.8/gdb/main.c
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
"), stream);
fputs_unfiltered (_("\
@@ -1231,6 +1284,13 @@ Output and user interface control:\n\n\
@@ -1225,6 +1278,13 @@ Output and user interface control:\n\n\
fputs_unfiltered (_("\
--dbx DBX compatibility mode.\n\
--xdb XDB compatibility mode.\n\
@ -259,10 +259,11 @@ Index: gdb-7.8/gdb/main.c
-q, --quiet, --silent\n\
Do not print version number on startup.\n\n\
"), stream);
Index: gdb-7.8/gdb/python/lib/gdb/command/ignore_errors.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8/gdb/python/lib/gdb/command/ignore_errors.py 2014-07-29 19:29:04.872982795 +0200
diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py
new file mode 100644
index 0000000..6fa48ff
--- /dev/null
+++ b/gdb/python/lib/gdb/command/ignore_errors.py
@@ -0,0 +1,37 @@
+# Ignore errors in user commands.
+
@ -301,10 +302,11 @@ Index: gdb-7.8/gdb/python/lib/gdb/command/ignore_errors.py
+ pass
+
+IgnoreErrorsCommand ()
Index: gdb-7.8/gdb/python/lib/gdb/command/pahole.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8/gdb/python/lib/gdb/command/pahole.py 2014-07-29 19:29:04.873982797 +0200
diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
new file mode 100644
index 0000000..636f99d
--- /dev/null
+++ b/gdb/python/lib/gdb/command/pahole.py
@@ -0,0 +1,81 @@
+# pahole command for gdb
+
@ -387,73 +389,11 @@ Index: gdb-7.8/gdb/python/lib/gdb/command/pahole.py
+ self.pahole (type, 0, '')
+
+Pahole()
Index: gdb-7.8/gdb/python/lib/gdb/function/caller_is.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8/gdb/python/lib/gdb/function/caller_is.py 2014-07-29 19:29:04.873982797 +0200
@@ -0,0 +1,58 @@
+# Caller-is functions.
+
+# Copyright (C) 2008 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/>.
+
+import gdb
+import re
+
+class CallerIs (gdb.Function):
+ """Return True if the calling function's name is equal to a string.
+This function takes one or two arguments.
+The first argument is the name of a function; if the calling function's
+name is equal to this argument, this function returns True.
+The optional second argument tells this function how many stack frames
+to traverse to find the calling function. The default is 1."""
+
+ def __init__ (self):
+ super (CallerIs, self).__init__ ("caller_is")
+
+ def invoke (self, name, nframes = 1):
+ frame = gdb.selected_frame ()
+ while nframes > 0:
+ frame = frame.older ()
+ nframes = nframes - 1
+ return frame.name () == name.string ()
+
+class CallerMatches (gdb.Function):
+ """Return True if the calling function's name matches a string.
+This function takes one or two arguments.
+The first argument is a regular expression; if the calling function's
+name is matched by this argument, this function returns True.
+The optional second argument tells this function how many stack frames
+to traverse to find the calling function. The default is 1."""
+
+ def __init__ (self):
+ super (CallerMatches, self).__init__ ("caller_matches")
+
+ def invoke (self, name, nframes = 1):
+ frame = gdb.selected_frame ()
+ while nframes > 0:
+ frame = frame.older ()
+ nframes = nframes - 1
+ return re.match (name.string (), frame.name ()) is not None
+
+CallerIs()
+CallerMatches()
Index: gdb-7.8/gdb/python/lib/gdb/function/in_scope.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8/gdb/python/lib/gdb/function/in_scope.py 2014-07-29 19:29:04.873982797 +0200
diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py
new file mode 100644
index 0000000..debb3bb
--- /dev/null
+++ b/gdb/python/lib/gdb/function/in_scope.py
@@ -0,0 +1,47 @@
+# In-scope function.
+
@ -502,11 +442,11 @@ Index: gdb-7.8/gdb/python/lib/gdb/function/in_scope.py
+ return wanted == found
+
+InScope ()
Index: gdb-7.8/gdb/python/python.c
===================================================================
--- gdb-7.8.orig/gdb/python/python.c 2014-07-29 19:29:02.679979674 +0200
+++ gdb-7.8/gdb/python/python.c 2014-07-29 19:29:04.873982797 +0200
@@ -95,6 +95,8 @@ const struct extension_language_defn ext
diff --git a/gdb/python/python.c b/gdb/python/python.c
index b1d8283..8eb8afe 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -93,6 +93,8 @@ const struct extension_language_defn extension_language_python =
#include "linespec.h"
#include "source.h"
#include "version.h"
@ -515,7 +455,7 @@ Index: gdb-7.8/gdb/python/python.c
#include "target.h"
#include "gdbthread.h"
#include "interps.h"
@@ -1222,6 +1224,56 @@ gdbpy_print_stack (void)
@@ -1220,6 +1222,56 @@ gdbpy_print_stack (void)
/* Return the current Progspace.
There always is one. */
@ -572,7 +512,7 @@ Index: gdb-7.8/gdb/python/python.c
static PyObject *
gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
@@ -1910,6 +1962,8 @@ static PyMethodDef GdbMethods[] =
@@ -1913,6 +1965,8 @@ static PyMethodDef GdbMethods[] =
Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
a Python String containing the output of the command if to_string is\n\
set to True." },
@ -581,10 +521,10 @@ Index: gdb-7.8/gdb/python/python.c
{ "parameter", gdbpy_parameter, METH_VARARGS,
"Return a gdb parameter's value" },
Index: gdb-7.8/gdb/python/python.h
===================================================================
--- gdb-7.8.orig/gdb/python/python.h 2014-07-29 19:29:02.679979674 +0200
+++ gdb-7.8/gdb/python/python.h 2014-07-29 19:29:04.873982797 +0200
diff --git a/gdb/python/python.h b/gdb/python/python.h
index 9e99992..c776e59 100644
--- a/gdb/python/python.h
+++ b/gdb/python/python.h
@@ -25,4 +25,6 @@
/* This is all that python exports to gdb. */
extern const struct extension_language_defn extension_language_python;
@ -592,10 +532,10 @@ Index: gdb-7.8/gdb/python/python.h
+extern void run_python_script (int argc, char **argv);
+
#endif /* GDB_PYTHON_H */
Index: gdb-7.8/gdb/testsuite/gdb.gdb/selftest.exp
===================================================================
--- gdb-7.8.orig/gdb/testsuite/gdb.gdb/selftest.exp 2014-07-29 19:29:02.679979674 +0200
+++ gdb-7.8/gdb/testsuite/gdb.gdb/selftest.exp 2014-07-29 19:29:04.874982798 +0200
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 0b11e12..e35e829 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} {
set description "step over cmdarg_vec initialization"
set command "step"
@ -607,21 +547,24 @@ Index: gdb-7.8/gdb/testsuite/gdb.gdb/selftest.exp
-re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" {
set description "next over make_command_stats_cleanup and everything it calls"
set command "next"
Index: gdb-7.8/gdb/testsuite/gdb.python/py-frame.exp
===================================================================
--- gdb-7.8.orig/gdb/testsuite/gdb.python/py-frame.exp 2014-07-29 19:29:02.680979676 +0200
+++ gdb-7.8/gdb/testsuite/gdb.python/py-frame.exp 2014-07-29 19:29:04.874982798 +0200
@@ -94,3 +94,5 @@ gdb_test "python print ('result = %s' %
gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.read_var - success"
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index e47f340..a7e0a52 100644
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r
gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame"
+
+gdb_test "python print ('result = %s' % (f0.block ()))" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
Index: gdb-7.8/gdb/testsuite/gdb.python/py-value.exp
===================================================================
--- gdb-7.8.orig/gdb/testsuite/gdb.python/py-value.exp 2014-07-29 19:29:02.680979676 +0200
+++ gdb-7.8/gdb/testsuite/gdb.python/py-value.exp 2014-07-29 19:29:04.874982798 +0200
@@ -385,6 +385,15 @@ proc test_value_after_death {} {
+
# Can read SP register.
gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
" = True" \
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index f081ff0..31b5910 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -388,6 +388,15 @@ proc test_value_after_death {} {
"print value's type"
}
@ -637,7 +580,7 @@ Index: gdb-7.8/gdb/testsuite/gdb.python/py-value.exp
# Regression test for invalid subscript operations. The bug was that
# the type of the value was not being checked before allowing a
# subscript operation to proceed.
@@ -514,6 +523,7 @@ test_value_in_inferior
@@ -517,6 +526,7 @@ test_value_in_inferior
test_inferior_function_call
test_lazy_strings
test_value_after_death

View File

@ -1,86 +0,0 @@
http://sourceware.org/ml/gdb-patches/2014-09/msg00381.html
Subject: [testsuite patch] runaway attach processes [Re: Regression: GDB stopped on run with attached process (PR 17347)]
--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Thu, 11 Sep 2014 14:35:53 +0200, Pedro Alves wrote:
> Thanks, pushed to both master and 7.8.
I have started seeing occasional runaway 'attach' processes these days.
I cannot be certain it is really caused by this patch, for example
grep 'FAIL.*cmdline attach run' does not show anything in my logs.
But as I remember this 'attach' runaway process always happened in GDB (but
I do not remember it in the past months) I think it would be most safe to just
solve it forever by [attached].
Jan
--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename=1
gdb/testsuite/
2014-09-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/attach.c: Include unistd.h.
(main): Call alarm. Add label postloop.
* gdb.base/attach.exp (do_attach_tests): Use gdb_get_line_number,
gdb_breakpoint, gdb_continue_to_breakpoint.
(test_command_line_attach_run): Kill ${testpid} in one exit path.
Index: gdb-7.8.1/gdb/testsuite/gdb.base/attach.c
===================================================================
--- gdb-7.8.1.orig/gdb/testsuite/gdb.base/attach.c 2014-10-30 20:23:01.311595725 +0100
+++ gdb-7.8.1/gdb/testsuite/gdb.base/attach.c 2014-10-30 20:23:38.653574999 +0100
@@ -5,6 +5,7 @@
exit unless/until gdb sets the variable to non-zero.)
*/
#include <stdio.h>
+#include <unistd.h>
int should_exit = 0;
@@ -12,9 +13,11 @@ int main ()
{
int local_i = 0;
+ alarm (60);
+
while (! should_exit)
{
local_i++;
}
- return 0;
+ return 0; /* postloop */
}
Index: gdb-7.8.1/gdb/testsuite/gdb.base/attach.exp
===================================================================
--- gdb-7.8.1.orig/gdb/testsuite/gdb.base/attach.exp 2014-10-30 20:23:01.311595725 +0100
+++ gdb-7.8.1/gdb/testsuite/gdb.base/attach.exp 2014-10-30 20:23:54.151562867 +0100
@@ -256,11 +256,8 @@ proc do_attach_tests {} {
# Verify that the modification really happened.
- gdb_test "tbreak 19" "Temporary breakpoint .*at.*$srcfile, line 19.*" \
- "after attach2, set tbreak postloop"
-
- gdb_test "continue" "main.*at.*$srcfile:19.*" \
- "after attach2, reach tbreak postloop"
+ gdb_breakpoint [gdb_get_line_number "postloop"] temporary
+ gdb_continue_to_breakpoint "postloop" ".* postloop .*"
# Allow the test process to exit, to cleanup after ourselves.
@@ -418,6 +415,7 @@ proc test_command_line_attach_run {} {
"-iex \"set height 0\" -iex \"set width 0\" --pid=$testpid -ex \"start\""]
if { $res != 0} {
fail $test
+ remote_exec build "kill -9 ${testpid}"
return $res
}
gdb_test_multiple "" $test {

View File

@ -37,11 +37,11 @@ gdb/gdbserver/
(linux_create_inferior, linux_tracefork_child): Call it instead of
direct ptrace.
Index: gdb-7.8.1/gdb/common/linux-ptrace.c
Index: gdb-7.8.50.20141228/gdb/nat/linux-ptrace.c
===================================================================
--- gdb-7.8.1.orig/gdb/common/linux-ptrace.c 2014-10-30 18:33:37.271097644 +0100
+++ gdb-7.8.1/gdb/common/linux-ptrace.c 2014-10-30 18:33:39.641092763 +0100
@@ -32,6 +32,10 @@
--- gdb-7.8.50.20141228.orig/gdb/nat/linux-ptrace.c 2015-01-01 21:38:14.691209094 +0100
+++ gdb-7.8.50.20141228/gdb/nat/linux-ptrace.c 2015-01-01 21:39:34.670157506 +0100
@@ -25,6 +25,10 @@
#include <stdint.h>
@ -52,7 +52,7 @@ Index: gdb-7.8.1/gdb/common/linux-ptrace.c
/* Stores the currently supported ptrace options. A value of
-1 means we did not check for features yet. A value of 0 means
there are no supported features. */
@@ -56,6 +60,8 @@ linux_ptrace_attach_fail_reason (pid_t p
@@ -53,6 +57,8 @@ linux_ptrace_attach_fail_reason (pid_t p
buffer_xml_printf (buffer, _("process %d is a zombie "
"- the process has already terminated"),
(int) pid);
@ -61,11 +61,10 @@ Index: gdb-7.8.1/gdb/common/linux-ptrace.c
}
#if defined __i386__ || defined __x86_64__
@@ -551,3 +557,19 @@ linux_ptrace_init_warnings (void)
@@ -568,6 +574,22 @@ linux_ptrace_init_warnings (void)
linux_ptrace_test_ret_to_nx ();
}
+
+/* Print all possible reasons we could fail to create a traced process. */
+
+void
@ -81,23 +80,27 @@ Index: gdb-7.8.1/gdb/common/linux-ptrace.c
+ "(gdb) shell sudo setsebool deny_ptrace=0"));
+#endif /* HAVE_LIBSELINUX */
+}
Index: gdb-7.8.1/gdb/common/linux-ptrace.h
+
/* Set additional ptrace flags to use. Some such flags may be checked
by the implementation above. This function must be called before
any other function in this file; otherwise the flags may not take
Index: gdb-7.8.50.20141228/gdb/nat/linux-ptrace.h
===================================================================
--- gdb-7.8.1.orig/gdb/common/linux-ptrace.h 2014-10-30 18:33:37.271097644 +0100
+++ gdb-7.8.1/gdb/common/linux-ptrace.h 2014-10-30 18:33:39.642092761 +0100
@@ -85,6 +85,7 @@ struct buffer;
--- gdb-7.8.50.20141228.orig/gdb/nat/linux-ptrace.h 2015-01-01 21:38:21.280204844 +0100
+++ gdb-7.8.50.20141228/gdb/nat/linux-ptrace.h 2015-01-01 21:39:00.542179519 +0100
@@ -90,6 +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_ptrace_create_warnings (struct buffer *buffer);
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);
Index: gdb-7.8.1/gdb/configure.ac
Index: gdb-7.8.50.20141228/gdb/configure.ac
===================================================================
--- gdb-7.8.1.orig/gdb/configure.ac 2014-10-30 18:33:37.272097642 +0100
+++ gdb-7.8.1/gdb/configure.ac 2014-10-30 18:33:39.643092759 +0100
@@ -2161,6 +2161,10 @@ case $host_os in
--- gdb-7.8.50.20141228.orig/gdb/configure.ac 2015-01-01 21:38:14.692209094 +0100
+++ gdb-7.8.50.20141228/gdb/configure.ac 2015-01-01 21:38:21.281204843 +0100
@@ -2116,6 +2116,10 @@ case $host_os in
esac
AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.])
@ -108,11 +111,11 @@ Index: gdb-7.8.1/gdb/configure.ac
dnl Handle optional features that can be enabled.
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
Index: gdb-7.8.1/gdb/gdbserver/configure.ac
Index: gdb-7.8.50.20141228/gdb/gdbserver/configure.ac
===================================================================
--- gdb-7.8.1.orig/gdb/gdbserver/configure.ac 2014-10-30 18:33:37.273097640 +0100
+++ gdb-7.8.1/gdb/gdbserver/configure.ac 2014-10-30 18:33:39.643092759 +0100
@@ -454,6 +454,10 @@ if $want_ipa ; then
--- gdb-7.8.50.20141228.orig/gdb/gdbserver/configure.ac 2015-01-01 21:38:14.693209093 +0100
+++ gdb-7.8.50.20141228/gdb/gdbserver/configure.ac 2015-01-01 21:38:21.281204843 +0100
@@ -461,6 +461,10 @@ if $want_ipa ; then
fi
fi
@ -123,11 +126,11 @@ Index: gdb-7.8.1/gdb/gdbserver/configure.ac
AC_SUBST(GDBSERVER_DEPFILES)
AC_SUBST(GDBSERVER_LIBS)
AC_SUBST(srv_xmlbuiltin)
Index: gdb-7.8.1/gdb/gdbserver/linux-low.c
Index: gdb-7.8.50.20141228/gdb/gdbserver/linux-low.c
===================================================================
--- gdb-7.8.1.orig/gdb/gdbserver/linux-low.c 2014-10-30 18:33:37.275097636 +0100
+++ gdb-7.8.1/gdb/gdbserver/linux-low.c 2014-10-30 18:33:39.644092757 +0100
@@ -541,6 +541,29 @@ add_lwp (ptid_t ptid)
--- gdb-7.8.50.20141228.orig/gdb/gdbserver/linux-low.c 2015-01-01 21:38:14.695209091 +0100
+++ gdb-7.8.50.20141228/gdb/gdbserver/linux-low.c 2015-01-01 21:38:21.282204843 +0100
@@ -537,6 +537,29 @@ add_lwp (ptid_t ptid)
return lwp;
}
@ -157,7 +160,7 @@ Index: gdb-7.8.1/gdb/gdbserver/linux-low.c
/* Start an inferior process and returns its pid.
ALLARGS is a vector of program-name and args. */
@@ -582,7 +605,7 @@ linux_create_inferior (char *program, ch
@@ -578,7 +601,7 @@ linux_create_inferior (char *program, ch
if (pid == 0)
{
close_most_fds ();
@ -166,11 +169,11 @@ Index: gdb-7.8.1/gdb/gdbserver/linux-low.c
#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */
signal (__SIGRTMIN + 1, SIG_DFL);
Index: gdb-7.8.1/gdb/inf-ptrace.c
Index: gdb-7.8.50.20141228/gdb/inf-ptrace.c
===================================================================
--- gdb-7.8.1.orig/gdb/inf-ptrace.c 2014-10-30 18:33:37.276097634 +0100
+++ gdb-7.8.1/gdb/inf-ptrace.c 2014-10-30 18:33:39.645092755 +0100
@@ -105,7 +105,15 @@ static void
--- gdb-7.8.50.20141228.orig/gdb/inf-ptrace.c 2015-01-01 21:38:14.695209091 +0100
+++ gdb-7.8.50.20141228/gdb/inf-ptrace.c 2015-01-01 21:38:21.282204843 +0100
@@ -66,7 +66,15 @@ static void
inf_ptrace_me (void)
{
/* "Trace me, Dr. Memory!" */
@ -186,11 +189,11 @@ Index: gdb-7.8.1/gdb/inf-ptrace.c
}
/* Start a new inferior Unix child process. EXEC_FILE is the file to
Index: gdb-7.8.1/gdb/linux-nat.c
Index: gdb-7.8.50.20141228/gdb/linux-nat.c
===================================================================
--- gdb-7.8.1.orig/gdb/linux-nat.c 2014-10-30 18:33:37.277097631 +0100
+++ gdb-7.8.1/gdb/linux-nat.c 2014-10-30 18:33:39.646092753 +0100
@@ -1291,6 +1291,7 @@ linux_nat_create_inferior (struct target
--- gdb-7.8.50.20141228.orig/gdb/linux-nat.c 2015-01-01 21:38:14.697209090 +0100
+++ gdb-7.8.50.20141228/gdb/linux-nat.c 2015-01-01 21:38:21.283204842 +0100
@@ -1099,6 +1099,7 @@ linux_nat_create_inferior (struct target
#ifdef HAVE_PERSONALITY
int personality_orig = 0, personality_set = 0;
#endif /* HAVE_PERSONALITY */
@ -198,7 +201,7 @@ Index: gdb-7.8.1/gdb/linux-nat.c
/* The fork_child mechanism is synchronous and calls target_wait, so
we have to mask the async mode. */
@@ -1315,7 +1316,10 @@ linux_nat_create_inferior (struct target
@@ -1123,7 +1124,10 @@ linux_nat_create_inferior (struct target
/* Make sure we report all signals during startup. */
linux_nat_pass_signals (ops, 0, NULL);
@ -210,7 +213,7 @@ Index: gdb-7.8.1/gdb/linux-nat.c
#ifdef HAVE_PERSONALITY
if (personality_set)
@@ -1327,6 +1331,24 @@ linux_nat_create_inferior (struct target
@@ -1135,6 +1139,24 @@ linux_nat_create_inferior (struct target
safe_strerror (errno));
}
#endif /* HAVE_PERSONALITY */
@ -235,11 +238,11 @@ Index: gdb-7.8.1/gdb/linux-nat.c
}
static void
Index: gdb-7.8.1/gdb/config.in
Index: gdb-7.8.50.20141228/gdb/config.in
===================================================================
--- gdb-7.8.1.orig/gdb/config.in 2014-10-30 18:33:37.278097630 +0100
+++ gdb-7.8.1/gdb/config.in 2014-10-30 18:34:36.165976366 +0100
@@ -216,6 +216,9 @@
--- gdb-7.8.50.20141228.orig/gdb/config.in 2015-01-01 21:38:14.697209090 +0100
+++ gdb-7.8.50.20141228/gdb/config.in 2015-01-01 21:38:21.284204842 +0100
@@ -213,6 +213,9 @@
/* Define if librpm library is being used. */
#undef HAVE_LIBRPM
@ -249,7 +252,7 @@ Index: gdb-7.8.1/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
@@ -351,6 +354,9 @@
@@ -342,6 +345,9 @@
/* Define to 1 if you have the `scm_new_smob' function. */
#undef HAVE_SCM_NEW_SMOB
@ -259,11 +262,11 @@ Index: gdb-7.8.1/gdb/config.in
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
Index: gdb-7.8.1/gdb/configure
Index: gdb-7.8.50.20141228/gdb/configure
===================================================================
--- gdb-7.8.1.orig/gdb/configure 2014-10-30 18:33:37.281097623 +0100
+++ gdb-7.8.1/gdb/configure 2014-10-30 18:33:39.649092747 +0100
@@ -13400,6 +13400,64 @@ cat >>confdefs.h <<_ACEOF
--- gdb-7.8.50.20141228.orig/gdb/configure 2015-01-01 21:38:14.701209087 +0100
+++ gdb-7.8.50.20141228/gdb/configure 2015-01-01 21:38:21.286204840 +0100
@@ -13269,6 +13269,64 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
@ -328,11 +331,11 @@ Index: gdb-7.8.1/gdb/configure
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
# except that the argument to --with-sysroot is optional.
Index: gdb-7.8.1/gdb/gdbserver/config.in
Index: gdb-7.8.50.20141228/gdb/gdbserver/config.in
===================================================================
--- gdb-7.8.1.orig/gdb/gdbserver/config.in 2014-10-30 18:33:37.282097621 +0100
+++ gdb-7.8.1/gdb/gdbserver/config.in 2014-10-30 18:33:39.649092747 +0100
@@ -81,6 +81,9 @@
--- gdb-7.8.50.20141228.orig/gdb/gdbserver/config.in 2015-01-01 21:38:14.702209087 +0100
+++ gdb-7.8.50.20141228/gdb/gdbserver/config.in 2015-01-01 21:38:39.365193179 +0100
@@ -75,6 +75,9 @@
/* Define to 1 if you have the `mcheck' library (-lmcheck). */
#undef HAVE_LIBMCHECK
@ -342,9 +345,9 @@ Index: gdb-7.8.1/gdb/gdbserver/config.in
/* Define if the target supports branch tracing. */
#undef HAVE_LINUX_BTRACE
@@ -154,6 +157,9 @@
/* Define to 1 if you have the `readlink' function. */
#undef HAVE_READLINK
@@ -142,6 +145,9 @@
/* Define to 1 if you have the `pwrite' function. */
#undef HAVE_PWRITE
+/* Define to 1 if you have the <selinux/selinux.h> header file. */
+#undef HAVE_SELINUX_SELINUX_H
@ -352,11 +355,11 @@ Index: gdb-7.8.1/gdb/gdbserver/config.in
/* Define to 1 if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H
Index: gdb-7.8.1/gdb/gdbserver/configure
Index: gdb-7.8.50.20141228/gdb/gdbserver/configure
===================================================================
--- gdb-7.8.1.orig/gdb/gdbserver/configure 2014-10-30 18:33:37.283097619 +0100
+++ gdb-7.8.1/gdb/gdbserver/configure 2014-10-30 18:33:39.650092745 +0100
@@ -6170,6 +6170,64 @@ if $want_ipa ; then
--- gdb-7.8.50.20141228.orig/gdb/gdbserver/configure 2015-01-01 21:38:14.704209086 +0100
+++ gdb-7.8.50.20141228/gdb/gdbserver/configure 2015-01-01 21:38:21.288204839 +0100
@@ -6199,6 +6199,64 @@ if $want_ipa ; then
fi
fi

View File

@ -1,8 +1,8 @@
Index: gdb-7.7.50.20140609/gdb/config/i386/linux64.mh
Index: gdb-7.8.50.20141228/gdb/config/i386/linux64.mh
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/config/i386/linux64.mh 2014-06-13 20:25:37.356732335 +0200
+++ gdb-7.7.50.20140609/gdb/config/i386/linux64.mh 2014-06-13 20:26:07.984764098 +0200
@@ -5,7 +5,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
--- gdb-7.8.50.20141228.orig/gdb/config/i386/linux64.mh 2015-01-01 17:12:53.965472227 +0100
+++ gdb-7.8.50.20141228/gdb/config/i386/linux64.mh 2015-01-01 17:12:55.367471414 +0100
@@ -6,7 +6,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
proc-service.o linux-thread-db.o linux-fork.o \
linux-procfs.o linux-ptrace.o linux-btrace.o \
linux-waitpid.o
@ -11,22 +11,22 @@ Index: gdb-7.7.50.20140609/gdb/config/i386/linux64.mh
NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the
Index: gdb-7.7.50.20140609/gdb/config/i386/linux.mh
Index: gdb-7.8.50.20141228/gdb/config/i386/linux.mh
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/config/i386/linux.mh 2014-06-13 20:25:37.356732335 +0200
+++ gdb-7.7.50.20140609/gdb/config/i386/linux.mh 2014-06-13 20:26:07.984764098 +0200
--- gdb-7.8.50.20141228.orig/gdb/config/i386/linux.mh 2015-01-01 17:12:55.367471414 +0100
+++ gdb-7.8.50.20141228/gdb/config/i386/linux.mh 2015-01-01 17:13:07.568464342 +0100
@@ -1,6 +1,6 @@
# Host: Intel 386 running GNU/Linux.
-NAT_FILE= config/nm-linux.h
+NAT_FILE= nm-linux.h
NATDEPFILES= inf-ptrace.o fork-child.o \
i386-nat.o i386-linux-nat.o \
x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \
proc-service.o linux-thread-db.o \
Index: gdb-7.7.50.20140609/gdb/config/i386/nm-linux.h
Index: gdb-7.8.50.20141228/gdb/config/i386/nm-linux.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/config/i386/nm-linux.h 2014-06-13 20:26:07.984764098 +0200
+++ gdb-7.8.50.20141228/gdb/config/i386/nm-linux.h 2015-01-01 17:12:55.368471414 +0100
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux i386.
+
@ -56,10 +56,10 @@ Index: gdb-7.7.50.20140609/gdb/config/i386/nm-linux.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
Index: gdb-7.7.50.20140609/gdb/config/i386/nm-linux64.h
Index: gdb-7.8.50.20141228/gdb/config/i386/nm-linux64.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/config/i386/nm-linux64.h 2014-06-13 20:26:07.984764098 +0200
+++ gdb-7.8.50.20141228/gdb/config/i386/nm-linux64.h 2015-01-01 17:12:55.368471414 +0100
@@ -0,0 +1,28 @@
+/* Native support for GNU/Linux amd64.
+
@ -89,11 +89,11 @@ Index: gdb-7.7.50.20140609/gdb/config/i386/nm-linux64.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+
+#endif /* NM_LINUX64_H */
Index: gdb-7.7.50.20140609/gdb/target.h
Index: gdb-7.8.50.20141228/gdb/target.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/target.h 2014-06-13 20:26:07.985764099 +0200
+++ gdb-7.7.50.20140609/gdb/target.h 2014-06-13 20:26:34.915792095 +0200
@@ -1728,9 +1728,11 @@ extern char *target_thread_name (struct
--- gdb-7.8.50.20141228.orig/gdb/target.h 2015-01-01 17:12:53.967472226 +0100
+++ gdb-7.8.50.20141228/gdb/target.h 2015-01-01 17:12:55.368471414 +0100
@@ -1754,9 +1754,11 @@ extern char *target_thread_name (struct
bp_hardware_breakpoint. CNT is the number of such watchpoints used so far
(including this one?). OTHERTYPE is who knows what... */
@ -105,10 +105,10 @@ Index: gdb-7.7.50.20140609/gdb/target.h
/* Returns the number of debug registers needed to watch the given
memory region, or zero if not supported. */
Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.50.20140609/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2014-06-13 20:26:07.986764101 +0200
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2015-01-01 17:12:55.369471413 +0100
@@ -0,0 +1,40 @@
+# Copyright 2009, 2010 Free Software Foundation, Inc.
+

View File

@ -0,0 +1,11 @@
--- gdb-7.8.50.20141228/gdb/compile/compile.c-orig 2014-12-28 02:48:43.000000000 +0100
+++ gdb-7.8.50.20141228/gdb/compile/compile.c 2015-01-05 23:03:33.383016039 +0100
@@ -172,7 +172,7 @@ do_rmdir (void *arg)
gdb_assert (strncmp (dir, TMP_PREFIX, strlen (TMP_PREFIX)) == 0);
zap = concat ("rm -rf ", dir, (char *) NULL);
- system (zap);
+ if (system (zap)) {}
}
/* Return the name of the temporary directory to use for .o files, and

View File

@ -1,9 +1,9 @@
https://bugzilla.redhat.com/show_bug.cgi?id=1020004
Index: gdb-7.8/gdb/data-directory/Makefile.in
Index: gdb-7.8.50.20141228/gdb/data-directory/Makefile.in
===================================================================
--- gdb-7.8.orig/gdb/data-directory/Makefile.in 2014-10-19 18:25:34.187110261 +0200
+++ gdb-7.8/gdb/data-directory/Makefile.in 2014-10-19 18:25:51.092121706 +0200
--- gdb-7.8.50.20141228.orig/gdb/data-directory/Makefile.in 2015-01-05 22:51:10.707756810 +0100
+++ gdb-7.8.50.20141228/gdb/data-directory/Makefile.in 2015-01-05 22:51:48.608923139 +0100
@@ -60,6 +60,8 @@ PYTHON_FILE_LIST = \
gdb/frames.py \
gdb/FrameIterator.py \
@ -13,18 +13,18 @@ Index: gdb-7.8/gdb/data-directory/Makefile.in
gdb/types.py \
gdb/printing.py \
gdb/prompt.py \
@@ -73,6 +75,7 @@ PYTHON_FILE_LIST = \
@@ -74,6 +76,7 @@ PYTHON_FILE_LIST = \
gdb/command/pretty_printers.py \
gdb/command/prompt.py \
gdb/command/explore.py \
+ gdb/command/backtrace.py \
gdb/function/__init__.py \
gdb/function/caller_is.py \
gdb/function/strfns.py \
gdb/printer/__init__.py \
Index: gdb-7.8/gdb/python/lib/gdb/FrameWrapper.py
Index: gdb-7.8.50.20141228/gdb/python/lib/gdb/FrameWrapper.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8/gdb/python/lib/gdb/FrameWrapper.py 2014-10-19 18:25:36.808112031 +0200
+++ gdb-7.8.50.20141228/gdb/python/lib/gdb/FrameWrapper.py 2015-01-05 22:51:24.706818245 +0100
@@ -0,0 +1,122 @@
+# Wrapper API for frames.
+
@ -148,10 +148,10 @@ Index: gdb-7.8/gdb/python/lib/gdb/FrameWrapper.py
+
+ def __getattr__ (self, name):
+ return getattr (self.frame, name)
Index: gdb-7.8/gdb/python/lib/gdb/backtrace.py
Index: gdb-7.8.50.20141228/gdb/python/lib/gdb/backtrace.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8/gdb/python/lib/gdb/backtrace.py 2014-10-19 18:25:36.808112031 +0200
+++ gdb-7.8.50.20141228/gdb/python/lib/gdb/backtrace.py 2015-01-05 22:51:24.706818245 +0100
@@ -0,0 +1,42 @@
+# Filtering backtrace.
+
@ -195,10 +195,10 @@ Index: gdb-7.8/gdb/python/lib/gdb/backtrace.py
+ return iter
+ return old_frame_filter (iter)
+
Index: gdb-7.8/gdb/python/lib/gdb/command/backtrace.py
Index: gdb-7.8.50.20141228/gdb/python/lib/gdb/command/backtrace.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8/gdb/python/lib/gdb/command/backtrace.py 2014-10-19 18:25:36.808112031 +0200
+++ gdb-7.8.50.20141228/gdb/python/lib/gdb/command/backtrace.py 2015-01-05 22:51:24.707818249 +0100
@@ -0,0 +1,106 @@
+# New backtrace command.
+

View File

@ -37,20 +37,20 @@ gdb/testsuite/ChangeLog:
gdb/testsuite/gdb.base/ena-dis-br.exp | 8 ++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index ccd05d9..5a0c5ab 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -14389,7 +14389,7 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *,
Index: gdb-7.8.50.20141228/gdb/breakpoint.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/breakpoint.c 2015-01-05 22:21:47.631801558 +0100
+++ gdb-7.8.50.20141228/gdb/breakpoint.c 2015-01-05 22:26:13.165005049 +0100
@@ -14849,7 +14849,7 @@ map_breakpoint_numbers (char *args, void
int match;
struct get_number_or_range_state state;
- if (args == 0)
+ if (args == 0 || *args == '\0')
error_no_arg (_("one or more breakpoint numbers"));
init_number_or_range (&state, args);
@@ -14713,7 +14713,12 @@ do_map_enable_count_breakpoint (struct breakpoint *bpt, void *countptr)
@@ -15186,7 +15186,12 @@ do_map_enable_count_breakpoint (struct b
static void
enable_count_command (char *args, int from_tty)
{
@ -61,17 +61,17 @@ index ccd05d9..5a0c5ab 100644
+ error_no_arg (_("hit count"));
+
+ count = get_number (&args);
map_breakpoint_numbers (args, do_map_enable_count_breakpoint, &count);
}
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
index b08b709..82aef64 100644
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -173,6 +173,14 @@ set bp [break_at $bp_location7 "line $bp_location7"]
set bp2 [break_at marker1 " line ($bp_location15|$bp_location16)"]
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.base/ena-dis-br.exp
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/testsuite/gdb.base/ena-dis-br.exp 2015-01-05 22:26:13.165005049 +0100
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.base/ena-dis-br.exp 2015-01-05 22:26:51.357178150 +0100
@@ -151,6 +151,14 @@ set bp [break_at $bp_location7 "line $bp
set bp2 [break_at marker1 " line $bp_location15"]
+gdb_test "enable count" \
+ "Argument required \\(hit count\\)\\." \
+ "enable count missing arguments"
@ -81,6 +81,5 @@ index b08b709..82aef64 100644
+ "enable count missing last argument"
+
gdb_test_no_output "enable count 2 $bp" "disable break with count"
gdb_test "continue" \

View File

@ -0,0 +1,40 @@
diff --git a/gdb/configure b/gdb/configure
index 7ff74ba..00a5b5b 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -7382,10 +7382,12 @@ _ACEOF
-if test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
- TARGET_PTR="unsigned long"
-elif test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
+# Try to keep TARGET_PTR the same across archs so that jit-reader.h file
+# content is the same for multilib distributions.
+if test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
TARGET_PTR="unsigned long long"
+elif test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
+ TARGET_PTR="unsigned long"
elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
TARGET_PTR="unsigned __int128"
else
diff --git a/gdb/configure.ac b/gdb/configure.ac
index ec776d7..c02ace9 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -648,10 +648,12 @@ AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(unsigned __int128)
-if test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
- TARGET_PTR="unsigned long"
-elif test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
+# Try to keep TARGET_PTR the same across archs so that jit-reader.h file
+# content is the same for multilib distributions.
+if test "x${ac_cv_sizeof_unsigned_long_long}" = "x8"; then
TARGET_PTR="unsigned long long"
+elif test "x${ac_cv_sizeof_unsigned_long}" = "x8"; then
+ TARGET_PTR="unsigned long"
elif test "x${ac_cv_sizeof_unsigned___int128}" = "x16"; then
TARGET_PTR="unsigned __int128"
else

View File

@ -0,0 +1,53 @@
http://sourceware.org/ml/gdb-patches/2015-01/msg00110.html
Subject: [testsuite patch] Fix new FAIL: py-frame.exp: test Frame.read_register(rip)
--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
for x86_64 -m32 run one gets:
+FAIL: gdb.python/py-frame.exp: test Frame.read_register(rip)
I do not have x32 OS here but the %rip test should PASS there I think.
OK for check-in?
The code is there since:
commit 5f3b99cfed3803f0b099152f54aac7cb90a2b926
Author: Sasha Smundak <asmundak@google.com>
Date: Wed Sep 3 16:34:47 2014 -0700
Add support for reading frame registers to Python API.
Jan
--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename=1
gdb/testsuite/
2015-01-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.python/py-frame.exp (test Frame.read_register(rip)): Use
is_amd64_regs_target.
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index bf2e1ce..984acfc 100644
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -106,7 +106,7 @@ gdb_test "python print ('result = %s' % (f0.read_register('pc') == f0.pc()))" \
"test Frame.read_register(pc)"
# On x86-64, PC is in $rip register.
-if {[istarget x86_64-*]} {
+if {[is_amd64_regs_target]} {
gdb_test "python print ('result = %s' % (f0.read_register('pc') == f0.read_register('rip')))" \
" = True" \
"test Frame.read_register(rip)"
--/04w6evG8XlLl3ft--

View File

@ -1,747 +0,0 @@
http://sourceware.org/ml/gdb-patches/2014-07/msg00002.html
Subject: Re: [PATCH] PR python/16699: GDB Python command completion with overriden complete vs. completer class
https://bugzilla.redhat.com/show_bug.cgi?id=1075199
On Wednesday, May 21 2014, Doug Evans wrote:
> Sergio Durigan Junior <sergiodj@redhat.com> writes:
>> [...]
>> Thanks. WDYT of the following patch?
>
> Hi.
>
> fwiw it's too bad the ability to plug in different completers isn't more,
> I dunno, parameterized (couldn't pick a better term, apologies -
> I thought of "object oriented" but that carries its own baggage).
> Performing completion obviously involves specifying more than a just
> single function (witness the comparison of the completer with specific
> functions).
Thanks for the reply, and sorry for the long delay in answering.
> Plus it's more than specifying brkchars.
> Witness code like this:
>
> /* Many commands which want to complete on
> file names accept several file names, as
> in "run foo bar >>baz". So we don't want
> to complete the entire text after the
> command, just the last word. To this
> end, we need to find the beginning of the
> file name by starting at `word' and going
> backwards. */
> for (p = word;
> p > tmp_command
> && strchr (gdb_completer_file_name_break_characters, p[-1]) == NULL;
> p--)
> ;
>
> IWBN if a "completer" object described how to do all these three things.
> Then the special case code for filename_completer (and location_completer)
> in completer.c could disappear. But maybe that's a patch for another day.
While I agree with you that the completion mechanism could be better (I
myself had a lot of trouble with it), I unfortunately don't have enough
time to tackle this problem now. So yeah, I think it will be a patch
for another day...
> Regarding the hack of using a static local to pass data from
> handle_brkchars to handle_completion, I know it's a hacky pragmatic
> choice. To get the reference counting right the code assumes that
> if the handle_brkchars phase is done then the handle_completion
> phase will be done too, right?
Yeah. This is true for the current code (well, except maybe for the
case you describe below...).
> I wonder if a SIGINT could sneak in
> there between the two passes (either today or tomorrow).
> Maybe the code in cmdpy_completer_helper for handle_brkchars_p could
> first check whether resultobj is already non-NULL, and decrement its
> reference count before setting it to NULL?
Yes, done (I think). Thanks for raising this issue.
> And cmdpy_completer_helper
> could be defined to return a borrowed reference to resultobj?
> Dunno, just thinking out loud.
Done, I guess.
> Something puzzles me though: If it's ok to cache the completion result from the
> handle_brkchars pass to the handle_completion pass, why have two passes?
> It feels like there must be a case where this caching of the result
> in a static local from one pass to the next won't work.
I'm not sure I follow.
It's OK to cache the result because handle_brkchars and
handle_completion work on the same set of data. In fact, we wouldn't
need to have two passes here; my previous patch didn't have two passes,
and worked fine. I just implemented it this way because Tom (correctly)
raised the point that the completion itself might be time-consuming, and
thus we could reuse its result in the two phases.
> Another question:
> I noticed complete_command doesn't do this two-phase dance
> of handle_brkchars followed by handle_completions. Should it?
> It just goes straight to handle_completions.
I don't think it should, because for complete_command (and
complete_filename et al) the handle_brkchars is already defined
internally by GDB. See:
...
/* Choose the default set of word break characters to break
completions. If we later find out that we are doing completions
on command strings (as opposed to strings supplied by the
individual command completer functions, which can be any string)
then we will switch to the special word break set for command
strings, which leaves out the '-' character used in some
commands. */
rl_completer_word_break_characters =
current_language->la_word_break_characters();
...
/* It is a normal command; what comes after it is
completed by the command's completer function. */
if (c->completer == filename_completer)
{
/* Many commands which want to complete on
file names accept several file names, as
in "run foo bar >>baz". So we don't want
to complete the entire text after the
command, just the last word. To this
end, we need to find the beginning of the
file name by starting at `word' and going
backwards. */
for (p = word;
p > tmp_command
&& strchr (gdb_completer_file_name_break_characters, p[-1]) == NULL;
p--)
;
rl_completer_word_break_characters =
gdb_completer_file_name_break_characters;
}
else if (c->completer == location_completer)
{
/* Commands which complete on locations want to
see the entire argument. */
for (p = word;
p > tmp_command
&& p[-1] != ' ' && p[-1] != '\t';
p--)
;
}
if (reason == handle_brkchars
&& c->completer_handle_brkchars != NULL)
(*c->completer_handle_brkchars) (c, p, word);
if (reason != handle_brkchars && c->completer != NULL)
list = (*c->completer) (c, p, word);
The complete_command function will only be called by the last "if"
clause, when reason != handle_brkchars. Otherwise,
complete_line_internal will just deal with handle_brkchars. And for
complete_command, the right value for rl_completer_word_break_characters
is what is attributed at the beginning of the function.
My patch implements this "two-phase" dance for Python because in this
specific case (i.e., a completion method defined in the Python script)
there is no way to know the value of handle_brkchars before we actually
do the completion itself.
In fact, my patch could probably be "simplified" and be made to call
cmdpy_completer directly (without any cmdpy_completer_handle_brkchars),
assuming that this function took care of filling handle_brkchars
correctly. What I mean is: when dealing with the handle_brkchars case,
the completer command can do anything it wants.
> [Maybe that explains the difference from using TAB. Dunno off hand.]
> It seems like complete_command is trying to hand-code its own
> handle_brkchars handling:
>
> static void
> complete_command (char *arg, int from_tty)
> {
> int argpoint;
> char *point, *arg_prefix;
> VEC (char_ptr) *completions;
>
> dont_repeat ();
>
> if (arg == NULL)
> arg = "";
> argpoint = strlen (arg);
>
> /* complete_line assumes that its first argument is somewhere
> within, and except for filenames at the beginning of, the word to
> be completed. The following crude imitation of readline's
> word-breaking tries to accomodate this. */
> point = arg + argpoint;
> while (point > arg)
> {
> if (strchr (rl_completer_word_break_characters, point[-1]) != 0)
> break;
> point--;
> }
>
> arg_prefix = alloca (point - arg + 1);
> memcpy (arg_prefix, arg, point - arg);
> arg_prefix[point - arg] = 0;
>
> completions = complete_line (point, arg, argpoint);
>
> ...
> }
Yes, it seems so, but I did not check further.
> TAB and the complete command should work identically of course,
> but for your testcase, maybe you should test both just to verify
> both work reasonably well (even if not identically).
> Given that complete_command doesn't do the two phase dance,
> does it work with your patch?
> Maybe it does, but IWBN to confirm that.
The 'complete' command does not work as it should with my patch:
(gdb) complete completefileinit /hom
completefileinit /home
(gdb) complete completefilemethod /hom
completefilemethod /home
But then, it also does not work without my patch either:
(gdb) complete file /hom
file /home
So I am not extending the testcase for now, because this bug needs to be
fixed first (and it is unrelated to the patch I am proposing).
WDYT of this version?
Thanks,
--
Sergio
GPG key ID: 65FC5E36
Please send encrypted e-mail if possible
http://blog.sergiodj.net/
gdb/
2014-06-30 Sergio Durigan Junior <sergiodj@redhat.com>
PR python/16699
* cli/cli-decode.c (set_cmd_completer_handle_brkchars): New
function.
(add_cmd): Set "completer_handle_brkchars" to NULL.
* cli/cli-decode.h (struct cmd_list_element)
<completer_handle_brkchars>: New field.
* command.h (completer_ftype_void): New typedef.
(set_cmd_completer_handle_brkchars): New prototype.
* completer.c (set_gdb_completion_word_break_characters): New
function.
(complete_line_internal): Call "completer_handle_brkchars"
callback from command.
* completer.h: Include "command.h".
(set_gdb_completion_word_break_characters): New prototype.
* python/py-cmd.c (cmdpy_completer_helper): New function.
(cmdpy_completer_handle_brkchars): New function.
(cmdpy_completer): Adjust to use cmdpy_completer_helper.
(cmdpy_init): Set completer_handle_brkchars to
cmdpy_completer_handle_brkchars.
gdb/testsuite/
2014-06-30 Sergio Durigan Junior <sergiodj@redhat.com>
PR python/16699
* gdb.python/py-completion.exp: New file.
* gdb.python/py-completion.py: Likewise.
Index: gdb-7.7.90.20140627/gdb/cli/cli-decode.c
===================================================================
--- gdb-7.7.90.20140627.orig/gdb/cli/cli-decode.c 2014-07-07 20:53:52.635106914 +0200
+++ gdb-7.7.90.20140627/gdb/cli/cli-decode.c 2014-07-07 20:53:55.429110207 +0200
@@ -164,6 +164,15 @@ set_cmd_completer (struct cmd_list_eleme
cmd->completer = completer; /* Ok. */
}
+/* See definition in commands.h. */
+
+void
+set_cmd_completer_handle_brkchars (struct cmd_list_element *cmd,
+ completer_ftype_void *completer_handle_brkchars)
+{
+ cmd->completer_handle_brkchars = completer_handle_brkchars;
+}
+
/* Add element named NAME.
Space for NAME and DOC must be allocated by the caller.
CLASS is the top level category into which commands are broken down
@@ -239,6 +248,7 @@ add_cmd (const char *name, enum command_
c->prefix = NULL;
c->abbrev_flag = 0;
set_cmd_completer (c, make_symbol_completion_list_fn);
+ c->completer_handle_brkchars = NULL;
c->destroyer = NULL;
c->type = not_set_cmd;
c->var = NULL;
Index: gdb-7.7.90.20140627/gdb/cli/cli-decode.h
===================================================================
--- gdb-7.7.90.20140627.orig/gdb/cli/cli-decode.h 2014-07-07 20:53:52.636106915 +0200
+++ gdb-7.7.90.20140627/gdb/cli/cli-decode.h 2014-07-07 20:53:55.429110207 +0200
@@ -176,6 +176,15 @@ struct cmd_list_element
"baz/foo", return "baz/foobar". */
completer_ftype *completer;
+ /* Handle the word break characters for this completer. Usually
+ this function need not be defined, but for some types of
+ completers (e.g., Python completers declared as methods inside
+ a class) the word break chars may need to be redefined
+ depending on the completer type (e.g., for filename
+ completers). */
+
+ completer_ftype_void *completer_handle_brkchars;
+
/* Destruction routine for this command. If non-NULL, this is
called when this command instance is destroyed. This may be
used to finalize the CONTEXT field, if needed. */
Index: gdb-7.7.90.20140627/gdb/command.h
===================================================================
--- gdb-7.7.90.20140627.orig/gdb/command.h 2014-07-07 20:53:52.636106915 +0200
+++ gdb-7.7.90.20140627/gdb/command.h 2014-07-07 20:53:55.430110208 +0200
@@ -158,8 +158,16 @@ extern void set_cmd_sfunc (struct cmd_li
typedef VEC (char_ptr) *completer_ftype (struct cmd_list_element *,
const char *, const char *);
+typedef void completer_ftype_void (struct cmd_list_element *,
+ const char *, const char *);
+
extern void set_cmd_completer (struct cmd_list_element *, completer_ftype *);
+/* Set the completer_handle_brkchars callback. */
+
+extern void set_cmd_completer_handle_brkchars (struct cmd_list_element *,
+ completer_ftype_void *);
+
/* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
around in cmd objects to test the value of the commands sfunc(). */
extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
Index: gdb-7.7.90.20140627/gdb/completer.c
===================================================================
--- gdb-7.7.90.20140627.orig/gdb/completer.c 2014-07-07 20:53:52.637106916 +0200
+++ gdb-7.7.90.20140627/gdb/completer.c 2014-07-07 20:53:55.430110208 +0200
@@ -450,6 +450,21 @@ expression_completer (struct cmd_list_el
return location_completer (ignore, p, word);
}
+/* See definition in completer.h. */
+
+void
+set_gdb_completion_word_break_characters (completer_ftype *fn)
+{
+ /* So far we are only interested in differentiating filename
+ completers from everything else. */
+ if (fn == filename_completer)
+ rl_completer_word_break_characters
+ = gdb_completer_file_name_break_characters;
+ else
+ rl_completer_word_break_characters
+ = gdb_completer_command_word_break_characters;
+}
+
/* Here are some useful test cases for completion. FIXME: These
should be put in the test suite. They should be tested with both
M-? and TAB.
@@ -678,6 +693,9 @@ complete_line_internal (const char *text
p--)
;
}
+ if (reason == handle_brkchars
+ && c->completer_handle_brkchars != NULL)
+ (*c->completer_handle_brkchars) (c, p, word);
if (reason != handle_brkchars && c->completer != NULL)
list = (*c->completer) (c, p, word);
}
@@ -751,6 +769,9 @@ complete_line_internal (const char *text
p--)
;
}
+ if (reason == handle_brkchars
+ && c->completer_handle_brkchars != NULL)
+ (*c->completer_handle_brkchars) (c, p, word);
if (reason != handle_brkchars && c->completer != NULL)
list = (*c->completer) (c, p, word);
}
Index: gdb-7.7.90.20140627/gdb/completer.h
===================================================================
--- gdb-7.7.90.20140627.orig/gdb/completer.h 2014-07-07 20:53:52.637106916 +0200
+++ gdb-7.7.90.20140627/gdb/completer.h 2014-07-07 20:54:13.297131831 +0200
@@ -18,6 +18,7 @@
#define COMPLETER_H 1
#include "gdb_vecs.h"
+#include "command.h"
extern VEC (char_ptr) *complete_line (const char *text,
char *line_buffer,
@@ -48,6 +49,13 @@ extern char *get_gdb_completer_quote_cha
extern char *gdb_completion_word_break_characters (void);
+/* Set the word break characters array to the corresponding set of
+ chars, based on FN. This function is useful for cases when the
+ completer doesn't know the type of the completion until some
+ calculation is done (e.g., for Python functions). */
+
+extern void set_gdb_completion_word_break_characters (completer_ftype *fn);
+
/* Exported to linespec.c */
extern const char *skip_quoted_chars (const char *, const char *,
Index: gdb-7.7.90.20140627/gdb/python/py-cmd.c
===================================================================
--- gdb-7.7.90.20140627.orig/gdb/python/py-cmd.c 2014-07-07 20:53:52.637106916 +0200
+++ gdb-7.7.90.20140627/gdb/python/py-cmd.c 2014-07-07 20:53:55.431110209 +0200
@@ -208,45 +208,155 @@ cmdpy_function (struct cmd_list_element
do_cleanups (cleanup);
}
+/* Helper function for the Python command completers (both "pure"
+ completer and brkchar handler). This function takes COMMAND, TEXT
+ and WORD and tries to call the Python method for completion with
+ these arguments. It also takes HANDLE_BRKCHARS_P, an argument to
+ identify whether it is being called from the brkchar handler or
+ from the "pure" completer. In the first case, it effectively calls
+ the Python method for completion, and records the PyObject in a
+ static variable (used as a "cache"). In the second case, it just
+ returns that variable, without actually calling the Python method
+ again. This saves us one Python method call.
+
+ It is important to mention that this function is built on the
+ assumption that the calls to cmdpy_completer_handle_brkchars and
+ cmdpy_completer will be subsequent with nothing intervening. This
+ is true for our completer mechanism.
+
+ This function returns the PyObject representing the Python method
+ call. */
+
+static PyObject *
+cmdpy_completer_helper (struct cmd_list_element *command,
+ const char *text, const char *word,
+ int handle_brkchars_p)
+{
+ cmdpy_object *obj = (cmdpy_object *) get_cmd_context (command);
+ PyObject *textobj, *wordobj;
+ /* This static variable will server as a "cache" for us, in order to
+ store the PyObject that results from calling the Python
+ function. */
+ static PyObject *resultobj = NULL;
+
+ if (handle_brkchars_p)
+ {
+ /* If we were called to handle brkchars, it means this is the
+ first function call of two that will happen in a row.
+ Therefore, we need to call the completer ourselves, and cache
+ the return value in the static variable RESULTOBJ. Then, in
+ the second call, we can just use the value of RESULTOBJ to do
+ our job. */
+ if (resultobj != NULL)
+ Py_DECREF (resultobj);
+
+ resultobj = NULL;
+ if (!obj)
+ error (_("Invalid invocation of Python command object."));
+ if (!PyObject_HasAttr ((PyObject *) obj, complete_cst))
+ {
+ /* If there is no complete method, don't error. */
+ return NULL;
+ }
+
+ textobj = PyUnicode_Decode (text, strlen (text), host_charset (), NULL);
+ if (!textobj)
+ error (_("Could not convert argument to Python string."));
+ wordobj = PyUnicode_Decode (word, sizeof (word), host_charset (), NULL);
+ if (!wordobj)
+ {
+ Py_DECREF (textobj);
+ error (_("Could not convert argument to Python string."));
+ }
+
+ resultobj = PyObject_CallMethodObjArgs ((PyObject *) obj, complete_cst,
+ textobj, wordobj, NULL);
+ Py_DECREF (textobj);
+ Py_DECREF (wordobj);
+ if (!resultobj)
+ {
+ /* Just swallow errors here. */
+ PyErr_Clear ();
+ }
+
+ Py_XINCREF (resultobj);
+ }
+
+ return resultobj;
+}
+
+/* Python function called to determine the break characters of a
+ certain completer. We are only interested in knowing if the
+ completer registered by the user will return one of the integer
+ codes (see COMPLETER_* symbols). */
+
+static void
+cmdpy_completer_handle_brkchars (struct cmd_list_element *command,
+ const char *text, const char *word)
+{
+ PyObject *resultobj = NULL;
+ struct cleanup *cleanup;
+
+ cleanup = ensure_python_env (get_current_arch (), current_language);
+
+ /* Calling our helper to obtain the PyObject of the Python
+ function. */
+ resultobj = cmdpy_completer_helper (command, text, word, 1);
+
+ /* Check if there was an error. */
+ if (resultobj == NULL)
+ goto done;
+
+ if (PyInt_Check (resultobj))
+ {
+ /* User code may also return one of the completion constants,
+ thus requesting that sort of completion. We are only
+ interested in this kind of return. */
+ long value;
+
+ if (!gdb_py_int_as_long (resultobj, &value))
+ {
+ /* Ignore. */
+ PyErr_Clear ();
+ }
+ else if (value >= 0 && value < (long) N_COMPLETERS)
+ {
+ /* This is the core of this function. Depending on which
+ completer type the Python function returns, we have to
+ adjust the break characters accordingly. */
+ set_gdb_completion_word_break_characters
+ (completers[value].completer);
+ }
+ }
+
+ done:
+
+ /* We do not call Py_XDECREF here because RESULTOBJ will be used in
+ the subsequent call to cmdpy_completer function. */
+ do_cleanups (cleanup);
+}
+
/* Called by gdb for command completion. */
static VEC (char_ptr) *
cmdpy_completer (struct cmd_list_element *command,
const char *text, const char *word)
{
- cmdpy_object *obj = (cmdpy_object *) get_cmd_context (command);
- PyObject *textobj, *wordobj, *resultobj = NULL;
+ PyObject *resultobj = NULL;
VEC (char_ptr) *result = NULL;
struct cleanup *cleanup;
cleanup = ensure_python_env (get_current_arch (), current_language);
- if (! obj)
- error (_("Invalid invocation of Python command object."));
- if (! PyObject_HasAttr ((PyObject *) obj, complete_cst))
- {
- /* If there is no complete method, don't error -- instead, just
- say that there are no completions. */
- goto done;
- }
-
- textobj = PyUnicode_Decode (text, strlen (text), host_charset (), NULL);
- if (! textobj)
- error (_("Could not convert argument to Python string."));
- wordobj = PyUnicode_Decode (word, strlen (word), host_charset (), NULL);
- if (! wordobj)
- error (_("Could not convert argument to Python string."));
-
- resultobj = PyObject_CallMethodObjArgs ((PyObject *) obj, complete_cst,
- textobj, wordobj, NULL);
- Py_DECREF (textobj);
- Py_DECREF (wordobj);
- if (! resultobj)
- {
- /* Just swallow errors here. */
- PyErr_Clear ();
- goto done;
- }
+ /* Calling our helper to obtain the PyObject of the Python
+ function. */
+ resultobj = cmdpy_completer_helper (command, text, word, 0);
+
+ /* If the result object of calling the Python function is NULL, it
+ means that there was an error. In this case, just give up and
+ return NULL. */
+ if (resultobj == NULL)
+ goto done;
result = NULL;
if (PyInt_Check (resultobj))
@@ -302,7 +412,6 @@ cmdpy_completer (struct cmd_list_element
done:
- Py_XDECREF (resultobj);
do_cleanups (cleanup);
return result;
@@ -548,6 +657,9 @@ cmdpy_init (PyObject *self, PyObject *ar
set_cmd_context (cmd, self);
set_cmd_completer (cmd, ((completetype == -1) ? cmdpy_completer
: completers[completetype].completer));
+ if (completetype == -1)
+ set_cmd_completer_handle_brkchars (cmd,
+ cmdpy_completer_handle_brkchars);
}
if (except.reason < 0)
{
Index: gdb-7.7.90.20140627/gdb/testsuite/gdb.python/py-completion.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140627/gdb/testsuite/gdb.python/py-completion.exp 2014-07-07 20:53:55.431110209 +0200
@@ -0,0 +1,70 @@
+# Copyright (C) 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/>.
+
+set testfile "py-completion"
+
+load_lib gdb-python.exp
+
+gdb_exit
+gdb_start
+
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
+
+gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py"
+
+# Create a temporary directory
+set testdir "${objdir}/${subdir}/py-completion-testdir/"
+set testdir_regex [string_to_regexp $testdir]
+set testdir_complete "${objdir}/${subdir}/py-completion-test"
+file mkdir $testdir
+
+# This one should always pass.
+send_gdb "completefileinit ${testdir_complete}\t"
+gdb_test_multiple "" "completefileinit completion" {
+ -re "^completefileinit ${testdir_regex}$" {
+ pass "completefileinit completion"
+ }
+}
+
+# Just discarding whatever we typed.
+send_gdb "\n"
+gdb_test "print" ".*"
+
+# This is the problematic one.
+send_gdb "completefilemethod ${testdir_complete}\t"
+gdb_test_multiple "" "completefilemethod completion" {
+ -re "^completefilemethod ${testdir_regex} $" {
+ fail "completefilemethod completion (completed filename as wrong command arg)"
+ }
+ -re "^completefilemethod ${testdir_regex}$" {
+ pass "completefilemethod completion"
+ }
+}
+
+# Discarding again
+send_gdb "\n"
+gdb_test "print" ".*"
+
+# Another problematic
+send_gdb "completefilecommandcond ${objdir}/${subdir}/py-completion-t\t"
+gdb_test_multiple "" "completefilecommandcond completion" {
+ -re "^completefilecommandcond ${testdir}$" {
+ fail "completefilecommandcond completion (completed filename instead of command)"
+ }
+ -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" {
+ pass "completefilecommandcond completion"
+ }
+}
Index: gdb-7.7.90.20140627/gdb/testsuite/gdb.python/py-completion.py
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140627/gdb/testsuite/gdb.python/py-completion.py 2014-07-07 20:53:55.431110209 +0200
@@ -0,0 +1,58 @@
+# Copyright (C) 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 testcase tests PR python/16699
+
+import gdb
+
+class CompleteFileInit(gdb.Command):
+ def __init__(self):
+ gdb.Command.__init__(self,'completefileinit',gdb.COMMAND_USER,gdb.COMPLETE_FILENAME)
+
+ def invoke(self,argument,from_tty):
+ raise gdb.GdbError('not implemented')
+
+class CompleteFileMethod(gdb.Command):
+ def __init__(self):
+ gdb.Command.__init__(self,'completefilemethod',gdb.COMMAND_USER)
+
+ def invoke(self,argument,from_tty):
+ raise gdb.GdbError('not implemented')
+
+ def complete(self,text,word):
+ return gdb.COMPLETE_FILENAME
+
+class CompleteFileCommandCond(gdb.Command):
+ def __init__(self):
+ gdb.Command.__init__(self,'completefilecommandcond',gdb.COMMAND_USER)
+
+ def invoke(self,argument,from_tty):
+ raise gdb.GdbError('not implemented')
+
+ def complete(self,text,word):
+ # This is a test made to know if the command
+ # completion still works fine. When the user asks to
+ # complete something like "completefilecommandcond
+ # /path/to/py-completion-t", it should not complete to
+ # "/path/to/py-completion-test/", but instead just
+ # wait for input.
+ if "py-completion-t" in text:
+ return gdb.COMPLETE_COMMAND
+ else:
+ return gdb.COMPLETE_FILENAME
+
+CompleteFileInit()
+CompleteFileMethod()
+CompleteFileCommandCond()

View File

@ -1,72 +0,0 @@
http://sourceware.org/ml/gdb-patches/2014-07/msg00154.html
Subject: Re: [PATCH] PR python/16699: GDB Python command completion with overriden complete vs. completer class
--pWyiEgJYm5f9v55/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Tue, 08 Jul 2014 17:32:21 +0200, Jan Kratochvil wrote:
> - -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" {
> + -re "^completefilecommandcond ${completion_regex}$" {
There was a racy bug here - and even in the former test - here should be:
+ -re "^completefilecommandcond ${completion_regex}\007$" {
Updated fix attached.
Jan
--pWyiEgJYm5f9v55/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="py-completion-race2.patch"
--- ./gdb/testsuite/gdb.python/py-completion.exp-orig 2014-07-07 21:32:17.891045058 +0200
+++ ./gdb/testsuite/gdb.python/py-completion.exp 2014-07-08 20:14:57.189791928 +0200
@@ -26,9 +26,9 @@ if { [skip_python_tests] } { continue }
gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py"
# Create a temporary directory
-set testdir "${objdir}/${subdir}/py-completion-testdir/"
+set testdir "[standard_output_file "py-completion-testdir"]/"
set testdir_regex [string_to_regexp $testdir]
-set testdir_complete "${objdir}/${subdir}/py-completion-test"
+set testdir_complete [standard_output_file "py-completion-test"]
file mkdir $testdir
# This one should always pass.
@@ -40,8 +40,7 @@ gdb_test_multiple "" "completefileinit c
}
# Just discarding whatever we typed.
-send_gdb "\n"
-gdb_test "print" ".*"
+gdb_test " " ".*" "discard #1"
# This is the problematic one.
send_gdb "completefilemethod ${testdir_complete}\t"
@@ -55,16 +54,16 @@ gdb_test_multiple "" "completefilemethod
}
# Discarding again
-send_gdb "\n"
-gdb_test "print" ".*"
+gdb_test " " ".*" "discard #2"
# Another problematic
-send_gdb "completefilecommandcond ${objdir}/${subdir}/py-completion-t\t"
+set completion_regex "[string_to_regexp [standard_output_file "py-completion-t"]]"
+send_gdb "completefilecommandcond [standard_output_file "py-completion-t\t"]"
gdb_test_multiple "" "completefilecommandcond completion" {
-re "^completefilecommandcond ${testdir}$" {
fail "completefilecommandcond completion (completed filename instead of command)"
}
- -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" {
+ -re "^completefilecommandcond ${completion_regex}\007$" {
pass "completefilecommandcond completion"
}
}
--pWyiEgJYm5f9v55/--

View File

@ -1,90 +0,0 @@
http://sourceware.org/ml/gdb-patches/2014-06/msg00737.html
Subject: [patch] Fix --with-system-readline with readline-6.3 patch 5
--BXVAT5kNtrzKuDFl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
I have filed now:
--with-system-readline uses bundled readline include files
https://sourceware.org/bugzilla/show_bug.cgi?id=17077
To see any effect of the patch below you have to do:
rm -rf readline
Otherwise readline include files get used the bundled ones from GDB which are
currently 6.2 while system readline may be 6.3 already.
You also have to use system readline-6.3 including its upstream patch:
[Bug-readline] Readline-6.3 Official Patch 5
http://lists.gnu.org/archive/html/bug-readline/2014-04/msg00018.html
Message-ID: <140415125618.AA57598.SM@caleb.ins.cwru.edu>
In short it happens on Fedora Rawhide since:
readline-6.3-1.fc21
https://koji.fedoraproject.org/koji/buildinfo?buildID=538941
The error is:
https://kojipkgs.fedoraproject.org//work/tasks/9890/7059890/build.log
../../gdb/tui/tui-io.c:132:1: error: 'Function' is deprecated [-Werror=deprecated-declarations]
static Function *tui_old_rl_getc_function;
^
../../gdb/tui/tui-io.c:133:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations]
static VFunction *tui_old_rl_redisplay_function;
^
../../gdb/tui/tui-io.c:134:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations]
static VFunction *tui_old_rl_prep_terminal;
^
../../gdb/tui/tui-io.c:135:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations]
static VFunction *tui_old_rl_deprep_terminal;
^
It is since bash change:
lib/readline/rltypedefs.h
- remove old Function/VFunction/CPFunction/CPPFunction typedefs as
suggested by Tom Tromey <tromey@redhat.com>
The new typedefs used below are present in readline/rltypedefs.h since:
git://git.savannah.gnu.org/bash.git
commit 28ef6c316f1aff914bb95ac09787a3c83c1815fd
Date: Fri Apr 6 19:14:31 2001 +0000
Jan
--BXVAT5kNtrzKuDFl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="tuireadline.patch"
gdb/
2014-06-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix --with-system-readline with readline-6.3 patch 5.
* tui/tui-io.c (tui_old_rl_getc_function, tui_old_rl_redisplay_function)
(tui_old_rl_prep_terminal, tui_old_rl_deprep_terminal): Use rl_*_t
types.
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 761d203..dcccb08 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -129,10 +129,10 @@ static struct ui_file *tui_old_stderr;
struct ui_out *tui_old_uiout;
/* Readline previous hooks. */
-static Function *tui_old_rl_getc_function;
-static VFunction *tui_old_rl_redisplay_function;
-static VFunction *tui_old_rl_prep_terminal;
-static VFunction *tui_old_rl_deprep_terminal;
+static rl_getc_func_t *tui_old_rl_getc_function;
+static rl_voidfunc_t *tui_old_rl_redisplay_function;
+static rl_vintfunc_t *tui_old_rl_prep_terminal;
+static rl_voidfunc_t *tui_old_rl_deprep_terminal;
static int tui_old_rl_echoing_p;
/* Readline output stream.
--BXVAT5kNtrzKuDFl--

View File

@ -1,136 +0,0 @@
Date: Thu, 13 Nov 2014 16:26:37 +0100
From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
To: gdb-patches at sourceware dot org
Cc: Jakub Filak <jfilak at redhat dot com>
Subject: [patch] Add add-auto-load-scripts-directory
--jho1yZJdad60DJr+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
there is already "add-auto-load-safe-path" which works
like "set auto-load safe-path" but in append mode.
There was missing an append equivalent for "set auto-load scripts-directory".
ABRT has directory /var/cache/abrt-di/ as an alternative one
to /usr/lib/debug/ . Therefore ABRT needs to use -iex parameters to add this
/var/cache/abrt-di/ directory as a first-class debuginfo directory.
Using absolute "set auto-load scripts-directory" would hard-code the path
possibly overriding local system directory additions; besides it would not be
nice anyway.
No regressions on {x86_64,x86_64-m32,i686}-fedora21-linux-gnu; although I have
seen some heavy regressions there today unrelated to this patch.
Thanks,
Jan
--jho1yZJdad60DJr+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="addautoload.patch"
gdb/
2014-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
Add add-auto-load-scripts-directory.
* NEWS (Changes since GDB 7.8): Add add-auto-load-scripts-directory.
* auto-load.c (add_auto_load_dir): New function.
(_initialize_auto_load): Install it.
gdb/doc/
2014-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
Add add-auto-load-scripts-directory.
* gdb.texinfo (Auto-loading): Add add-auto-load-scripts-directory link.
(objfile-gdbdotext file): Add add-auto-load-scripts-directory.
Index: gdb-7.6.1/gdb/NEWS
===================================================================
--- gdb-7.6.1.orig/gdb/NEWS
+++ gdb-7.6.1/gdb/NEWS
@@ -1,6 +1,12 @@
What has changed in GDB?
(Organized release by release)
+* New commands:
+
+add-auto-load-scripts-directory directory
+ Add entries to the list of directories from which to load auto-loaded
+ scripts.
+
*** Changes in GDB 7.8
* New command line options
Index: gdb-7.6.1/gdb/auto-load.c
===================================================================
--- gdb-7.6.1.orig/gdb/auto-load.c
+++ gdb-7.6.1/gdb/auto-load.c
@@ -298,6 +298,22 @@ Use 'set auto-load safe-path /' for disa
auto_load_safe_path_vec_update ();
}
+/* "add-auto-load-scripts-directory" command for the auto_load_dir configuration
+ variable. */
+
+static void
+add_auto_load_dir (char *args, int from_tty)
+{
+ char *s;
+
+ if (args == NULL || *args == 0)
+ error (_("Directory argument required."));
+
+ s = xstrprintf ("%s%c%s", auto_load_dir, DIRNAME_SEPARATOR, args);
+ xfree (auto_load_dir);
+ auto_load_dir = s;
+}
+
/* Implementation for filename_is_in_pattern overwriting the caller's FILENAME
and PATTERN. */
@@ -1295,6 +1311,15 @@ access the current full list setting."),
&cmdlist);
set_cmd_completer (cmd, filename_completer);
+ cmd = add_cmd ("add-auto-load-scripts-directory", class_support,
+ add_auto_load_dir,
+ _("Add entries to the list of directories from which to load "
+ "auto-loaded scripts.\n\
+See the commands 'set auto-load scripts-directory' and\n\
+'show auto-load scripts-directory' to access the current full list setting."),
+ &cmdlist);
+ set_cmd_completer (cmd, filename_completer);
+
add_setshow_boolean_cmd ("auto-load", class_maintenance,
&debug_auto_load, _("\
Set auto-load verifications debugging."), _("\
Index: gdb-7.6.1/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.6.1.orig/gdb/doc/gdb.texinfo
+++ gdb-7.6.1/gdb/doc/gdb.texinfo
@@ -21929,6 +21929,8 @@ These are @value{GDBN} control commands
@tab Control for @value{GDBN} auto-loaded scripts location.
@item @xref{show auto-load scripts-directory}.
@tab Show @value{GDBN} auto-loaded scripts location.
+@item @xref{add-auto-load-scripts-directory}.
+@tab Add directory for auto-loaded scripts location list.
@item @xref{set auto-load local-gdbinit}.
@tab Control for init file in the current directory.
@item @xref{show auto-load local-gdbinit}.
@@ -27213,6 +27215,12 @@ to the @env{PATH} environment variable.
@kindex show auto-load scripts-directory
@item show auto-load scripts-directory
Show @value{GDBN} auto-loaded scripts location.
+
+@anchor{add-auto-load-scripts-directory}
+@kindex add-auto-load-scripts-directory
+@item add-auto-load-scripts-directory @r{[}@var{directories}@r{]}
+Add an entry (or list of entries) to the list of auto-loaded scripts locations.
+Multiple entries may be delimited by the host platform path separator in use.
@end table
@value{GDBN} does not track which files it has already auto-loaded this way.

File diff suppressed because it is too large Load Diff

View File

@ -96,11 +96,11 @@ Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-wp.patch
Index: gdb-7.8/gdb/arm-linux-nat.c
Index: gdb-7.8.50.20141228/gdb/arm-linux-nat.c
===================================================================
--- gdb-7.8.orig/gdb/arm-linux-nat.c 2014-08-01 23:27:30.183773676 +0200
+++ gdb-7.8/gdb/arm-linux-nat.c 2014-08-01 23:27:30.241773754 +0200
@@ -1296,7 +1296,7 @@ arm_linux_stopped_by_watchpoint (struct
--- gdb-7.8.50.20141228.orig/gdb/arm-linux-nat.c 2015-01-05 22:10:30.170726774 +0100
+++ gdb-7.8.50.20141228/gdb/arm-linux-nat.c 2015-01-05 22:10:35.571751324 +0100
@@ -1295,7 +1295,7 @@ arm_linux_stopped_by_watchpoint (struct
static int
arm_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@ -109,11 +109,11 @@ Index: gdb-7.8/gdb/arm-linux-nat.c
{
return start <= addr && start + length - 1 >= addr;
}
Index: gdb-7.8/gdb/ppc-linux-nat.c
Index: gdb-7.8.50.20141228/gdb/ppc-linux-nat.c
===================================================================
--- gdb-7.8.orig/gdb/ppc-linux-nat.c 2014-08-01 23:27:30.202773701 +0200
+++ gdb-7.8/gdb/ppc-linux-nat.c 2014-08-01 23:29:38.311944925 +0200
@@ -1862,11 +1862,11 @@ can_use_watchpoint_cond_accel (void)
--- gdb-7.8.50.20141228.orig/gdb/ppc-linux-nat.c 2015-01-05 22:10:30.171726779 +0100
+++ gdb-7.8.50.20141228/gdb/ppc-linux-nat.c 2015-01-05 22:10:35.572751329 +0100
@@ -1860,11 +1860,11 @@ can_use_watchpoint_cond_accel (void)
CONDITION_VALUE will hold the value which should be put in the
DVC register. */
static void
@ -128,7 +128,7 @@ Index: gdb-7.8/gdb/ppc-linux-nat.c
CORE_ADDR addr_end_data, addr_end_dvc;
/* The DVC register compares bytes within fixed-length windows which
@@ -1953,7 +1953,7 @@ num_memory_accesses (struct value *v)
@@ -1951,7 +1951,7 @@ num_memory_accesses (struct value *v)
of the constant. */
static int
check_condition (CORE_ADDR watch_addr, struct expression *cond,
@ -137,7 +137,7 @@ Index: gdb-7.8/gdb/ppc-linux-nat.c
{
int pc = 1, num_accesses_left, num_accesses_right;
struct value *left_val, *right_val, *left_chain, *right_chain;
@@ -2021,7 +2021,7 @@ check_condition (CORE_ADDR watch_addr, s
@@ -2019,7 +2019,7 @@ check_condition (CORE_ADDR watch_addr, s
true. */
static int
ppc_linux_can_accel_watchpoint_condition (struct target_ops *self,
@ -146,7 +146,7 @@ Index: gdb-7.8/gdb/ppc-linux-nat.c
struct expression *cond)
{
CORE_ADDR data_value;
@@ -2038,7 +2038,7 @@ ppc_linux_can_accel_watchpoint_condition
@@ -2036,7 +2036,7 @@ ppc_linux_can_accel_watchpoint_condition
static void
create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
@ -155,7 +155,7 @@ Index: gdb-7.8/gdb/ppc-linux-nat.c
int insert)
{
if (len == 1
@@ -2304,7 +2304,7 @@ ppc_linux_stopped_by_watchpoint (struct
@@ -2302,7 +2302,7 @@ ppc_linux_stopped_by_watchpoint (struct
static int
ppc_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@ -164,11 +164,11 @@ Index: gdb-7.8/gdb/ppc-linux-nat.c
{
int mask;
Index: gdb-7.8/gdb/procfs.c
Index: gdb-7.8.50.20141228/gdb/procfs.c
===================================================================
--- gdb-7.8.orig/gdb/procfs.c 2014-08-01 23:27:30.203773703 +0200
+++ gdb-7.8/gdb/procfs.c 2014-08-01 23:27:30.243773756 +0200
@@ -2429,7 +2429,7 @@ procfs_address_to_host_pointer (CORE_ADD
--- gdb-7.8.50.20141228.orig/gdb/procfs.c 2015-01-05 22:10:30.172726783 +0100
+++ gdb-7.8.50.20141228/gdb/procfs.c 2015-01-05 22:10:35.573751333 +0100
@@ -2426,7 +2426,7 @@ procfs_address_to_host_pointer (CORE_ADD
#endif
static int
@ -177,7 +177,7 @@ Index: gdb-7.8/gdb/procfs.c
{
#if !defined (PCWATCH) && !defined (PIOCSWATCH)
/* If neither or these is defined, we can't support watchpoints.
@@ -4762,7 +4762,7 @@ procfs_pid_to_str (struct target_ops *op
@@ -4705,7 +4705,7 @@ procfs_pid_to_str (struct target_ops *op
/* Insert a watchpoint. */
static int
@ -186,11 +186,11 @@ Index: gdb-7.8/gdb/procfs.c
int after)
{
#ifndef AIX5
Index: gdb-7.8/gdb/remote.c
Index: gdb-7.8.50.20141228/gdb/remote.c
===================================================================
--- gdb-7.8.orig/gdb/remote.c 2014-08-01 23:27:30.205773705 +0200
+++ gdb-7.8/gdb/remote.c 2014-08-01 23:27:30.246773760 +0200
@@ -8206,7 +8206,7 @@ remote_insert_watchpoint (struct target_
--- gdb-7.8.50.20141228.orig/gdb/remote.c 2015-01-05 22:10:30.174726792 +0100
+++ gdb-7.8.50.20141228/gdb/remote.c 2015-01-05 22:10:35.574751338 +0100
@@ -8298,7 +8298,7 @@ remote_insert_watchpoint (struct target_
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@ -199,7 +199,7 @@ Index: gdb-7.8/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
@@ -8226,7 +8226,7 @@ remote_insert_watchpoint (struct target_
@@ -8318,7 +8318,7 @@ remote_insert_watchpoint (struct target_
static int
remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
@ -208,7 +208,7 @@ Index: gdb-7.8/gdb/remote.c
{
CORE_ADDR diff = remote_address_masked (addr - start);
@@ -8256,7 +8256,7 @@ remote_remove_watchpoint (struct target_
@@ -8348,7 +8348,7 @@ remote_remove_watchpoint (struct target_
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@ -217,11 +217,11 @@ Index: gdb-7.8/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
Index: gdb-7.8/gdb/target.c
Index: gdb-7.8.50.20141228/gdb/target.c
===================================================================
--- gdb-7.8.orig/gdb/target.c 2014-08-01 23:27:30.206773707 +0200
+++ gdb-7.8/gdb/target.c 2014-08-01 23:29:38.314944857 +0200
@@ -52,7 +52,7 @@ static void target_info (char *, int);
--- gdb-7.8.50.20141228.orig/gdb/target.c 2015-01-05 22:10:30.175726797 +0100
+++ gdb-7.8.50.20141228/gdb/target.c 2015-01-05 22:10:35.575751342 +0100
@@ -51,7 +51,7 @@ static void generic_tls_error (void) ATT
static void default_terminal_info (struct target_ops *, const char *, int);
static int default_watchpoint_addr_within_range (struct target_ops *,
@ -230,23 +230,7 @@ Index: gdb-7.8/gdb/target.c
static int default_region_ok_for_hw_watchpoint (struct target_ops *,
CORE_ADDR, LONGEST);
@@ -150,13 +150,13 @@ static int debug_to_remove_watchpoint (s
static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *);
static int debug_to_watchpoint_addr_within_range (struct target_ops *,
- CORE_ADDR, CORE_ADDR, int);
+ CORE_ADDR, CORE_ADDR, LONGEST);
static int debug_to_region_ok_for_hw_watchpoint (struct target_ops *self,
CORE_ADDR, LONGEST);
static int debug_to_can_accel_watchpoint_condition (struct target_ops *self,
- CORE_ADDR, int, int,
+ CORE_ADDR, LONGEST, int,
struct expression *);
static void debug_to_terminal_init (struct target_ops *self);
@@ -2960,7 +2960,7 @@ default_region_ok_for_hw_watchpoint (str
@@ -2983,7 +2983,7 @@ default_region_ok_for_hw_watchpoint (str
static int
default_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@ -255,52 +239,11 @@ Index: gdb-7.8/gdb/target.c
{
return addr >= start && addr < start + length;
}
@@ -3681,7 +3681,7 @@ debug_to_region_ok_for_hw_watchpoint (st
static int
debug_to_can_accel_watchpoint_condition (struct target_ops *self,
- CORE_ADDR addr, int len, int rw,
+ CORE_ADDR addr, LONGEST len, int rw,
struct expression *cond)
{
int retval;
@@ -3692,8 +3692,8 @@ debug_to_can_accel_watchpoint_condition
fprintf_unfiltered (gdb_stdlog,
"target_can_accel_watchpoint_condition "
- "(%s, %d, %d, %s) = %ld\n",
- core_addr_to_string (addr), len, rw,
+ "(%s, %s, %d, %s) = %ld\n",
+ core_addr_to_string (addr), plongest (len), rw,
host_address_to_string (cond), (unsigned long) retval);
return retval;
}
@@ -3728,7 +3728,7 @@ debug_to_stopped_data_address (struct ta
static int
debug_to_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
- CORE_ADDR start, int length)
+ CORE_ADDR start, LONGEST length)
{
int retval;
@@ -3736,9 +3736,9 @@ debug_to_watchpoint_addr_within_range (s
start, length);
fprintf_filtered (gdb_stdlog,
- "target_watchpoint_addr_within_range (%s, %s, %d) = %d\n",
+ "target_watchpoint_addr_within_range (%s, %s, %s) = %d\n",
core_addr_to_string (addr), core_addr_to_string (start),
- length, retval);
+ plongest (length), retval);
return retval;
}
Index: gdb-7.8/gdb/target.h
Index: gdb-7.8.50.20141228/gdb/target.h
===================================================================
--- gdb-7.8.orig/gdb/target.h 2014-08-01 23:27:30.207773708 +0200
+++ gdb-7.8/gdb/target.h 2014-08-01 23:29:38.315944839 +0200
@@ -469,7 +469,7 @@ struct target_ops
--- gdb-7.8.50.20141228.orig/gdb/target.h 2015-01-05 22:10:30.176726802 +0100
+++ gdb-7.8.50.20141228/gdb/target.h 2015-01-05 22:10:35.575751342 +0100
@@ -483,7 +483,7 @@ struct target_ops
int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *)
TARGET_DEFAULT_RETURN (0);
int (*to_watchpoint_addr_within_range) (struct target_ops *,
@ -309,7 +252,7 @@ Index: gdb-7.8/gdb/target.h
TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
/* Documentation of this routine is provided with the corresponding
@@ -479,7 +479,7 @@ struct target_ops
@@ -493,7 +493,7 @@ struct target_ops
TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
int (*to_can_accel_watchpoint_condition) (struct target_ops *,
@ -318,11 +261,11 @@ Index: gdb-7.8/gdb/target.h
struct expression *)
TARGET_DEFAULT_RETURN (0);
int (*to_masked_watch_num_registers) (struct target_ops *,
Index: gdb-7.8/gdb/aarch64-linux-nat.c
Index: gdb-7.8.50.20141228/gdb/aarch64-linux-nat.c
===================================================================
--- gdb-7.8.orig/gdb/aarch64-linux-nat.c 2014-08-01 23:27:30.212773715 +0200
+++ gdb-7.8/gdb/aarch64-linux-nat.c 2014-08-01 23:27:30.248773763 +0200
@@ -428,14 +428,14 @@ aarch64_notify_debug_reg_change (const s
--- gdb-7.8.50.20141228.orig/gdb/aarch64-linux-nat.c 2015-01-05 22:10:30.176726802 +0100
+++ gdb-7.8.50.20141228/gdb/aarch64-linux-nat.c 2015-01-05 22:10:35.575751342 +0100
@@ -424,14 +424,14 @@ aarch64_notify_debug_reg_change (const s
static void
aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
const char *func, CORE_ADDR addr,
@ -340,7 +283,7 @@ Index: gdb-7.8/gdb/aarch64-linux-nat.c
type == hw_write ? "hw-write-watchpoint"
: (type == hw_read ? "hw-read-watchpoint"
: (type == hw_access ? "hw-access-watchpoint"
@@ -869,9 +869,10 @@ aarch64_linux_read_description (struct t
@@ -851,9 +851,10 @@ aarch64_linux_read_description (struct t
gdbserver/linux-aarch64-low.c for more information. */
static void
@ -353,7 +296,7 @@ Index: gdb-7.8/gdb/aarch64-linux-nat.c
{
int aligned_len;
unsigned int offset;
@@ -1038,7 +1039,7 @@ aarch64_point_encode_ctrl_reg (int type,
@@ -1020,7 +1021,7 @@ aarch64_point_encode_ctrl_reg (int type,
Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */
static int
@ -362,7 +305,7 @@ Index: gdb-7.8/gdb/aarch64-linux-nat.c
{
unsigned int alignment = is_watchpoint ? AARCH64_HWP_ALIGNMENT
: AARCH64_HBP_ALIGNMENT;
@@ -1290,7 +1291,7 @@ aarch64_handle_aligned_watchpoint (int t
@@ -1272,7 +1273,7 @@ aarch64_handle_aligned_watchpoint (int t
Return 0 if succeed. */
static int
@ -371,7 +314,7 @@ Index: gdb-7.8/gdb/aarch64-linux-nat.c
int is_insert)
{
struct aarch64_debug_reg_state *state
@@ -1315,8 +1316,8 @@ aarch64_handle_unaligned_watchpoint (int
@@ -1297,8 +1298,8 @@ aarch64_handle_unaligned_watchpoint (int
fprintf_unfiltered (gdb_stdlog,
"handle_unaligned_watchpoint: is_insert: %d\n"
" aligned_addr: 0x%08lx, aligned_len: %d\n"
@ -382,7 +325,7 @@ Index: gdb-7.8/gdb/aarch64-linux-nat.c
if (ret != 0)
return ret;
@@ -1328,7 +1329,7 @@ aarch64_handle_unaligned_watchpoint (int
@@ -1310,7 +1311,7 @@ aarch64_handle_unaligned_watchpoint (int
/* Implements insertion and removal of a single watchpoint. */
static int
@ -391,7 +334,7 @@ Index: gdb-7.8/gdb/aarch64-linux-nat.c
{
if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
return aarch64_handle_aligned_watchpoint (type, addr, len, is_insert);
@@ -1497,7 +1498,7 @@ aarch64_linux_stopped_by_watchpoint (str
@@ -1479,7 +1480,7 @@ aarch64_linux_stopped_by_watchpoint (str
static int
aarch64_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
@ -400,11 +343,11 @@ Index: gdb-7.8/gdb/aarch64-linux-nat.c
{
return start <= addr && start + length - 1 >= addr;
}
Index: gdb-7.8/gdb/target-delegates.c
Index: gdb-7.8.50.20141228/gdb/target-delegates.c
===================================================================
--- gdb-7.8.orig/gdb/target-delegates.c 2014-08-01 23:27:30.212773715 +0200
+++ gdb-7.8/gdb/target-delegates.c 2014-08-01 23:29:38.313944877 +0200
@@ -261,7 +261,7 @@ tdefault_stopped_data_address (struct ta
--- gdb-7.8.50.20141228.orig/gdb/target-delegates.c 2015-01-05 22:10:30.177726806 +0100
+++ gdb-7.8.50.20141228/gdb/target-delegates.c 2015-01-05 22:12:11.071185408 +0100
@@ -607,14 +607,14 @@ debug_stopped_data_address (struct targe
}
static int
@ -413,7 +356,24 @@ Index: gdb-7.8/gdb/target-delegates.c
{
self = self->beneath;
return self->to_watchpoint_addr_within_range (self, arg1, arg2, arg3);
@@ -275,14 +275,14 @@ delegate_region_ok_for_hw_watchpoint (st
}
static int
-debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+debug_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, LONGEST arg3)
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_watchpoint_addr_within_range (...)\n", debug_target.to_shortname);
@@ -626,7 +626,7 @@ debug_watchpoint_addr_within_range (stru
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_CORE_ADDR (arg2);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg3);
+ target_debug_print_LONGEST (arg3);
fputs_unfiltered (") = ", gdb_stdlog);
target_debug_print_int (result);
fputs_unfiltered ("\n", gdb_stdlog);
@@ -659,20 +659,20 @@ debug_region_ok_for_hw_watchpoint (struc
}
static int
@ -430,3 +390,19 @@ Index: gdb-7.8/gdb/target-delegates.c
{
return 0;
}
static int
-debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+debug_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4)
{
int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_can_accel_watchpoint_condition (...)\n", debug_target.to_shortname);
@@ -682,7 +682,7 @@ debug_can_accel_watchpoint_condition (st
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_CORE_ADDR (arg1);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg2);
+ target_debug_print_LONGEST (arg2);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_int (arg3);
fputs_unfiltered (", ", gdb_stdlog);

File diff suppressed because it is too large Load Diff

View File

@ -47,10 +47,10 @@ Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=f77-bounds.patch
Index: gdb-7.7.90.20140613/gdb/f-lang.h
Index: gdb-7.8.50.20141228/gdb/f-lang.h
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/f-lang.h 2014-06-16 22:45:00.404470944 +0200
+++ gdb-7.7.90.20140613/gdb/f-lang.h 2014-06-16 22:45:10.352477761 +0200
--- gdb-7.8.50.20141228.orig/gdb/f-lang.h 2015-01-06 22:46:31.620852996 +0100
+++ gdb-7.8.50.20141228/gdb/f-lang.h 2015-01-06 22:46:34.190865466 +0100
@@ -62,9 +62,9 @@ struct common_block
struct symbol *contents[1];
};
@ -63,11 +63,11 @@ Index: gdb-7.7.90.20140613/gdb/f-lang.h
extern void f77_get_dynamic_array_length (struct type *);
Index: gdb-7.7.90.20140613/gdb/f-typeprint.c
Index: gdb-7.8.50.20141228/gdb/f-typeprint.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/f-typeprint.c 2014-06-16 22:45:00.404470944 +0200
+++ gdb-7.7.90.20140613/gdb/f-typeprint.c 2014-06-16 22:45:10.353477761 +0200
@@ -161,7 +161,7 @@ f_type_print_varspec_suffix (struct type
--- gdb-7.8.50.20141228.orig/gdb/f-typeprint.c 2015-01-06 22:46:31.621853001 +0100
+++ gdb-7.8.50.20141228/gdb/f-typeprint.c 2015-01-06 22:47:03.731008798 +0100
@@ -158,7 +158,7 @@ f_type_print_varspec_suffix (struct type
int show, int passed_a_ptr, int demangled_args,
int arrayprint_recurse_level)
{
@ -76,25 +76,25 @@ Index: gdb-7.7.90.20140613/gdb/f-typeprint.c
/* No static variables are permitted as an error call may occur during
execution of this function. */
@@ -195,7 +195,7 @@ f_type_print_varspec_suffix (struct type
@@ -192,7 +192,7 @@ f_type_print_varspec_suffix (struct type
lower_bound = f77_get_lowerbound (type);
if (lower_bound != 1) /* Not the default. */
- fprintf_filtered (stream, "%d:", lower_bound);
+ fprintf_filtered (stream, "%s:", plongest (lower_bound));
+ fprintf_filtered (stream, "%s:", plongest (lower_bound));
/* Make sure that, if we have an assumed size array, we
print out a warning and print the upperbound as '*'. */
@@ -205,7 +205,7 @@ f_type_print_varspec_suffix (struct type
@@ -202,7 +202,7 @@ f_type_print_varspec_suffix (struct type
else
{
upper_bound = f77_get_upperbound (type);
- fprintf_filtered (stream, "%d", upper_bound);
+ fprintf_filtered (stream, "%s", plongest (upper_bound));
+ fprintf_filtered (stream, "%s", plongest (upper_bound));
}
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
@@ -274,7 +274,7 @@ void
@@ -271,7 +271,7 @@ void
f_type_print_base (struct type *type, struct ui_file *stream, int show,
int level)
{
@ -103,7 +103,7 @@ Index: gdb-7.7.90.20140613/gdb/f-typeprint.c
int index;
QUIT;
@@ -356,7 +356,7 @@ f_type_print_base (struct type *type, st
@@ -353,7 +353,7 @@ f_type_print_base (struct type *type, st
else
{
upper_bound = f77_get_upperbound (type);
@ -112,11 +112,11 @@ Index: gdb-7.7.90.20140613/gdb/f-typeprint.c
}
break;
Index: gdb-7.7.90.20140613/gdb/f-valprint.c
Index: gdb-7.8.50.20141228/gdb/f-valprint.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/f-valprint.c 2014-06-16 22:45:34.901495069 +0200
+++ gdb-7.7.90.20140613/gdb/f-valprint.c 2014-06-16 22:45:44.933502067 +0200
@@ -46,7 +46,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN
--- gdb-7.8.50.20141228.orig/gdb/f-valprint.c 2015-01-06 22:46:31.621853001 +0100
+++ gdb-7.8.50.20141228/gdb/f-valprint.c 2015-01-06 22:46:34.191865471 +0100
@@ -43,7 +43,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN
/* Array which holds offsets to be applied to get a row's elements
for a given array. Array also holds the size of each subarray. */
@ -125,7 +125,7 @@ Index: gdb-7.7.90.20140613/gdb/f-valprint.c
f77_get_lowerbound (struct type *type)
{
if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type))
@@ -55,7 +55,7 @@ f77_get_lowerbound (struct type *type)
@@ -52,7 +52,7 @@ f77_get_lowerbound (struct type *type)
return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
}

View File

@ -1,123 +0,0 @@
gdb/
2014-10-03 Miroslav Franc <mfranc@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Fix "save breakpoints" for "catch" command.
* break-catch-sig.c (signal_catchpoint_print_recreate): Add trailing
newline.
gdb/testsuite/
2014-10-03 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix "save breakpoints" for "catch" command.
* gdb.base/catch-signal.exp: Add gdb_breakpoint "main".
Remove -nonewline. Match also the added "main" line.
diff --git a/gdb/break-catch-sig.c b/gdb/break-catch-sig.c
index c41bf33..579fb78 100644
--- a/gdb/break-catch-sig.c
+++ b/gdb/break-catch-sig.c
@@ -346,6 +346,7 @@ signal_catchpoint_print_recreate (struct breakpoint *b, struct ui_file *fp)
}
else if (c->catch_all)
fprintf_unfiltered (fp, " all");
+ fputc_unfiltered ('\n', fp);
}
/* Implement the "explains_signal" breakpoint_ops method for signal
diff --git a/gdb/testsuite/gdb.base/catch-signal.exp b/gdb/testsuite/gdb.base/catch-signal.exp
index 22caf40..7002f84 100644
--- a/gdb/testsuite/gdb.base/catch-signal.exp
+++ b/gdb/testsuite/gdb.base/catch-signal.exp
@@ -117,6 +117,7 @@ foreach {arg desc} {"" "standard signals" \
"set catchpoint '$arg' for printing"
gdb_test "info break" "$decimal.*catchpoint.*signal.*$desc.*" \
"info break for '$arg'"
+ gdb_breakpoint "main"
gdb_test "save breakpoints [standard_output_file bps.$i]" \
"Saved to file .*bps.$i.*" \
"save breakpoints for '$arg'"
@@ -124,15 +125,17 @@ foreach {arg desc} {"" "standard signals" \
set filename [remote_upload host [standard_output_file bps.$i] \
[standard_output_file bps-local.$i]]
set fd [open $filename]
- set contents [read -nonewline $fd]
+ set contents [read $fd]
close $fd
+ set nl "\r?\n"
if {$arg == ""} {
- set pattern "catch signal"
+ set pattern "catch signal$nl"
} else {
- set pattern "catch signal $arg"
+ set pattern "catch signal $arg$nl"
}
- if {[string match $pattern $contents]} {
+ set pattern "${pattern}break main$nl"
+ if {[regexp "$pattern" $contents]} {
pass "results of save breakpoints for '$arg'"
} else {
fail "results of save breakpoints for '$arg'"
gdb/
2014-10-03 Miroslav Franc <mfranc@redhat.com>
Fix "save breakpoints" for "disable $bpnum" command.
* breakpoint.c (save_breakpoints): Add $bpnum for disable.
gdb/testsuite/
2014-10-03 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix "save breakpoints" for "disable $bpnum" command.
* gdb.base/save-bp.c (main): Add label.
* gdb.base/save-bp.exp: Add 8th disabled breakpoint. Match it.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index e2170b4..0a438d1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -16131,7 +16131,7 @@ save_breakpoints (char *filename, int from_tty,
}
if (tp->enable_state == bp_disabled)
- fprintf_unfiltered (fp, "disable\n");
+ fprintf_unfiltered (fp, "disable $bpnum\n");
/* If this is a multi-location breakpoint, check if the locations
should be individually disabled. Watchpoint locations are
diff --git a/gdb/testsuite/gdb.base/save-bp.c b/gdb/testsuite/gdb.base/save-bp.c
index 9a72fe8..f01f031 100644
--- a/gdb/testsuite/gdb.base/save-bp.c
+++ b/gdb/testsuite/gdb.base/save-bp.c
@@ -31,6 +31,6 @@ main (void)
break_me (); /* Try a condition-specific breakpoint. */
break_me (); /* Finally, try a breakpoint with commands. */
- return 0;
+ return 0; /* Return line. */
}
diff --git a/gdb/testsuite/gdb.base/save-bp.exp b/gdb/testsuite/gdb.base/save-bp.exp
index ba98633..7bc8ab6 100644
--- a/gdb/testsuite/gdb.base/save-bp.exp
+++ b/gdb/testsuite/gdb.base/save-bp.exp
@@ -47,6 +47,10 @@ gdb_test "commands\nsilent\nend" "End with.*" "add breakpoint commands"
gdb_test "dprintf ${srcfile}:${loc_bp5},\"At foo entry\\n\"" "Dprintf .*"
+set loc_bp8 [gdb_get_line_number "Return line"]
+gdb_breakpoint "${srcfile}:${loc_bp8}"
+gdb_test_no_output {disable $bpnum}
+
# Now, save the breakpoints into a file...
if {[is_remote host]} {
set bps bps
@@ -71,6 +75,7 @@ gdb_test "source $bps" "" "source bps"
# Now, verify that all breakpoints have been created correctly...
set bp_row_start "\[0-9\]+ +breakpoint +keep +y +0x\[0-9a-f\]+ +in"
+set disabled_row_start "\[0-9\]+ +breakpoint +keep +n +0x\[0-9a-f\]+ +in"
set dprintf_row_start "\[0-9\]+ +dprintf +keep +y +0x\[0-9a-f\]+ +in"
gdb_test "info break" \
- " *Num +Type +Disp +Enb +Address +What\r\n$bp_row_start break_me at .*$srcfile:\[0-9\]+\r\n$bp_row_start main at .*$srcfile:$loc_bp2\r\n$bp_row_start main at .*$srcfile:$loc_bp3 +thread 1\r\n\[ \t]+stop only in thread 1\r\n$bp_row_start main at .*$srcfile:$loc_bp4\r\n\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?\r\n$bp_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+silent\r\n$dprintf_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+printf.*"
+ " *Num +Type +Disp +Enb +Address +What\r\n$bp_row_start break_me at .*$srcfile:\[0-9\]+\r\n$bp_row_start main at .*$srcfile:$loc_bp2\r\n$bp_row_start main at .*$srcfile:$loc_bp3 +thread 1\r\n\[ \t]+stop only in thread 1\r\n$bp_row_start main at .*$srcfile:$loc_bp4\r\n\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?\r\n$bp_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+silent\r\n$dprintf_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+printf\[^\r\n\]+\r\n$disabled_row_start main at .*$srcfile:$loc_bp8"

View File

@ -134,11 +134,11 @@ gdb/
(dwarf_decode_line_header): Initialize offset and offset_in_dwz.
(dwarf_decode_lines): New parameter decode_mapping, use it.
Index: gdb-7.8/gdb/dwarf2read.c
Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
===================================================================
--- gdb-7.8.orig/gdb/dwarf2read.c
+++ gdb-7.8/gdb/dwarf2read.c
@@ -312,6 +312,9 @@ struct dwarf2_per_objfile
--- gdb-7.8.50.20141228.orig/gdb/dwarf2read.c 2015-01-05 22:45:32.823240453 +0100
+++ gdb-7.8.50.20141228/gdb/dwarf2read.c 2015-01-05 22:49:35.270332647 +0100
@@ -309,6 +309,9 @@ struct dwarf2_per_objfile
/* The CUs we recently read. */
VEC (dwarf2_per_cu_ptr) *just_read_cus;
@ -148,7 +148,7 @@ Index: gdb-7.8/gdb/dwarf2read.c
};
static struct dwarf2_per_objfile *dwarf2_per_objfile;
@@ -1028,6 +1031,12 @@ typedef void (die_reader_func_ftype) (co
@@ -1025,6 +1028,12 @@ typedef void (die_reader_func_ftype) (co
which contains the following information. */
struct line_header
{
@ -161,27 +161,27 @@ Index: gdb-7.8/gdb/dwarf2read.c
unsigned int total_length;
unsigned short version;
unsigned int header_length;
@@ -1516,7 +1525,7 @@ static struct line_header *dwarf_decode_
@@ -1513,7 +1522,7 @@ static struct line_header *dwarf_decode_
static void dwarf_decode_lines (struct line_header *, const char *,
struct dwarf2_cu *, struct partial_symtab *,
- int);
+ int, int decode_mapping);
- CORE_ADDR);
+ CORE_ADDR, int decode_mapping);
static void dwarf2_start_subfile (const char *, const char *, const char *);
static void dwarf2_start_subfile (const char *, const char *);
@@ -1849,6 +1858,8 @@ static void process_cu_includes (void);
static void check_producer (struct dwarf2_cu *cu);
@@ -2057,6 +2066,8 @@ get_section_file_name (const struct dwar
/* Return the id of SECTION.
Returns 0 if SECTION doesn't exist. */
+static void free_line_header_voidp (void *arg);
+
static int
attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
struct dwarf2_cu *cu, struct dynamic_prop *prop,
@@ -1920,6 +1931,29 @@ dwarf2_invalid_attrib_class_complaint (c
_("invalid attribute class or form for '%s' in '%s'"),
arg1, arg2);
get_section_id (const struct dwarf2_section_info *section)
{
@@ -2461,6 +2472,29 @@ dwarf2_get_dwz_file (void)
dwarf2_per_objfile->dwz_file = result;
return result;
}
+
+/* Hash function for line_header_hash. */
@ -207,20 +207,20 @@ Index: gdb-7.8/gdb/dwarf2read.c
+}
+
#if WORDS_BIGENDIAN
/* DWARF quick_symbols_functions support. */
@@ -4459,7 +4493,7 @@ dwarf2_build_include_psymtabs (struct dw
@@ -4454,7 +4488,7 @@ dwarf2_build_include_psymtabs (struct dw
return; /* No linetable, so no includes. */
/* NOTE: pst->dirname is DW_AT_comp_dir (if present). */
- dwarf_decode_lines (lh, pst->dirname, cu, pst, 1);
+ dwarf_decode_lines (lh, pst->dirname, cu, pst, 1, 1);
- dwarf_decode_lines (lh, pst->dirname, cu, pst, pst->textlow);
+ dwarf_decode_lines (lh, pst->dirname, cu, pst, pst->textlow, 1);
free_line_header (lh);
}
@@ -8989,24 +9023,64 @@ static void
@@ -9002,24 +9036,64 @@ static void
handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu,
const char *comp_dir) /* ARI: editCase function */
const char *comp_dir, CORE_ADDR lowpc) /* ARI: editCase function */
{
+ struct objfile *objfile = dwarf2_per_objfile->objfile;
struct attribute *attr;
@ -249,7 +249,7 @@ Index: gdb-7.8/gdb/dwarf2read.c
- {
- cu->line_header = line_header;
- make_cleanup (free_cu_line_header, cu);
- dwarf_decode_lines (line_header, comp_dir, cu, NULL, 1);
- dwarf_decode_lines (line_header, comp_dir, cu, NULL, lowpc);
- }
+ dwarf2_per_objfile->line_header_hash
+ = htab_create_alloc_ex (127, line_header_hash, line_header_eq,
@ -289,12 +289,12 @@ Index: gdb-7.8/gdb/dwarf2read.c
+ make_cleanup (free_cu_line_header, cu);
}
+ decode_mapping = (die->tag != DW_TAG_partial_unit);
+ dwarf_decode_lines (line_header, comp_dir, cu, NULL, 1,
+ dwarf_decode_lines (line_header, comp_dir, cu, NULL, lowpc,
+ decode_mapping);
}
/* Process DW_TAG_compile_unit or DW_TAG_partial_unit. */
@@ -16969,6 +17043,16 @@ free_line_header (struct line_header *lh
@@ -16917,6 +16991,16 @@ free_line_header (struct line_header *lh
xfree (lh);
}
@ -311,7 +311,7 @@ Index: gdb-7.8/gdb/dwarf2read.c
/* Add an entry to LH's include directory table. */
static void
@@ -17099,6 +17183,9 @@ dwarf_decode_line_header (unsigned int o
@@ -17047,6 +17131,9 @@ dwarf_decode_line_header (unsigned int o
back_to = make_cleanup ((make_cleanup_ftype *) free_line_header,
(void *) lh);
@ -321,12 +321,12 @@ Index: gdb-7.8/gdb/dwarf2read.c
line_ptr = section->buffer + offset;
/* Read in the header. */
@@ -17596,18 +17683,22 @@ dwarf_decode_lines_1 (struct line_header
as the corresponding symtab. Since COMP_DIR is not used in the name of the
symtab we don't use it in the name of the psymtabs we create.
@@ -17674,17 +17761,22 @@ dwarf_decode_lines_1 (struct line_header
E.g. expand_line_sal requires this when finding psymtabs to expand.
- A good testcase for this is mb-inline.exp. */
+ A good testcase for this is mb-inline.exp.
A good testcase for this is mb-inline.exp.
- LOWPC is the lowest address in CU (or 0 if not known). */
+ LOWPC is the lowest address in CU (or 0 if not known).
+
+ Boolean DECODE_MAPPING specifies we need to fully decode .debug_line
+ for its PC<->lines mapping information. Otherwise only filenames
@ -335,15 +335,15 @@ Index: gdb-7.8/gdb/dwarf2read.c
static void
dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
struct dwarf2_cu *cu, struct partial_symtab *pst,
- int want_line_info)
+ int want_line_info, int decode_mapping)
- CORE_ADDR lowpc)
+ CORE_ADDR lowpc, int decode_mapping)
{
struct objfile *objfile = cu->objfile;
const int decode_for_pst_p = (pst != NULL);
struct subfile *first_subfile = current_subfile;
- if (want_line_info)
+ if (want_line_info && decode_mapping)
dwarf_decode_lines_1 (lh, comp_dir, cu, pst);
- dwarf_decode_lines_1 (lh, cu, decode_for_pst_p, lowpc);
+ if (decode_mapping)
+ dwarf_decode_lines_1 (lh, cu, decode_for_pst_p, lowpc);
if (decode_for_pst_p)
{

View File

@ -45,7 +45,7 @@ gdb/
- inf = find_inferior_for_program_space (pspace);
+ if (inf->pspace != pspace)
+ inf = find_inferior_for_program_space (pspace);
if (inf != NULL)
if (inf != NULL && inf->pid != 0)
{
- struct thread_info *tp;
+ struct thread_info *tp, *current_tp = NULL;

View File

@ -1,191 +0,0 @@
http://sourceware.org/ml/gdb-patches/2014-10/msg00524.html
Subject: [patch 1/2] Accelerate iter_match_first_hashed 1.8x
--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
very simple caching. dict_hash() is being called again and again for the same
string.
#0 in skip_spaces_const (chp=0x7fffb10f9bb6 "ts<char>, std::allocator<char> >::npos") at ./cli/cli-utils.c:244
#1 in msymbol_hash_iw (string=0x7fffb10f9bb6 "ts<char>, std::allocator<char> >::npos") at minsyms.c:89
#2 in dict_hash ( string0=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos") at dictionary.c:840
#3 in iter_match_first_hashed (dict=0x105a7840, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", compare=0x8b82f8 <strcmp_iw>, iterator=0x7fffb10f9970) at dictionary.c:659
#4 in dict_iter_match_first (dict=0x105a7840, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", compare=0x8b82f8 <strcmp_iw>, iterator=0x7fffb10f9970) at dictionary.c:555
#5 in dict_iter_name_first (dict=0x105a7840, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", iterator=0x7fffb10f9970) at dictionary.c:541
#6 in block_iter_name_step (iterator=0x7fffb10f9960, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", first=1) at block.c:580
#7 in block_iter_name_first (block=0x10593e10, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", iterator=0x7fffb10f9960) at block.c:609
#8 in lookup_block_symbol (block=0x10593e10, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", domain=VAR_DOMAIN) at symtab.c:2062
#9 in lookup_symbol_aux_objfile (objfile=0x466f870, block_index=0, name=0x7fffb10f9b90 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::npos", domain=VAR_DOMAIN) at symtab.c:1664
#10 in lookup_symbol_global_iterator_cb (objfile=0x466f870, cb_data=0x7fffb10f9ad0) at symtab.c:1868
Maybe it could get cached at the caller but:
* We would need to pass the hash value along the whole {dict,block}_iter_*
call chain.
* The DICT_VECTOR virtualization would get violated as dict_linear*_vector do
not use any hash values.
Jan
--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="idxcache1.patch"
gdb/
2014-10-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* dictionary.c (iter_match_first_hashed): Provide state cache for
hash_index from NAME.
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 055c87e..90bcd6d 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -656,9 +656,26 @@ iter_match_first_hashed (const struct dictionary *dict, const char *name,
symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
- unsigned int hash_index = dict_hash (name) % DICT_HASHED_NBUCKETS (dict);
+ unsigned int hash_index;
struct symbol *sym;
+ /* Cache HASH_INDEX. */
+ {
+ static const char *name_ptr_cached;
+ static char *name_content_cached;
+ static unsigned int dict_hash_cached;
+
+ if (name_ptr_cached != name || strcmp (name_content_cached, name) != 0)
+ {
+ dict_hash_cached = dict_hash (name);
+ name_ptr_cached = name;
+ xfree (name_content_cached);
+ name_content_cached = xstrdup (name);
+ }
+ hash_index = dict_hash_cached;
+ }
+ hash_index %= DICT_HASHED_NBUCKETS (dict);
+
DICT_ITERATOR_DICT (iterator) = dict;
/* Loop through the symbols in the given bucket, breaking when SYM
--17pEHd4RhPHOinZp--
http://sourceware.org/ml/gdb-patches/2014-10/msg00612.html
Subject: [patchv2 2/2] Accelerate lookup_symbol_aux_objfile 14.5x [Re: [patch 0/2] Accelerate symbol lookups 15x]
--vtzGhvizbBRQ85DL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Wed, 22 Oct 2014 10:55:18 +0200, Doug Evans wrote:
> For example, the count of calls to dict_hash before/after goes from 13.8M to 31.
> I'm guessing one t hing we're doing here is coping with an artifact of
> dwz:
During my simple test on non-DWZ file (./gdb itself) it went 3684->3484.
The problem is that dict_cash(val) is called for the same val for each block
(== symtab).
On DWZ the saving is probably much larger as there are many more symtabs due
to DW_TAG_partial_unit ones.
> what was once one global block to represent the entire objfile is
> now N.
Without DWZ there are X global blocks for X primary symtabs for X CUs of
objfile. With DWZ there are X+Y global blocks for X+Y primary symtabs for
X+Y CUs where Y are 'DW_TAG_partial_unit's.
For 'DW_TAG_partial_unit's (Ys) their blockvector is usually empty. But not
always, I have found there typedef symbols, there can IMO be optimized-out
static variables etc.
> [I'm sure the patches help in the non-dwz case, but I suspect it's less.
> Which isn't to say the patches aren't useful.
> I just need play with a few more examples.]
I agree.
[patch 2/2] could needlessly performance-regress non-DWZ cases, therefore
I have put back original ALL_OBJFILE_PRIMARY_SYMTABS (instead of my
ALL_OBJFILE_SYMTABS) as it is perfectly sufficient. For the performance
testcase of mine:
Benchmark on non-trivial application with 'p <tab><tab>':
Command execution time: 4.215000 (cpu), 4.241466 (wall) --- both fixes with new [patch 2/2]
Command execution time: 7.373000 (cpu), 7.395095 (wall) --- both fixes
Command execution time: 13.572000 (cpu), 13.592689 (wall) --- just lookup_symbol_aux_objfile fix
Command execution time: 113.036000 (cpu), 113.067995 (wall) --- FSF GDB HEAD
That is additional 1.75x improvement, making the total improvement 26.8x.
No regressions on {x86_64,x86_64-m32,i686}-fedora21pre-linux-gnu in standard
and .gdb_index-enabled runs. Neither of the patches should cause any visible
behavior change.
Thanks,
Jan
--vtzGhvizbBRQ85DL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="idxcache2doug.patch"
gdb/
2014-10-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* symtab.c (lookup_symbol_aux_objfile): Use ALL_OBJFILE_SYMTABS, inline
lookup_block_symbol.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index c530d50..da13861 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1657,15 +1657,25 @@ lookup_symbol_aux_objfile (struct objfile *objfile, int block_index,
const struct block *block;
struct symtab *s;
+ gdb_assert (block_index == GLOBAL_BLOCK || block_index == STATIC_BLOCK);
+
ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
{
+ struct dict_iterator dict_iter;
+
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, domain);
- if (sym)
+
+ for (sym = dict_iter_name_first (block->dict, name, &dict_iter);
+ sym != NULL;
+ sym = dict_iter_name_next (name, &dict_iter))
{
- block_found = block;
- return fixup_symbol_section (sym, objfile);
+ if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ SYMBOL_DOMAIN (sym), domain))
+ {
+ block_found = block;
+ return fixup_symbol_section (sym, objfile);
+ }
}
}
--vtzGhvizbBRQ85DL--

View File

@ -0,0 +1,151 @@
-R for 85880250e591a51624d24db653aaace0c5ce5943
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=85880250e591a51624d24db653aaace0c5ce5943;hp=fce10a8494efa8faec
[buildbot] GDB regression on 85880250e591a51624d24db653aaace0c5ce5943
https://sourceware.org/ml/binutils/2015-01/msg00044.html
diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c
index 8573a8d..2122c0d 100644
--- a/bfd/coff-i860.c
+++ b/bfd/coff-i860.c
@@ -467,10 +467,7 @@ static reloc_howto_type howto_table[] =
FIXME: This macro refers to symbols and asect; these are from the
calling function, not the macro arguments. */
-/* PR 17512: file: 0a38fb7c
- Set an addend value, even if it is not going to be used. A tool
- like coffdump might be used to print out the contents of the reloc. */
-#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) (cache_ptr)->addend = 0
+#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr)
/* We use the special COFF backend linker. */
#define coff_relocate_section _bfd_coff_generic_relocate_section
diff --git a/bfd/tekhex.c b/bfd/tekhex.c
index 9444117..969b812 100644
--- a/bfd/tekhex.c
+++ b/bfd/tekhex.c
@@ -267,7 +267,7 @@ typedef struct tekhex_data_struct
#define enda(x) (x->vma + x->size)
static bfd_boolean
-getvalue (char **srcp, bfd_vma *valuep, char * endp)
+getvalue (char **srcp, bfd_vma *valuep)
{
char *src = *srcp;
bfd_vma value = 0;
@@ -279,7 +279,7 @@ getvalue (char **srcp, bfd_vma *valuep, char * endp)
len = hex_value (*src++);
if (len == 0)
len = 16;
- while (len-- && src < endp)
+ while (len--)
{
if (!ISHEX (*src))
return FALSE;
@@ -288,11 +288,11 @@ getvalue (char **srcp, bfd_vma *valuep, char * endp)
*srcp = src;
*valuep = value;
- return len == 0;
+ return TRUE;
}
static bfd_boolean
-getsym (char *dstp, char **srcp, unsigned int *lenp, char * endp)
+getsym (char *dstp, char **srcp, unsigned int *lenp)
{
char *src = *srcp;
unsigned int i;
@@ -304,7 +304,7 @@ getsym (char *dstp, char **srcp, unsigned int *lenp, char * endp)
len = hex_value (*src++);
if (len == 0)
len = 16;
- for (i = 0; i < len && src < endp; i++)
+ for (i = 0; i < len; i++)
dstp[i] = src[i];
dstp[i] = 0;
*srcp = src + i;
@@ -354,7 +354,7 @@ insert_byte (bfd *abfd, int value, bfd_vma addr)
how big the data is. */
static bfd_boolean
-first_phase (bfd *abfd, int type, char *src, char * src_end)
+first_phase (bfd *abfd, int type, char *src)
{
asection *section, *alt_section;
unsigned int len;
@@ -368,21 +368,21 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
{
bfd_vma addr;
- if (!getvalue (&src, &addr, src_end))
+ if (!getvalue (&src, &addr))
return FALSE;
- while (*src && src < src_end - 1)
+ while (*src)
{
insert_byte (abfd, HEX (src), addr);
src += 2;
addr++;
}
- return TRUE;
}
+ return TRUE;
case '3':
/* Symbol record, read the segment. */
- if (!getsym (sym, &src, &len, src_end))
+ if (!getsym (sym, &src, &len))
return FALSE;
section = bfd_get_section_by_name (abfd, sym);
if (section == NULL)
@@ -403,9 +403,9 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
{
case '1': /* Section range. */
src++;
- if (!getvalue (&src, &section->vma, src_end))
+ if (!getvalue (&src, &section->vma))
return FALSE;
- if (!getvalue (&src, &val, src_end))
+ if (!getvalue (&src, &val))
return FALSE;
section->size = val - section->vma;
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
@@ -432,7 +432,7 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
abfd->flags |= HAS_SYMS;
new_symbol->prev = abfd->tdata.tekhex_data->symbols;
abfd->tdata.tekhex_data->symbols = new_symbol;
- if (!getsym (sym, &src, &len, src_end))
+ if (!getsym (sym, &src, &len))
return FALSE;
new_symbol->symbol.name = (const char *)
bfd_alloc (abfd, (bfd_size_type) len + 1);
@@ -480,7 +480,7 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
new_symbol->symbol.section = alt_section;
}
}
- if (!getvalue (&src, &val, src_end))
+ if (!getvalue (&src, &val))
return FALSE;
new_symbol->symbol.value = val - section->vma;
break;
@@ -498,7 +498,7 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
record. */
static bfd_boolean
-pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *, char *))
+pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *))
{
unsigned int chars_on_line;
bfd_boolean is_eof = FALSE;
@@ -539,7 +539,8 @@ pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *, char *))
/* Put a null at the end. */
src[chars_on_line] = 0;
- if (!func (abfd, type, src, src + chars_on_line))
+
+ if (!func (abfd, type, src))
return FALSE;
}

View File

@ -1,67 +0,0 @@
http://sourceware.org/ml/gdb-patches/2014-07/msg00274.html
Subject: [obv] Fix false argv0-symlink.exp FAIL running under a very long directory name
Hi,
checked in as obvious:
Starting program: /home/jkratoch/redhat/gdb-test-fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff/gdb/testsuite/gdb.base/argv0-symlink-filelink ^M
[...]
(gdb) print argv[0]^M
$1 = 0x7fffffffda39 "/home/jkratoch/redhat/gdb-test-", 'f' <repeats 169 times>...^M
(gdb) FAIL: gdb.base/argv0-symlink.exp: kept file symbolic link name
after "set print repeats 10000":
print argv[0]^M
$1 = 0x7fffffffda39 "/home/jkratoch/redhat/gdb-test-fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"...^M
(gdb) FAIL: gdb.base/argv0-symlink.exp: kept file symbolic link name
after "set print elements 10000":
print argv[0]^M
$1 = 0x7fffffffda39 "/home/jkratoch/redhat/gdb-test-fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff/gdb/testsuite/gdb.base/argv0-symlink-filelink"^M
(gdb) PASS: gdb.base/argv0-symlink.exp: kept file symbolic link name
commit 218c2655603748b844dcaf103e34fd14d8ee8aef
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri Jul 11 17:26:42 2014 +0200
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 74f7bce..253eeeb 100644
### a/gdb/testsuite/ChangeLog
### b/gdb/testsuite/ChangeLog
## -1,3 +1,9 @@
+2014-07-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix false FAIL running under a very long directory name.
+ * gdb.base/argv0-symlink.exp: Add "set print repeats 10000"
+ and "set print elements 10000". Twice.
+
2014-07-11 Yao Qi <yao@codesourcery.com>
* gdb.base/exprs.exp: "set print symbol off".
diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp
index 0e0202d..d849b4c 100644
--- a/gdb/testsuite/gdb.base/argv0-symlink.exp
+++ b/gdb/testsuite/gdb.base/argv0-symlink.exp
@@ -36,6 +36,9 @@ if ![runto_main] {
return -1
}
+gdb_test_no_output "set print repeats 10000"
+gdb_test_no_output "set print elements 10000"
+
gdb_test {print argv[0]} "/$filelink\"" $test
# For a link named /PATH/TO/DIR/LINK, we want to check the output
@@ -67,6 +70,9 @@ if ![runto_main] {
return -1
}
+gdb_test_no_output "set print repeats 10000"
+gdb_test_no_output "set print elements 10000"
+
# gdbserver does not have this issue.
if ![is_remote target] {
setup_kfail "*-*-*" gdb/15934

View File

@ -31,11 +31,11 @@ Jan
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename="vlastringonly.patch"
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 53cae2c..cf7ac26 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1659,6 +1659,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
Index: gdb-7.8.50.20141228/gdb/gdbtypes.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/gdbtypes.c 2015-01-08 18:15:18.475682523 +0100
+++ gdb-7.8.50.20141228/gdb/gdbtypes.c 2015-01-08 18:39:01.423134700 +0100
@@ -1684,6 +1684,7 @@ is_dynamic_type_internal (struct type *t
return !has_static_range (TYPE_RANGE_DATA (type));
case TYPE_CODE_ARRAY:
@ -43,11 +43,18 @@ index 53cae2c..cf7ac26 100644
{
gdb_assert (TYPE_NFIELDS (type) == 1);
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
new file mode 100644
index 0000000..261ce17
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
@@ -1992,6 +1993,7 @@ resolve_dynamic_type_internal (struct ty
}
case TYPE_CODE_ARRAY:
+ case TYPE_CODE_STRING:
resolved_type = resolve_dynamic_array (type, addr);
break;
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2015-01-08 18:15:18.897684435 +0100
@@ -0,0 +1,24 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
@ -73,11 +80,10 @@ index 0000000..261ce17
+ real :: dummy
+ dummy = 1
+end subroutine bar
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
new file mode 100644
index 0000000..570a28c
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2015-01-08 18:15:18.897684435 +0100
@@ -0,0 +1,39 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
@ -118,11 +124,10 @@ index 0000000..570a28c
+}
+
+gdb_test "bt" {foo \(string='hello'.*}
diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
new file mode 100644
index 0000000..2bc637d
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2015-01-08 18:15:18.897684435 +0100
@@ -0,0 +1,36 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
@ -160,6 +165,3 @@ index 0000000..2bc637d
+ end interface
+ call foo ('hello')
+end
--FCuugMFkClbJLl1L--

File diff suppressed because it is too large Load Diff

View File

@ -21,12 +21,12 @@ Name: %{?scl_prefix}gdb
%global snapsrc 20140611
# See timestamp of source gnulib installed into gdb/gnulib/ .
%global snapgnulib 20121213
%global tarname gdb-%{version}.20141228
Version: 7.8.1
%global tarname gdb-%{version}
Version: 7.8.50.20150108
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 36%{?dist}
Release: 1%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
Group: Development/Debuggers
@ -219,7 +219,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
# Backported fixups post the source tarball.
#Xdrop: Just backports.
Patch232: gdb-upstream.patch
#Patch232: gdb-upstream.patch
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
#=fedoratest+ppc
@ -506,43 +506,33 @@ Patch848: gdb-dts-rhel6-python-compat.patch
Patch852: gdb-gnat-dwarf-crash-3of3.patch
# VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests.
Patch887: gdb-archer-vla-tests.patch
Patch888: gdb-vla-intel.patch
Patch912: gdb-vla-intel-04of23-fix.patch
Patch889: gdb-vla-intel-stringbt-fix.patch
# Fix --with-system-readline with readline-6.3 patch 5.
Patch914: gdb-readline-6.3.5.patch
Patch912: gdb-vla-intel-04of23-fix.patch
Patch887: gdb-archer-vla-tests.patch
# Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
Patch918: gdb-btrobust.patch
# Python completion w/overriden completer (Sergio Durigan Junior, BZ 1075199).
Patch920: gdb-python-completer-1of2.patch
Patch921: gdb-python-completer-2of2.patch
# Display Fortran strings in backtraces.
Patch925: gdb-fortran-frame-string.patch
# Fix Python GIL with gdb.execute("continue") (Phil Muldoon, BZ 1116957).
Patch927: gdb-python-gil.patch
# Fix GDB SIGTT* Stopped when using the PID argument (BZ 1136704, Pedro Alves).
Patch970: gdb-async-stopped-on-pid-arg-testsuite.patch
# Fix "save breakpoints" for signal catchpoints and disabled breakpoints
# (BZ 1146170, Miroslav Franc).
Patch971: gdb-save-breakpoints-fix.patch
# Fix 'Slow gstack performance' (RH BZ 1103894, Jan Kratochvil).
Patch973: gdb-slow-gstack-performance.patch
# Accelerate interactive symbols lookup 15x.
Patch975: gdb-symbols-lookup-accel.patch
# Fix 'compile' compilation warning/error.
Patch977: gdb-compile-warn_unused_result.patch
# Fix '[RFE] please add add-auto-load-scripts-directory command' (RH
# BZ 1163339, Jan Kratochvil).
Patch976: gdb-rhbz1163339-add-auto-load-scripts-directory.patch
# Fix jit-reader.h for multi-lib.
Patch978: gdb-jit-reader-multilib.patch
# Fix gdb-7.9pre regressions / new FAILs.
Patch979: gdb-6.8-bz457187-largefile-test-regression-fix.patch
Patch980: gdb-py-frame-rip-test-fix.patch
Patch981: gdb-tekhex-regression-revert.patch
%if 0%{!?rhel:1} || 0%{?rhel} > 6
# RL_STATE_FEDORA_GDB would not be found for:
@ -719,11 +709,11 @@ find -name "*.info*"|xargs rm -f
# Match the Fedora's version info.
%patch2 -p1
%patch232 -p1
#patch232 -p1
%patch349 -p1
%patch888 -p1
%patch912 -p1
%patch889 -p1
%patch912 -p1
%patch1 -p1
%patch105 -p1
@ -822,17 +812,15 @@ find -name "*.info*"|xargs rm -f
%patch852 -p1
%patch863 -p1
%patch887 -p1
%patch914 -p1
%patch918 -p1
%patch920 -p1
%patch921 -p1
%patch925 -p1
%patch927 -p1
%patch970 -p1
%patch971 -p1
%patch973 -p1
%patch975 -p1
%patch976 -p1
%patch977 -p1
%patch978 -p1
%patch979 -p1
%patch980 -p1
%patch981 -p1
%patch848 -p1
%if 0%{!?el6:1}
@ -1271,10 +1259,9 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/pstack
%{_mandir}/*/pstack.1*
%{_datadir}/gdb
%{_includedir}/gdb
# Provide jit-reader.h so that users are able to write their own GDB JIT
# Provide gdb/jit-reader.h so that users are able to write their own GDB JIT
# plugins.
%{_includedir}/gdb/jit-reader.h
%{_includedir}/gdb
# don't include the files in include, they are part of binutils
@ -1334,6 +1321,10 @@ then
fi
%changelog
* Thu Jan 8 2015 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.8.50.20150108-1.fc22
- Rebase to pre-7.9 snapshot 7.8.50.20150108.
- Fix jit-reader.h for multi-lib.
* Sun Dec 28 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.8.1-36.fc21
- Rebase to 7.8.1.20141228 for a performance fix (PR binutils/17677).

View File

@ -1,2 +1,2 @@
4981307aa9619bbec5b73261e4e41c8d gdb-libstdc++-v3-python-r155978.tar.bz2
4c1769b40a602ce196f76323b2a95a9b gdb-7.8.1.20141228.tar.xz
6b43f1079e9a6401c7277d6bd777bd7f gdb-7.8.50.20150108.tar.xz