From 43d8d62a0303c21cbc3f578085e31a50099fa045 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 14 May 2012 15:54:44 +0200 Subject: [PATCH] Rename "set auto-load" patchset variable $ddir to $datadir. --- ...-01of22.patch => gdb-autoload-01of28.patch | 0 ...-02of22.patch => gdb-autoload-02of28.patch | 0 ...-03of22.patch => gdb-autoload-03of28.patch | 0 ...-04of22.patch => gdb-autoload-04of28.patch | 0 ...-05of22.patch => gdb-autoload-05of28.patch | 0 ...-06of22.patch => gdb-autoload-06of28.patch | 0 ...-07of22.patch => gdb-autoload-07of28.patch | 0 ...-08of22.patch => gdb-autoload-08of28.patch | 0 ...-09of22.patch => gdb-autoload-09of28.patch | 0 ...-10of22.patch => gdb-autoload-10of28.patch | 0 ...-11of22.patch => gdb-autoload-11of28.patch | 0 ...-12of22.patch => gdb-autoload-12of28.patch | 0 ...-13of22.patch => gdb-autoload-13of28.patch | 0 ...-14of22.patch => gdb-autoload-14of28.patch | 0 ...-15of22.patch => gdb-autoload-15of28.patch | 0 ...-16of22.patch => gdb-autoload-16of28.patch | 0 ...-17of22.patch => gdb-autoload-17of28.patch | 0 ...-18of22.patch => gdb-autoload-18of28.patch | 0 gdb-autoload-19of28.patch | 45 ++ ...-19of22.patch => gdb-autoload-20of28.patch | 0 ...-20of22.patch => gdb-autoload-21of28.patch | 61 +-- ...-21of22.patch => gdb-autoload-22of28.patch | 247 ++++++----- ...-22of22.patch => gdb-autoload-23of28.patch | 146 ++----- gdb-autoload-24of28.patch | 82 ++++ gdb-autoload-25of28.patch | 64 +++ gdb-autoload-26of28.patch | 42 ++ gdb-autoload-27of28.patch | 225 ++++++++++ gdb-autoload-28of28.patch | 393 ++++++++++++++++++ gdb.spec | 65 +-- 29 files changed, 1072 insertions(+), 298 deletions(-) rename gdb-autoload-01of22.patch => gdb-autoload-01of28.patch (100%) rename gdb-autoload-02of22.patch => gdb-autoload-02of28.patch (100%) rename gdb-autoload-03of22.patch => gdb-autoload-03of28.patch (100%) rename gdb-autoload-04of22.patch => gdb-autoload-04of28.patch (100%) rename gdb-autoload-05of22.patch => gdb-autoload-05of28.patch (100%) rename gdb-autoload-06of22.patch => gdb-autoload-06of28.patch (100%) rename gdb-autoload-07of22.patch => gdb-autoload-07of28.patch (100%) rename gdb-autoload-08of22.patch => gdb-autoload-08of28.patch (100%) rename gdb-autoload-09of22.patch => gdb-autoload-09of28.patch (100%) rename gdb-autoload-10of22.patch => gdb-autoload-10of28.patch (100%) rename gdb-autoload-11of22.patch => gdb-autoload-11of28.patch (100%) rename gdb-autoload-12of22.patch => gdb-autoload-12of28.patch (100%) rename gdb-autoload-13of22.patch => gdb-autoload-13of28.patch (100%) rename gdb-autoload-14of22.patch => gdb-autoload-14of28.patch (100%) rename gdb-autoload-15of22.patch => gdb-autoload-15of28.patch (100%) rename gdb-autoload-16of22.patch => gdb-autoload-16of28.patch (100%) rename gdb-autoload-17of22.patch => gdb-autoload-17of28.patch (100%) rename gdb-autoload-18of22.patch => gdb-autoload-18of28.patch (100%) create mode 100644 gdb-autoload-19of28.patch rename gdb-autoload-19of22.patch => gdb-autoload-20of28.patch (100%) rename gdb-autoload-20of22.patch => gdb-autoload-21of28.patch (51%) rename gdb-autoload-21of22.patch => gdb-autoload-22of28.patch (77%) rename gdb-autoload-22of22.patch => gdb-autoload-23of28.patch (80%) create mode 100644 gdb-autoload-24of28.patch create mode 100644 gdb-autoload-25of28.patch create mode 100644 gdb-autoload-26of28.patch create mode 100644 gdb-autoload-27of28.patch create mode 100644 gdb-autoload-28of28.patch diff --git a/gdb-autoload-01of22.patch b/gdb-autoload-01of28.patch similarity index 100% rename from gdb-autoload-01of22.patch rename to gdb-autoload-01of28.patch diff --git a/gdb-autoload-02of22.patch b/gdb-autoload-02of28.patch similarity index 100% rename from gdb-autoload-02of22.patch rename to gdb-autoload-02of28.patch diff --git a/gdb-autoload-03of22.patch b/gdb-autoload-03of28.patch similarity index 100% rename from gdb-autoload-03of22.patch rename to gdb-autoload-03of28.patch diff --git a/gdb-autoload-04of22.patch b/gdb-autoload-04of28.patch similarity index 100% rename from gdb-autoload-04of22.patch rename to gdb-autoload-04of28.patch diff --git a/gdb-autoload-05of22.patch b/gdb-autoload-05of28.patch similarity index 100% rename from gdb-autoload-05of22.patch rename to gdb-autoload-05of28.patch diff --git a/gdb-autoload-06of22.patch b/gdb-autoload-06of28.patch similarity index 100% rename from gdb-autoload-06of22.patch rename to gdb-autoload-06of28.patch diff --git a/gdb-autoload-07of22.patch b/gdb-autoload-07of28.patch similarity index 100% rename from gdb-autoload-07of22.patch rename to gdb-autoload-07of28.patch diff --git a/gdb-autoload-08of22.patch b/gdb-autoload-08of28.patch similarity index 100% rename from gdb-autoload-08of22.patch rename to gdb-autoload-08of28.patch diff --git a/gdb-autoload-09of22.patch b/gdb-autoload-09of28.patch similarity index 100% rename from gdb-autoload-09of22.patch rename to gdb-autoload-09of28.patch diff --git a/gdb-autoload-10of22.patch b/gdb-autoload-10of28.patch similarity index 100% rename from gdb-autoload-10of22.patch rename to gdb-autoload-10of28.patch diff --git a/gdb-autoload-11of22.patch b/gdb-autoload-11of28.patch similarity index 100% rename from gdb-autoload-11of22.patch rename to gdb-autoload-11of28.patch diff --git a/gdb-autoload-12of22.patch b/gdb-autoload-12of28.patch similarity index 100% rename from gdb-autoload-12of22.patch rename to gdb-autoload-12of28.patch diff --git a/gdb-autoload-13of22.patch b/gdb-autoload-13of28.patch similarity index 100% rename from gdb-autoload-13of22.patch rename to gdb-autoload-13of28.patch diff --git a/gdb-autoload-14of22.patch b/gdb-autoload-14of28.patch similarity index 100% rename from gdb-autoload-14of22.patch rename to gdb-autoload-14of28.patch diff --git a/gdb-autoload-15of22.patch b/gdb-autoload-15of28.patch similarity index 100% rename from gdb-autoload-15of22.patch rename to gdb-autoload-15of28.patch diff --git a/gdb-autoload-16of22.patch b/gdb-autoload-16of28.patch similarity index 100% rename from gdb-autoload-16of22.patch rename to gdb-autoload-16of28.patch diff --git a/gdb-autoload-17of22.patch b/gdb-autoload-17of28.patch similarity index 100% rename from gdb-autoload-17of22.patch rename to gdb-autoload-17of28.patch diff --git a/gdb-autoload-18of22.patch b/gdb-autoload-18of28.patch similarity index 100% rename from gdb-autoload-18of22.patch rename to gdb-autoload-18of28.patch diff --git a/gdb-autoload-19of28.patch b/gdb-autoload-19of28.patch new file mode 100644 index 0000000..f7b1293 --- /dev/null +++ b/gdb-autoload-19of28.patch @@ -0,0 +1,45 @@ +http://sourceware.org/ml/gdb-cvs/2012-05/msg00060.html + +### src/gdb/doc/ChangeLog 2012/05/09 18:15:58 1.1310 +### src/gdb/doc/ChangeLog 2012/05/09 19:29:25 1.1311 +## -3,6 +3,9 @@ + * gdb.texinfo (Auto-loading): Wrap too long lines in @smallexample. + Twice. + ++ * gdb.texinfo (Separate Debug Files, Auto-loading safe path): Replace ++ directory separator by path separator. ++ + 2012-05-06 Jan Kratochvil + + * gdb.texinfo (Auto-loading safe path): Make 'directories' +--- src/gdb/doc/gdb.texinfo 2012/05/09 18:15:58 1.956 ++++ src/gdb/doc/gdb.texinfo 2012/05/09 19:29:25 1.957 +@@ -16285,8 +16285,8 @@ + @kindex set debug-file-directory + @item set debug-file-directory @var{directories} + Set the directories which @value{GDBN} searches for separate debugging +-information files to @var{directory}. Multiple directory components can be set +-concatenating them by a directory separator. ++information files to @var{directory}. Multiple path components can be set ++concatenating them by a path separator. + + @kindex show debug-file-directory + @item show debug-file-directory +@@ -21227,7 +21227,7 @@ + If you omit @var{directories}, @samp{auto-load safe-path} will be reset to + its default value as specified during @value{GDBN} compilation. + +-The list of directories uses directory separator (@samp{:} on GNU and Unix ++The list of directories uses path separator (@samp{:} on GNU and Unix + systems, @samp{;} on MS-Windows and MS-DOS) to separate directories, similarly + to the @env{PATH} environment variable. + +@@ -21242,7 +21242,7 @@ + @item add-auto-load-safe-path + Add an entry (or list of entries) the list of directories trusted for automatic + loading and execution of scripts. Multiple entries may be delimited by the +-host platform directory separator in use. ++host platform path separator in use. + @end table + + Setting this variable to @file{/} disables this security protection. diff --git a/gdb-autoload-19of22.patch b/gdb-autoload-20of28.patch similarity index 100% rename from gdb-autoload-19of22.patch rename to gdb-autoload-20of28.patch diff --git a/gdb-autoload-20of22.patch b/gdb-autoload-21of28.patch similarity index 51% rename from gdb-autoload-20of22.patch rename to gdb-autoload-21of28.patch index f4c7dcd..3632e67 100644 --- a/gdb-autoload-20of22.patch +++ b/gdb-autoload-21of28.patch @@ -1,40 +1,21 @@ -http://sourceware.org/ml/gdb-patches/2012-05/msg00180.html -Subject: [patch] auto-load fix multi-dir debug-file-directory +http://sourceware.org/ml/gdb-cvs/2012-05/msg00079.html -Hi, - -I forgot to fix this case myself, Python auto-load was implemented by: - commit 1e5e2afd7cfa6bb62abb9493a514c70489e19c32 - Author: Tom Tromey - Date: Thu May 28 00:40:23 2009 +0000 - -while multi-dir debug-file-directory was implemented by - commit 36ae52d16cc9d38cfe317a79bb5d63c624359154 - Author: Jan Kratochvil - Date: Mon Nov 2 14:59:48 2009 +0000 - -No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu. - -And debug_file_directory really cannot be NULL after GDB initialization code. - - -Thanks, -Jan - - -gdb/ -2012-05-07 Jan Kratochvil - - Make auto-load handle multiple components of DEBUG_FILE_DIRECTORY. - * auto-load.c (auto_load_objfile_script): Remove check for NULL - DEBUG_FILE_DIRECTORY. Handle multiple components of - DEBUG_FILE_DIRECTORY. - -Diff --git a/gdb/auto-load.c b/gdb/auto-load.c -index 9d4d0bc..254de3b 100644 ---- a/gdb/auto-load.c -+++ b/gdb/auto-load.c -@@ -587,17 +587,29 @@ auto_load_objfile_script (struct objfile *objfile, +### src/gdb/ChangeLog 2012/05/10 20:17:46 1.14235 +### src/gdb/ChangeLog 2012/05/11 18:06:26 1.14236 +## -1,3 +1,10 @@ ++2012-05-11 Jan Kratochvil ++ ++ Make auto-load handle multiple components of DEBUG_FILE_DIRECTORY. ++ * auto-load.c (auto_load_objfile_script): Remove check for NULL ++ DEBUG_FILE_DIRECTORY. Handle multiple components of ++ DEBUG_FILE_DIRECTORY. ++ + 2012-05-10 Tom Tromey + + * dwarf2read.c (recursively_write_psymbols): New function. +--- src/gdb/auto-load.c 2012/05/06 15:31:02 1.6 ++++ src/gdb/auto-load.c 2012/05/11 18:06:28 1.7 +@@ -587,17 +587,29 @@ input = fopen (filename, "r"); debugfile = filename; @@ -47,12 +28,13 @@ index 9d4d0bc..254de3b 100644 - strcpy (debugfile, debug_file_directory); - /* FILENAME is absolute, so we don't need a "/" here. */ - strcat (debugfile, filename); +- +- make_cleanup (xfree, debugfile); +- input = fopen (debugfile, "r"); + char *debugdir; + VEC (char_ptr) *debugdir_vec; + int ix; - -- make_cleanup (xfree, debugfile); -- input = fopen (debugfile, "r"); ++ + debugdir_vec = dirnames_to_char_ptr_vec (debug_file_directory); + make_cleanup_free_char_ptr_vec (debugdir_vec); + @@ -73,4 +55,3 @@ index 9d4d0bc..254de3b 100644 } if (!input && gdb_datadir) - diff --git a/gdb-autoload-21of22.patch b/gdb-autoload-22of28.patch similarity index 77% rename from gdb-autoload-21of22.patch rename to gdb-autoload-22of28.patch index daecb5d..769b724 100644 --- a/gdb-autoload-21of22.patch +++ b/gdb-autoload-22of28.patch @@ -1,78 +1,63 @@ -http://sourceware.org/ml/gdb-patches/2012-05/msg00303.html -Subject: Re: [patch 1/2] Provide $ddir substitution for --with-auto-load-safe-path - -On Wed, 09 May 2012 19:41:08 +0200, Eli Zaretskii wrote: -> Okay with that. Thanks. - -Updated just the doc. - - -Thanks, -Jan - - - -gdb/ -2012-05-09 Jan Kratochvil - - Provide $ddir substitution for --with-auto-load-safe-path. - * NEWS (--with-auto-load-safe-path, --without-auto-load-safe-path): New - entries. - * auto-load.c: Include observer.h. - (auto_load_safe_path_vec_update): Call substitute_path_component for - each component. New variable ddir_subst. - (auto_load_gdb_datadir_changed): New function. - (set_auto_load_safe_path): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to - AUTO_LOAD_SAFE_PATH. New comment. - (_initialize_auto_load): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to - AUTO_LOAD_SAFE_PATH. Install auto_load_gdb_datadir_changed. - * config.in: Regenerate. - * configure: Regenerate. - * configure.ac (--auto-load-safe-path): Rename - DEFAULT_AUTO_LOAD_SAFE_PATH to AUTO_LOAD_SAFE_PATH. Default to - GDB_DATADIR/auto-load. - * defs.h (substitute_path_component): New declaration. - * top.c: Include observer.h. - (set_gdb_datadir): New function. - (init_main): Install it for "set data-directory". - * utils.c (substitute_path_component): New function. - -gdb/doc/ -2012-05-09 Jan Kratochvil - - Provide $ddir substitution for --with-auto-load-safe-path. - * gdb.texinfo (Auto-loading): Replace /usr/local by $ddir/auto-load. - (Auto-loading safe path): Likewise. Mention the default value, - $ddir substitution, --with-auto-load-safe-path and - --without-auto-load-safe-path. - * observer.texi (gdb_datadir_changed): New. +http://sourceware.org/ml/gdb-cvs/2012-05/msg00080.html +### src/gdb/ChangeLog 2012/05/11 18:06:26 1.14236 +### src/gdb/ChangeLog 2012/05/11 18:13:22 1.14237 +## -1,5 +1,29 @@ + 2012-05-11 Jan Kratochvil + ++ Provide $ddir substitution for --with-auto-load-safe-path. ++ * NEWS (--with-auto-load-safe-path, --without-auto-load-safe-path): New ++ entries. ++ * auto-load.c: Include observer.h. ++ (auto_load_safe_path_vec_update): Call substitute_path_component for ++ each component. New variable ddir_subst. ++ (auto_load_gdb_datadir_changed): New function. ++ (set_auto_load_safe_path): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to ++ AUTO_LOAD_SAFE_PATH. New comment. ++ (_initialize_auto_load): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to ++ AUTO_LOAD_SAFE_PATH. Install auto_load_gdb_datadir_changed. ++ * config.in: Regenerate. ++ * configure: Regenerate. ++ * configure.ac (--auto-load-safe-path): Rename ++ DEFAULT_AUTO_LOAD_SAFE_PATH to AUTO_LOAD_SAFE_PATH. Default to ++ GDB_DATADIR/auto-load. ++ * defs.h (substitute_path_component): New declaration. ++ * top.c: Include observer.h. ++ (set_gdb_datadir): New function. ++ (init_main): Install it for "set data-directory". ++ * utils.c (substitute_path_component): New function. ++ ++2012-05-11 Jan Kratochvil ++ + Make auto-load handle multiple components of DEBUG_FILE_DIRECTORY. + * auto-load.c (auto_load_objfile_script): Remove check for NULL + DEBUG_FILE_DIRECTORY. Handle multiple components of Index: gdb-7.4.50.20120120/gdb/NEWS =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/NEWS 2012-05-09 22:13:58.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/NEWS 2012-05-09 22:14:29.091183190 +0200 -@@ -76,6 +76,17 @@ set debug auto-load on|off - show debug auto-load - Control display of debugging info for auto-loading the files above. +--- gdb-7.4.50.20120120.orig/gdb/NEWS 2012-05-14 14:17:49.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/NEWS 2012-05-14 14:18:01.915041258 +0200 +@@ -307,6 +307,17 @@ show trace-stop-notes + instance as an explanation, if you are stopping a trace run that was + started by someone else. +* New configure options + +--with-auto-load-safe-path + Configure default value for the 'set auto-load safe-path' setting -+ above. It defaults to '$ddir/auto-load', $ddir representing the value -+ of configure option --with-gdb-datadir. ++ above. It defaults to '$ddir/auto-load', $ddir representing GDB's ++ data directory (available via show data-directory). + +--without-auto-load-safe-path + Set 'set auto-load safe-path' to '/', effectively disabling this + security feature. + - * New command line options + * New remote packets - --init-command=FILE, -ix Like --command, -x but execute it + QTEnable Index: gdb-7.4.50.20120120/gdb/auto-load.c =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/auto-load.c 2012-05-09 22:13:58.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/auto-load.c 2012-05-09 22:14:04.812222226 +0200 +--- gdb-7.4.50.20120120.orig/gdb/auto-load.c 2012-05-14 14:17:49.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/auto-load.c 2012-05-14 14:18:01.915041258 +0200 @@ -35,6 +35,7 @@ #include "gdb_vecs.h" #include "readline/tilde.h" @@ -146,8 +131,8 @@ Index: gdb-7.4.50.20120120/gdb/auto-load.c add_auto_load_safe_path, Index: gdb-7.4.50.20120120/gdb/config.in =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/config.in 2012-05-09 22:13:58.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/config.in 2012-05-09 22:14:04.812222226 +0200 +--- gdb-7.4.50.20120120.orig/gdb/config.in 2012-05-14 14:17:49.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/config.in 2012-05-14 14:18:01.915041258 +0200 @@ -7,6 +7,9 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD @@ -170,8 +155,8 @@ Index: gdb-7.4.50.20120120/gdb/config.in Index: gdb-7.4.50.20120120/gdb/configure =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/configure 2012-05-09 22:13:58.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/configure 2012-05-09 22:16:19.877005083 +0200 +--- gdb-7.4.50.20120120.orig/gdb/configure 2012-05-14 14:17:49.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/configure 2012-05-14 14:18:01.918041252 +0200 @@ -1668,7 +1668,8 @@ Optional Packages: --with-rpm query rpm database for missing debuginfos (yes/no, def. auto=librpm.so) @@ -211,8 +196,8 @@ Index: gdb-7.4.50.20120120/gdb/configure Index: gdb-7.4.50.20120120/gdb/configure.ac =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/configure.ac 2012-05-09 22:13:58.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/configure.ac 2012-05-09 22:16:10.592020012 +0200 +--- gdb-7.4.50.20120120.orig/gdb/configure.ac 2012-05-14 14:17:49.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/configure.ac 2012-05-14 14:18:01.919041250 +0200 @@ -341,13 +341,16 @@ fi AC_MSG_CHECKING([for default auto-load safe-path]) @@ -239,8 +224,8 @@ Index: gdb-7.4.50.20120120/gdb/configure.ac Index: gdb-7.4.50.20120120/gdb/defs.h =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/defs.h 2012-05-09 22:13:57.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/defs.h 2012-05-09 22:14:04.816222220 +0200 +--- gdb-7.4.50.20120120.orig/gdb/defs.h 2012-05-14 14:17:48.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/defs.h 2012-05-14 14:18:01.919041250 +0200 @@ -442,6 +442,9 @@ extern struct cleanup *make_bpstat_clear extern int producer_is_gcc_ge_4 (const char *producer); @@ -251,70 +236,10 @@ Index: gdb-7.4.50.20120120/gdb/defs.h #ifdef HAVE_WAITPID extern pid_t wait_to_die_with_timeout (pid_t pid, int *status, int timeout); #endif -Index: gdb-7.4.50.20120120/gdb/doc/gdb.texinfo -=================================================================== ---- gdb-7.4.50.20120120.orig/gdb/doc/gdb.texinfo 2012-05-09 22:13:58.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/doc/gdb.texinfo 2012-05-09 22:16:43.759966688 +0200 -@@ -20803,7 +20803,7 @@ local-gdbinit: Auto-loading of .gdbinit - is on. - python-scripts: Auto-loading of Python scripts is on. - safe-path: List of directories from which it is safe to auto-load files -- is /usr/local. -+ is $ddir/auto-load. - @end smallexample - - @anchor{info auto-load} -@@ -21006,9 +21006,9 @@ get loaded: - $ ./gdb -q ./gdb - Reading symbols from /home/user/gdb/gdb...done. - warning: File "/home/user/gdb/gdb-gdb.gdb" auto-loading has been -- declined by your `auto-load safe-path' set to "/usr/local". -+ declined by your `auto-load safe-path' set to "$ddir/auto-load". - warning: File "/home/user/gdb/gdb-gdb.py" auto-loading has been -- declined by your `auto-load safe-path' set to "/usr/local". -+ declined by your `auto-load safe-path' set to "$ddir/auto-load". - @end smallexample - - The list of trusted directories is controlled by the following commands: -@@ -21040,7 +21040,18 @@ loading and execution of scripts. Multi - host platform directory separator in use. - @end table - --Setting this variable to @file{/} disables this security protection. -+This variable defaults to @file{$ddir/auto-load}. The default @code{set -+auto-load safe-path} value can be also overriden by @value{GDBN} configuration -+option @option{--with-auto-load-safe-path}. -+ -+Any used string @file{$ddir} will get replaced by @var{data-directory} which is -+determined at @value{GDBN} startup (@pxref{Data Files}). @file{$ddir} must be -+be placed as a directory component --- either alone or delimited by @file{/} or -+@file{\} directory separators, depending on the host platform. -+ -+Setting this variable to @file{/} disables this security protection, -+corresponding @value{GDBN} configuration option is -+@option{--without-auto-load-safe-path}. - This variable is supposed to be set to the system directories writable by the - system superuser only. Users can add their source directories in init files in - their home directories (@pxref{Home Directory Init File}). See also deprecated -Index: gdb-7.4.50.20120120/gdb/doc/observer.texi -=================================================================== ---- gdb-7.4.50.20120120.orig/gdb/doc/observer.texi 2012-05-09 22:13:56.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/doc/observer.texi 2012-05-09 22:17:04.118933948 +0200 -@@ -231,6 +231,10 @@ the current top-level prompt. - @c collector pass. Currently only @code{type_mark_used} marker is supported. - @c @end deftypefun - -+@deftypefun void gdb_datadir_changed (void) -+Variable gdb_datadir has been set. The value may not necessarily change. -+@end deftypefun -+ - @deftypefun void test_notification (int @var{somearg}) - This observer is used for internal testing. Do not use. - See testsuite/gdb.gdb/observer.exp. Index: gdb-7.4.50.20120120/gdb/top.c =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/top.c 2012-05-09 22:13:57.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/top.c 2012-05-09 22:14:04.823222208 +0200 +--- gdb-7.4.50.20120120.orig/gdb/top.c 2012-05-14 14:17:48.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/top.c 2012-05-14 14:18:01.919041250 +0200 @@ -47,6 +47,7 @@ #include "gdbthread.h" #include "python/python.h" @@ -350,8 +275,8 @@ Index: gdb-7.4.50.20120120/gdb/top.c } Index: gdb-7.4.50.20120120/gdb/utils.c =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/utils.c 2012-05-09 22:13:57.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/utils.c 2012-05-09 22:14:04.824222206 +0200 +--- gdb-7.4.50.20120120.orig/gdb/utils.c 2012-05-14 14:17:49.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/utils.c 2012-05-14 14:18:01.920041248 +0200 @@ -3925,6 +3925,48 @@ dirnames_to_char_ptr_vec (const char *di return retval; } @@ -401,3 +326,63 @@ Index: gdb-7.4.50.20120120/gdb/utils.c #ifdef HAVE_WAITPID #ifdef SIGALRM +Index: gdb-7.4.50.20120120/gdb/doc/gdb.texinfo +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/doc/gdb.texinfo 2012-05-14 14:17:49.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/doc/gdb.texinfo 2012-05-14 14:18:01.925041238 +0200 +@@ -20803,7 +20803,7 @@ local-gdbinit: Auto-loading of .gdbinit + is on. + python-scripts: Auto-loading of Python scripts is on. + safe-path: List of directories from which it is safe to auto-load files +- is /usr/local. ++ is $ddir/auto-load. + @end smallexample + + @anchor{info auto-load} +@@ -21006,9 +21006,9 @@ get loaded: + $ ./gdb -q ./gdb + Reading symbols from /home/user/gdb/gdb...done. + warning: File "/home/user/gdb/gdb-gdb.gdb" auto-loading has been +- declined by your `auto-load safe-path' set to "/usr/local". ++ declined by your `auto-load safe-path' set to "$ddir/auto-load". + warning: File "/home/user/gdb/gdb-gdb.py" auto-loading has been +- declined by your `auto-load safe-path' set to "/usr/local". ++ declined by your `auto-load safe-path' set to "$ddir/auto-load". + @end smallexample + + The list of trusted directories is controlled by the following commands: +@@ -21040,7 +21040,18 @@ loading and execution of scripts. Multi + host platform path separator in use. + @end table + +-Setting this variable to @file{/} disables this security protection. ++This variable defaults to @file{$ddir/auto-load}. The default @code{set ++auto-load safe-path} value can be also overriden by @value{GDBN} configuration ++option @option{--with-auto-load-safe-path}. ++ ++Any used string @file{$ddir} will get replaced by @var{data-directory} which is ++determined at @value{GDBN} startup (@pxref{Data Files}). @file{$ddir} must be ++be placed as a directory component --- either alone or delimited by @file{/} or ++@file{\} directory separators, depending on the host platform. ++ ++Setting this variable to @file{/} disables this security protection, ++corresponding @value{GDBN} configuration option is ++@option{--without-auto-load-safe-path}. + This variable is supposed to be set to the system directories writable by the + system superuser only. Users can add their source directories in init files in + their home directories (@pxref{Home Directory Init File}). See also deprecated +Index: gdb-7.4.50.20120120/gdb/doc/observer.texi +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/doc/observer.texi 2012-05-14 14:17:47.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/doc/observer.texi 2012-05-14 14:18:01.926041236 +0200 +@@ -231,6 +231,10 @@ the current top-level prompt. + @c collector pass. Currently only @code{type_mark_used} marker is supported. + @c @end deftypefun + ++@deftypefun void gdb_datadir_changed (void) ++Variable gdb_datadir has been set. The value may not necessarily change. ++@end deftypefun ++ + @deftypefun void test_notification (int @var{somearg}) + This observer is used for internal testing. Do not use. + See testsuite/gdb.gdb/observer.exp. diff --git a/gdb-autoload-22of22.patch b/gdb-autoload-23of28.patch similarity index 80% rename from gdb-autoload-22of22.patch rename to gdb-autoload-23of28.patch index 7ced624..bb811f6 100644 --- a/gdb-autoload-22of22.patch +++ b/gdb-autoload-23of28.patch @@ -1,93 +1,35 @@ -http://sourceware.org/ml/gdb-patches/2012-05/msg00301.html -Subject: Re: [patch 2/2] Implement multi-component --with-auto-load-dir - -On Wed, 09 May 2012 19:47:07 +0200, Eli Zaretskii wrote: -> > Date: Wed, 9 May 2012 17:48:47 +0200 -> > From: Jan Kratochvil -> > -> > +set auto-load scripts-directory [:...] -> > + Set a list of directories with auto-loaded scripts. Automatically -> -> "Set a list of directories from which to load auto-loaded scripts." - -OK. - - -> > +Set the list of directories with auto-loaded scripts."), _("\ -> > +Show the list of directories with auto-loaded scripts."), _("\ -> -> Likewise here. - -But used "the", "the" is present/reviewed in many other locations in code. - - -> > +may be delimited by the host platform directory separator in use. -> -> I believe the correct term is "path separator". - -done. - - -> I suggest to say -> -> (@samp{:} on Unix, @samp{;} on Windows and DOS) -> -> for clarity here, and not further down. - -Used, with MS- prefixes. - - -> -> > +Each entry here needs to be covered also by the security setting -> > +@xref{set auto-load safe-path}. -> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -> You want "(@pxref{...})" here. - -Used: -Each entry here needs to be covered also by the security setting -@code{set auto-load safe-path} (@pxref{set auto-load safe-path}). - - -Thanks, -Jan - - -gdb/ -2012-05-09 Jan Kratochvil - - Implement multi-component --with-auto-load-dir. - * NEWS (set auto-load scripts-directory, --with-auto-load-dir): New - entries. - (--with-auto-load-safe-path): Update the default value description. - * auto-load.c (auto_load_dir, set_auto_load_dir, show_auto_load_dir): - New. - (auto_load_objfile_script): Add DEBUG_AUTO_LOAD output. Remove - GDB_DATADIR NULL check. Replace GDB_DATADIR/auto-load by - AUTO_LOAD_DIR. Support $ddir and multiple components in it. - (_initialize_auto_load): Initialize also auto_load_dir. Install new - "set auto-load scripts-directory". - * config.in: Regenerate. - * configure: Regenerate. - * configure.ac (--with-auto-load-dir): New configure option. - (--auto-load-safe-path): Change the default to --with-auto-load-dir. - -gdb/doc/ -2012-05-09 Jan Kratochvil - - Implement multi-component --with-auto-load-dir. - * gdb.texinfo (Auto-loading): New references - for 'set auto-load scripts-directory' - and 'show auto-load scripts-directory'. - (Auto-loading safe path): Describe the new default. Move $ddir - substituation reference to 'objfile-gdb.py file'. - (objfile-gdb.py file): Describe script-name alias. Change real-name to - script-name. Describe new 'set auto-load scripts-directory' - and 'show auto-load scripts-directory'. +http://sourceware.org/ml/gdb-cvs/2012-05/msg00081.html +### src/gdb/ChangeLog 2012/05/11 18:13:22 1.14237 +### src/gdb/ChangeLog 2012/05/11 18:20:25 1.14238 +## -1,5 +1,23 @@ + 2012-05-11 Jan Kratochvil + ++ Implement multi-component --with-auto-load-dir. ++ * NEWS (set auto-load scripts-directory, --with-auto-load-dir): New ++ entries. ++ (--with-auto-load-safe-path): Update the default value description. ++ * auto-load.c (auto_load_dir, set_auto_load_dir, show_auto_load_dir): ++ New. ++ (auto_load_objfile_script): Add DEBUG_AUTO_LOAD output. Remove ++ GDB_DATADIR NULL check. Replace GDB_DATADIR/auto-load by ++ AUTO_LOAD_DIR. Support $ddir and multiple components in it. ++ (_initialize_auto_load): Initialize also auto_load_dir. Install new ++ "set auto-load scripts-directory". ++ * config.in: Regenerate. ++ * configure: Regenerate. ++ * configure.ac (--with-auto-load-dir): New configure option. ++ (--auto-load-safe-path): Change the default to --with-auto-load-dir. ++ ++2012-05-11 Jan Kratochvil ++ + Provide $ddir substitution for --with-auto-load-safe-path. + * NEWS (--with-auto-load-safe-path, --without-auto-load-safe-path): New + entries. Index: gdb-7.4.50.20120120/gdb/NEWS =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/NEWS 2012-05-09 22:14:29.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/NEWS 2012-05-09 22:17:16.416914184 +0200 +--- gdb-7.4.50.20120120.orig/gdb/NEWS 2012-05-14 14:18:01.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/NEWS 2012-05-14 14:18:29.712985871 +0200 @@ -67,6 +67,12 @@ set auto-load libthread-db on|off show auto-load libthread-db Control auto-loading of inferior specific thread debugging shared library. @@ -101,27 +43,27 @@ Index: gdb-7.4.50.20120120/gdb/NEWS set auto-load safe-path [:...] show auto-load safe-path Set a list of directories from which it is safe to auto-load files. -@@ -78,10 +84,14 @@ show debug auto-load +@@ -309,10 +315,14 @@ show trace-stop-notes * New configure options +--with-auto-load-dir + Configure default value for the 'set auto-load scripts-directory' + setting above. It defaults to '$ddir/auto-load', $ddir representing -+ the value of configure option --with-gdb-datadir. ++ GDB's data directory (available via show data-directory). + --with-auto-load-safe-path Configure default value for the 'set auto-load safe-path' setting -- above. It defaults to '$ddir/auto-load', $ddir representing the value -- of configure option --with-gdb-datadir. +- above. It defaults to '$ddir/auto-load', $ddir representing GDB's +- data directory (available via show data-directory). + above. It defaults to the --with-auto-load-dir setting. --without-auto-load-safe-path Set 'set auto-load safe-path' to '/', effectively disabling this Index: gdb-7.4.50.20120120/gdb/auto-load.c =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/auto-load.c 2012-05-09 22:14:04.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/auto-load.c 2012-05-09 22:17:16.417914182 +0200 +--- gdb-7.4.50.20120120.orig/gdb/auto-load.c 2012-05-14 14:18:01.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/auto-load.c 2012-05-14 14:18:29.713985869 +0200 @@ -108,6 +108,35 @@ show_auto_load_local_gdbinit (struct ui_ value); } @@ -266,8 +208,8 @@ Index: gdb-7.4.50.20120120/gdb/auto-load.c add_setshow_optional_filename_cmd ("safe-path", class_support, Index: gdb-7.4.50.20120120/gdb/config.in =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/config.in 2012-05-09 22:14:04.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/config.in 2012-05-09 22:17:16.417914182 +0200 +--- gdb-7.4.50.20120120.orig/gdb/config.in 2012-05-14 14:18:01.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/config.in 2012-05-14 14:18:29.713985869 +0200 @@ -7,6 +7,9 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD @@ -280,8 +222,8 @@ Index: gdb-7.4.50.20120120/gdb/config.in Index: gdb-7.4.50.20120120/gdb/configure =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/configure 2012-05-09 22:16:19.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/configure 2012-05-09 22:19:19.192716798 +0200 +--- gdb-7.4.50.20120120.orig/gdb/configure 2012-05-14 14:18:01.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/configure 2012-05-14 14:21:13.068849103 +0200 @@ -955,6 +955,7 @@ with_separate_debug_dir with_gdb_datadir with_relocated_sources @@ -348,8 +290,8 @@ Index: gdb-7.4.50.20120120/gdb/configure escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]ddir\>/\\\\\\\\\\\\&/g'` Index: gdb-7.4.50.20120120/gdb/configure.ac =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/configure.ac 2012-05-09 22:16:10.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/configure.ac 2012-05-09 22:19:08.390734167 +0200 +--- gdb-7.4.50.20120120.orig/gdb/configure.ac 2012-05-14 14:18:01.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/configure.ac 2012-05-14 14:21:01.597871716 +0200 @@ -339,16 +339,26 @@ extern rpmdbMatchIterator rpmtsInitItera fi fi @@ -381,8 +323,8 @@ Index: gdb-7.4.50.20120120/gdb/configure.ac [Directories safe to hold auto-loaded files.]) Index: gdb-7.4.50.20120120/gdb/doc/gdb.texinfo =================================================================== ---- gdb-7.4.50.20120120.orig/gdb/doc/gdb.texinfo 2012-05-09 22:16:43.000000000 +0200 -+++ gdb-7.4.50.20120120/gdb/doc/gdb.texinfo 2012-05-09 22:18:38.294782549 +0200 +--- gdb-7.4.50.20120120.orig/gdb/doc/gdb.texinfo 2012-05-14 14:18:01.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/doc/gdb.texinfo 2012-05-14 14:20:13.653966212 +0200 @@ -20804,6 +20804,8 @@ local-gdbinit: Auto-loading of .gdbinit python-scripts: Auto-loading of Python scripts is on. safe-path: List of directories from which it is safe to auto-load files @@ -404,7 +346,7 @@ Index: gdb-7.4.50.20120120/gdb/doc/gdb.texinfo @tab Control for init file in the current directory. @item @xref{show auto-load local-gdbinit}. @@ -21040,15 +21046,13 @@ loading and execution of scripts. Multi - host platform directory separator in use. + host platform path separator in use. @end table -This variable defaults to @file{$ddir/auto-load}. The default @code{set diff --git a/gdb-autoload-24of28.patch b/gdb-autoload-24of28.patch new file mode 100644 index 0000000..35d601e --- /dev/null +++ b/gdb-autoload-24of28.patch @@ -0,0 +1,82 @@ +http://sourceware.org/ml/gdb-cvs/2012-05/msg00082.html + +### src/gdb/doc/ChangeLog 2012/05/11 18:20:26 1.1313 +### src/gdb/doc/ChangeLog 2012/05/11 18:23:11 1.1314 +## -1,5 +1,12 @@ + 2012-05-11 Jan Kratochvil + ++ * gdb.texinfo (Auto-loading, Init File in the Current Directory) ++ (libthread_db.so.1 file, objfile-gdb.gdb file, objfile-gdb.py file) ++ (dotdebug_gdb_scripts section): Add reference ++ to 'Auto-loading safe path'. ++ ++2012-05-11 Jan Kratochvil ++ + Implement multi-component --with-auto-load-dir. + * gdb.texinfo (Auto-loading): New references + for 'set auto-load scripts-directory' +--- src/gdb/doc/gdb.texinfo 2012/05/11 18:20:26 1.959 ++++ src/gdb/doc/gdb.texinfo 2012/05/11 18:23:11 1.960 +@@ -20973,6 +20973,10 @@ + results or introduce security risks (e.g., if the file comes from untrusted + sources). + ++Note that loading of these associated files (including the local @file{.gdbinit} ++file) requires accordingly configured @code{auto-load safe-path} ++(@pxref{Auto-loading safe path}). ++ + For these reasons, @value{GDBN} includes commands and options to let you + control when to auto-load files and which files should be auto-loaded. + +@@ -21112,6 +21116,9 @@ + from init file (if any) in the current working directory, + see @ref{Init File in the Current Directory during Startup}. + ++Note that loading of this local @file{.gdbinit} file also requires accordingly ++configured @code{auto-load safe-path} (@pxref{Auto-loading safe path}). ++ + @table @code + @anchor{set auto-load local-gdbinit} + @kindex set auto-load local-gdbinit +@@ -21148,6 +21155,9 @@ + auto-load libthread-db} is enabled before trying to open such thread debugging + library. + ++Note that loading of this debugging library also requires accordingly configured ++@code{auto-load safe-path} (@pxref{Auto-loading safe path}). ++ + @table @code + @anchor{set auto-load libthread-db} + @kindex set auto-load libthread-db +@@ -21175,6 +21185,9 @@ + canned sequences of commands (@pxref{Sequences}), as long as @samp{set + auto-load gdb-scripts} is set to @samp{on}. + ++Note that loading of this script file also requires accordingly configured ++@code{auto-load safe-path} (@pxref{Auto-loading safe path}). ++ + For more background refer to the similar Python scripts auto-loading + description (@pxref{objfile-gdb.py file}). + +@@ -25465,7 +25478,10 @@ + directories mentioned in the value of @code{debug-file-directory}. + + Finally, if this file does not exist, then @value{GDBN} will look for +-@var{script-name} file in all of the directories specified by: ++@var{script-name} file in all of the directories as specified below. ++ ++Note that loading of this script file also requires accordingly configured ++@code{auto-load safe-path} (@pxref{Auto-loading safe path}). + + @table @code + @anchor{set auto-load scripts-directory} +@@ -25542,6 +25558,9 @@ + + The script name may include directories if desired. + ++Note that loading of this script file also requires accordingly configured ++@code{auto-load safe-path} (@pxref{Auto-loading safe path}). ++ + If the macro is put in a header, any application or library + using this header will get a reference to the specified script. + diff --git a/gdb-autoload-25of28.patch b/gdb-autoload-25of28.patch new file mode 100644 index 0000000..ac5939c --- /dev/null +++ b/gdb-autoload-25of28.patch @@ -0,0 +1,64 @@ +http://sourceware.org/ml/gdb-cvs/2012-05/msg00091.html + +### src/gdb/doc/ChangeLog 2012/05/11 22:24:22 1.1315 +### src/gdb/doc/ChangeLog 2012/05/12 14:20:30 1.1316 +## -1,3 +1,9 @@ ++2012-05-12 Jan Kratochvil ++ Eli Zaretskii ++ ++ * gdb.texinfo (Separate Debug Files): Use plural form for global ++ debugging information directory. ++ + 2012-05-11 Stan Shebs + Kwok Cheung Yeung + +--- src/gdb/doc/gdb.texinfo 2012/05/11 22:24:22 1.961 ++++ src/gdb/doc/gdb.texinfo 2012/05/12 14:20:31 1.962 +@@ -16287,7 +16287,7 @@ + @cindex debugging information in separate files + @cindex @file{.debug} subdirectories + @cindex debugging information directory, global +-@cindex global debugging information directory ++@cindex global debugging information directories + @cindex build ID, and separate debugging files + @cindex @file{.build-id} directory + +@@ -16332,14 +16332,14 @@ + @item + For the ``debug link'' method, @value{GDBN} looks up the named file in + the directory of the executable file, then in a subdirectory of that +-directory named @file{.debug}, and finally under the global debug +-directory, in a subdirectory whose name is identical to the leading ++directory named @file{.debug}, and finally under each one of the global debug ++directories, in a subdirectory whose name is identical to the leading + directories of the executable's absolute file name. + + @item + For the ``build ID'' method, @value{GDBN} looks in the +-@file{.build-id} subdirectory of the global debug directory for a file +-named @file{@var{nn}/@var{nnnnnnnn}.debug}, where @var{nn} are the ++@file{.build-id} subdirectory of each one of the global debug directories for ++a file named @file{@var{nn}/@var{nnnnnnnn}.debug}, where @var{nn} are the + first 2 hex characters of the build ID bit string, and @var{nnnnnnnn} + are the rest of the bit string. (Real build ID strings are 32 or more + hex characters, not 10.) +@@ -16348,7 +16348,7 @@ + So, for example, suppose you ask @value{GDBN} to debug + @file{/usr/bin/ls}, which has a debug link that specifies the + file @file{ls.debug}, and a build ID whose value in hex is +-@code{abcdef1234}. If the global debug directory is ++@code{abcdef1234}. If the list of the global debug directories includes + @file{/usr/lib/debug}, then @value{GDBN} will look for the following + debug information files, in the indicated order: + +@@ -16363,8 +16363,8 @@ + @file{/usr/lib/debug/usr/bin/ls.debug}. + @end itemize + +-You can set the global debugging info directory's name, and view the +-name @value{GDBN} is currently using. ++You can set the global debugging info directories, and view the ++list @value{GDBN} is currently using. + + @table @code + diff --git a/gdb-autoload-26of28.patch b/gdb-autoload-26of28.patch new file mode 100644 index 0000000..d88c43d --- /dev/null +++ b/gdb-autoload-26of28.patch @@ -0,0 +1,42 @@ +http://sourceware.org/ml/gdb-patches/2012-05/msg00449.html +Subject: [patch] Cosmetic fix 'show auto-load safe-path' for ":" [Re: [patch 1/2] Provide $ddir substitution for --with-auto-load-safe-path] + +On Fri, 11 May 2012 21:33:53 +0200, Jan Kratochvil wrote: +> On Fri, 11 May 2012 21:14:47 +0200, Pedro Alves wrote: +> > Looks like there is some special casing somewhere: +> +> True, I forgot and I agree. But it is only this "cosmetic" message, it has no +> functionality effect. I can fix this "any directory" message conditional. + +Regards, +Jan + + +gdb/ +2012-05-11 Jan Kratochvil + + * auto-load.c (show_auto_load_safe_path): Accept any combination of + DIRNAME_SEPARATOR and IS_DIR_SEPARATOR for wild-match. + +diff --git a/gdb/auto-load.c b/gdb/auto-load.c +index 5ee117f..462ee06 100644 +--- a/gdb/auto-load.c ++++ b/gdb/auto-load.c +@@ -241,7 +241,15 @@ static void + show_auto_load_safe_path (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) + { +- if (strcmp (value, "/") == 0) ++ const char *cs; ++ ++ /* Check if user has entered either "/" or for example ":". ++ But while more complicate content like ":/foo" would still also ++ permit any location do not hide those. */ ++ ++ for (cs = value; *cs && (*cs == DIRNAME_SEPARATOR || IS_DIR_SEPARATOR (*cs)); ++ cs++); ++ if (*cs == 0) + fprintf_filtered (file, _("Auto-load files are safe to load from any " + "directory.\n")); + else + diff --git a/gdb-autoload-27of28.patch b/gdb-autoload-27of28.patch new file mode 100644 index 0000000..228d958 --- /dev/null +++ b/gdb-autoload-27of28.patch @@ -0,0 +1,225 @@ +http://sourceware.org/ml/gdb-patches/2012-05/msg00476.html +Subject: [patch 1/2] auto-load: Rename $ddir to $datadir + +Hi, + +when Doug suggested $ddir for data-directory, similar to $cdir, $pdir and +$sdir already in use, it made sense. + +But currently I need to introduce also a variable for debug-file-directory and +having both $ddir and $debugdir valid in the same string seems to be confusing. + +Therefore proposing to have $datadir and $debugdir instead in the next patch, +this patch is just a machanical rename $ddir -> $datadir. + +I do not think it needs backward compatibiluty as $ddir has not yet been in +any GDB release. + + +Thanks, +Jan + + +gdb/ +2012-05-12 Jan Kratochvil + + Rename $ddir to $datadir. + * NEWS (--with-auto-load-dir): Rename $ddir to $datadir. + * auto-load.c (auto_load_safe_path_vec_update) + (auto_load_gdb_datadir_changed, auto_load_objfile_script): Likewise. + * configure: Regenerate. + * configure.ac (--with-auto-load-dir, --with-auto-load-safe-path): + Likewise. Remove the 'use $ddir' help string. + +gdb/doc/ +2012-05-12 Jan Kratochvil + + Rename $ddir to $datadir. + * gdb.texinfo (Auto-loading, Auto-loading safe path) + (objfile-gdb.py file): Rename $ddir to $datadir. + +Index: gdb-7.4.50.20120120/gdb/NEWS +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/NEWS 2012-05-14 14:24:15.112490286 +0200 ++++ gdb-7.4.50.20120120/gdb/NEWS 2012-05-14 14:24:20.224480210 +0200 +@@ -317,8 +317,8 @@ show trace-stop-notes + + --with-auto-load-dir + Configure default value for the 'set auto-load scripts-directory' +- setting above. It defaults to '$ddir/auto-load', $ddir representing +- GDB's data directory (available via show data-directory). ++ setting above. It defaults to '$datadir/auto-load', $datadir ++ representing GDB's data directory (available via show data-directory). + + --with-auto-load-safe-path + Configure default value for the 'set auto-load safe-path' setting +Index: gdb-7.4.50.20120120/gdb/auto-load.c +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/auto-load.c 2012-05-14 14:24:15.112490286 +0200 ++++ gdb-7.4.50.20120120/gdb/auto-load.c 2012-05-14 14:24:20.224480210 +0200 +@@ -174,13 +174,13 @@ auto_load_safe_path_vec_update (void) + char *ddir_subst, *expanded, *real_path; + + ddir_subst = xstrdup (dir); +- substitute_path_component (&ddir_subst, "$ddir", gdb_datadir); ++ substitute_path_component (&ddir_subst, "$datadir", gdb_datadir); + expanded = tilde_expand (ddir_subst); + xfree (ddir_subst); + real_path = gdb_realpath (expanded); + + /* Ensure the current entry is at least a valid path (therefore +- $ddir-expanded and tilde-expanded). */ ++ $datadir-expanded and tilde-expanded). */ + VEC_replace (char_ptr, auto_load_safe_path_vec, ix, expanded); + + if (debug_auto_load) +@@ -212,7 +212,7 @@ auto_load_safe_path_vec_update (void) + } + } + +-/* Variable gdb_datadir has been set. Update content depending on $ddir. */ ++/* Variable gdb_datadir has been set. Update content depending on $datadir. */ + + static void + auto_load_gdb_datadir_changed (void) +@@ -699,7 +699,7 @@ auto_load_objfile_script (struct objfile + for (ix = 0; VEC_iterate (char_ptr, vec, ix, dir); ++ix) + { + debugfile = xstrdup (dir); +- substitute_path_component (&debugfile, "$ddir", gdb_datadir); ++ substitute_path_component (&debugfile, "$datadir", gdb_datadir); + debugfile = xrealloc (debugfile, (strlen (debugfile) + + strlen (filename) + 1)); + +Index: gdb-7.4.50.20120120/gdb/configure +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/configure 2012-05-14 14:24:15.112490286 +0200 ++++ gdb-7.4.50.20120120/gdb/configure 2012-05-14 14:24:38.564444061 +0200 +@@ -1669,11 +1669,10 @@ Optional Packages: + --with-rpm query rpm database for missing debuginfos (yes/no, + def. auto=librpm.so) + --with-auto-load-dir=PATH +- directories from which to load auto-loaded scripts, +- use '$ddir' for -data-directory [$ddir/auto-load] ++ directories from which to load auto-loaded scripts ++ [$datadir/auto-load] + --with-auto-load-safe-path=PATH +- directories safe to hold auto-loaded files, use +- $ddir for --with-gdb-datadir path ++ directories safe to hold auto-loaded files + [--with-auto-load-dir] + --without-auto-load-safe-path + do not restrict auto-loaded files locations +@@ -8495,10 +8494,10 @@ $as_echo_n "checking for default auto-lo + if test "${with_auto_load_dir+set}" = set; then : + withval=$with_auto_load_dir; + else +- with_auto_load_dir='$ddir/auto-load' ++ with_auto_load_dir='$datadir/auto-load' + fi + +-escape_dir=`echo $with_auto_load_dir | sed 's/[$]ddir\>/\\\\\\\\\\\\&/g'` ++escape_dir=`echo $with_auto_load_dir | sed 's/[$]datadir\>/\\\\\\\\\\\\&/g'` + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +@@ -8525,7 +8524,7 @@ else + with_auto_load_safe_path="$with_auto_load_dir" + fi + +-escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]ddir\>/\\\\\\\\\\\\&/g'` ++escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]datadir\>/\\\\\\\\\\\\&/g'` + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +Index: gdb-7.4.50.20120120/gdb/configure.ac +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/configure.ac 2012-05-14 14:24:15.112490286 +0200 ++++ gdb-7.4.50.20120120/gdb/configure.ac 2012-05-14 14:24:20.228480202 +0200 +@@ -342,9 +342,9 @@ fi + AC_MSG_CHECKING([for default auto-load directory]) + AC_ARG_WITH(auto-load-dir, + AS_HELP_STRING([--with-auto-load-dir=PATH], +- [directories from which to load auto-loaded scripts, use '$ddir' for -data-directory @<:@$ddir/auto-load@:>@]),, +- [with_auto_load_dir='$ddir/auto-load']) +-escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]ddir\>/\\\\\\\\\\\\&/g'` ++ [directories from which to load auto-loaded scripts @<:@$datadir/auto-load@:>@]),, ++ [with_auto_load_dir='$datadir/auto-load']) ++escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]datadir\>/\\\\\\\\\\\\&/g'` + AC_DEFINE_DIR(AUTO_LOAD_DIR, escape_dir, + [Directories from which to load auto-loaded scripts.]) + AC_MSG_RESULT([$with_auto_load_dir]) +@@ -352,14 +352,14 @@ AC_MSG_RESULT([$with_auto_load_dir]) + AC_MSG_CHECKING([for default auto-load safe-path]) + AC_ARG_WITH(auto-load-safe-path, + AS_HELP_STRING([--with-auto-load-safe-path=PATH], +- [directories safe to hold auto-loaded files, use $ddir for --with-gdb-datadir path @<:@--with-auto-load-dir@:>@]) ++ [directories safe to hold auto-loaded files @<:@--with-auto-load-dir@:>@]) + AS_HELP_STRING([--without-auto-load-safe-path], + [do not restrict auto-loaded files locations]), + [if test "$with_auto_load_safe_path" = "no"; then + with_auto_load_safe_path="/" + fi], + [with_auto_load_safe_path="$with_auto_load_dir"]) +-escape_dir=`echo $with_auto_load_safe_path | sed 's/[[$]]ddir\>/\\\\\\\\\\\\&/g'` ++escape_dir=`echo $with_auto_load_safe_path | sed 's/[[$]]datadir\>/\\\\\\\\\\\\&/g'` + AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, + [Directories safe to hold auto-loaded files.]) + AC_MSG_RESULT([$with_auto_load_safe_path]) +Index: gdb-7.4.50.20120120/gdb/doc/gdb.texinfo +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/doc/gdb.texinfo 2012-05-14 14:24:15.113490284 +0200 ++++ gdb-7.4.50.20120120/gdb/doc/gdb.texinfo 2012-05-14 14:24:20.234480190 +0200 +@@ -20807,9 +20807,9 @@ local-gdbinit: Auto-loading of .gdbinit + is on. + python-scripts: Auto-loading of Python scripts is on. + safe-path: List of directories from which it is safe to auto-load files +- is $ddir/auto-load. ++ is $datadir/auto-load. + scripts-directory: List of directories from which to load auto-loaded scripts +- is $ddir/auto-load. ++ is $datadir/auto-load. + @end smallexample + + @anchor{info auto-load} +@@ -21025,9 +21025,9 @@ get loaded: + $ ./gdb -q ./gdb + Reading symbols from /home/user/gdb/gdb...done. + warning: File "/home/user/gdb/gdb-gdb.gdb" auto-loading has been +- declined by your `auto-load safe-path' set to "$ddir/auto-load". ++ declined by your `auto-load safe-path' set to "$datadir/auto-load". + warning: File "/home/user/gdb/gdb-gdb.py" auto-loading has been +- declined by your `auto-load safe-path' set to "$ddir/auto-load". ++ declined by your `auto-load safe-path' set to "$datadir/auto-load". + @end smallexample + + The list of trusted directories is controlled by the following commands: +@@ -21060,7 +21060,7 @@ host platform path separator in use. + @end table + + This variable defaults to what @code{--with-auto-load-dir} has been configured +-to (@pxref{with-auto-load-dir}). @file{$ddir} substituation applies the same ++to (@pxref{with-auto-load-dir}). @file{$datadir} substituation applies the same + as for @xref{set auto-load scripts-directory}. + The default @code{set + auto-load safe-path} value can be also overriden by @value{GDBN} configuration +@@ -25181,14 +25181,14 @@ Each entry here needs to be covered also + @code{set auto-load safe-path} (@pxref{set auto-load safe-path}). + + @anchor{with-auto-load-dir} +-This variable defaults to @file{$ddir/auto-load}. The default @code{set ++This variable defaults to @file{$datadir/auto-load}. The default @code{set + auto-load safe-path} value can be also overriden by @value{GDBN} configuration + option @option{--with-auto-load-dir}. + +-Any used string @file{$ddir} will get replaced by @var{data-directory} which is +-determined at @value{GDBN} startup (@pxref{Data Files}). @file{$ddir} must be +-be placed as a directory component --- either alone or delimited by @file{/} or +-@file{\} directory separators, depending on the host platform. ++Any used string @file{$datadir} will get replaced by @var{data-directory} which ++is determined at @value{GDBN} startup (@pxref{Data Files}). @file{$datadir} ++must be placed as a directory component --- either alone or delimited by ++@file{/} or @file{\} directory separators, depending on the host platform. + + The list of directories uses path separator (@samp{:} on GNU and Unix + systems, @samp{;} on MS-Windows and MS-DOS) to separate directories, similarly diff --git a/gdb-autoload-28of28.patch b/gdb-autoload-28of28.patch new file mode 100644 index 0000000..06797af --- /dev/null +++ b/gdb-autoload-28of28.patch @@ -0,0 +1,393 @@ +http://sourceware.org/ml/gdb-patches/2012-05/msg00477.html +Subject: [patch+doc 2/2] auto-load: Fix default /usr/lib/debug/ loading + +Hi, + +with recent security fix to use only $datadir/auto-load/ directory instead of +anything under $prefix/ (which contains insecure $prefix/tmp/ etc.) it +introduced a regression that GDB's default --with-separate-debug-dir would no +longer be secure; which IMO can be assumed as secure. This is because +I forgot to move into 'set auto-load scripts-directory' (and 'safe-path') also +debug-file-diretory; besides $datadir/auto-load which I have moved there. + +To also solve the problem with relocatability and make it configurable I just +introduce besides $datadir now also $debugdir and add it into +default 'set auto-load scripts-directory'. It also IMO makes it more clear +what everything is being auto-loaded in: + +(gdb) show auto-load +gdb-scripts: Auto-loading of canned sequences of commands scripts is on. +libthread-db: Auto-loading of inferior specific libthread_db is on. +local-gdbinit: Auto-loading of .gdbinit script from current directory is on. +python-scripts: Auto-loading of Python scripts is on. +safe-path: List of directories from which it is safe to auto-load files is $debugdir:$datadir/auto-load. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +scripts-directory: List of directories from which to load auto-loaded scripts is $debugdir:$datadir/auto-load. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu. + +I find it more just a bugfix of a regression by myself. + + +Thanks, +Jan + + +gdb/ +2012-05-12 Jan Kratochvil + + * NEWS (--with-auto-load-dir): Prepend $debugdir to the default path. + Describe it. + * auto-load.c (auto_load_expand_dir_vars): New function. + (auto_load_safe_path_vec_update): Use it, remove the + substitute_path_component call thanks to it. + (auto_load_objfile_script): Remove the debug_file_directory processing. + Use auto_load_expand_dir_vars, remove the substitute_path_component + call thanks to it. + * configure: Regenerate. + * configure.ac (--with-auto-load-dir): Prepend $debugdir to the default + path. Escape $ also for $debugdir. + (--with_auto_load_safe_path): Escape $ also for $debugdir. + * utils.c (substitute_path_component): Accept also DIRNAME_SEPARATOR. + +gdb/doc/ +2012-05-12 Jan Kratochvil + + * gdb.texinfo (Separate Debug Files): New anchor debug-file-directory. + Mention also --with-separate-debug-dir. + (Auto-loading): Prepend $debugdir in the sample output. + (Auto-loading safe path): Likewise. Mention also $debugdir for the + auto-load safe-path variable. + (objfile-gdb.py file): Remove the extra debug-file-directory paragraph. + Mention also $debugdir for 'set auto-load scripts-directory'. + +Index: gdb-7.4.50.20120120/gdb/NEWS +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/NEWS 2012-05-14 14:24:20.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/NEWS 2012-05-14 14:24:49.510422485 +0200 +@@ -317,8 +317,10 @@ show trace-stop-notes + + --with-auto-load-dir + Configure default value for the 'set auto-load scripts-directory' +- setting above. It defaults to '$datadir/auto-load', $datadir +- representing GDB's data directory (available via show data-directory). ++ setting above. It defaults to '$debugdir:$datadir/auto-load', ++ $debugdir representing global debugging info directories (available ++ via 'show debug-file-directory') and $datadir representing GDB's data ++ directory (available via 'show data-directory'). + + --with-auto-load-safe-path + Configure default value for the 'set auto-load safe-path' setting +Index: gdb-7.4.50.20120120/gdb/auto-load.c +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/auto-load.c 2012-05-14 14:24:20.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/auto-load.c 2012-05-14 14:24:49.511422483 +0200 +@@ -147,6 +147,30 @@ static char *auto_load_safe_path; + counterpart. */ + static VEC (char_ptr) *auto_load_safe_path_vec; + ++/* Expand $datadir and $debugdir in STRING according to the rules of ++ substitute_path_component. Return vector from dirnames_to_char_ptr_vec, ++ this vector must be freed by free_char_ptr_vec by the caller. */ ++ ++static VEC (char_ptr) * ++auto_load_expand_dir_vars (const char *string) ++{ ++ VEC (char_ptr) *dir_vec; ++ char *s; ++ ++ s = xstrdup (string); ++ substitute_path_component (&s, "$datadir", gdb_datadir); ++ substitute_path_component (&s, "$debugdir", debug_file_directory); ++ ++ if (debug_auto_load && strcmp (s, string) != 0) ++ fprintf_unfiltered (gdb_stdlog, ++ _("auto-load: Expanded $-variables to \"%s\".\n"), s); ++ ++ dir_vec = dirnames_to_char_ptr_vec (s); ++ xfree(s); ++ ++ return dir_vec; ++} ++ + /* Update auto_load_safe_path_vec from current AUTO_LOAD_SAFE_PATH. */ + + static void +@@ -163,7 +187,7 @@ auto_load_safe_path_vec_update (void) + + free_char_ptr_vec (auto_load_safe_path_vec); + +- auto_load_safe_path_vec = dirnames_to_char_ptr_vec (auto_load_safe_path); ++ auto_load_safe_path_vec = auto_load_expand_dir_vars (auto_load_safe_path); + len = VEC_length (char_ptr, auto_load_safe_path_vec); + + /* Apply tilde_expand and gdb_realpath to each AUTO_LOAD_SAFE_PATH_VEC +@@ -171,16 +195,10 @@ auto_load_safe_path_vec_update (void) + for (ix = 0; ix < len; ix++) + { + char *dir = VEC_index (char_ptr, auto_load_safe_path_vec, ix); +- char *ddir_subst, *expanded, *real_path; +- +- ddir_subst = xstrdup (dir); +- substitute_path_component (&ddir_subst, "$datadir", gdb_datadir); +- expanded = tilde_expand (ddir_subst); +- xfree (ddir_subst); +- real_path = gdb_realpath (expanded); ++ char *expanded = tilde_expand (dir); ++ char *real_path = gdb_realpath (expanded); + +- /* Ensure the current entry is at least a valid path (therefore +- $datadir-expanded and tilde-expanded). */ ++ /* Ensure the current entry is at least tilde_expand-ed. */ + VEC_replace (char_ptr, auto_load_safe_path_vec, ix, expanded); + + if (debug_auto_load) +@@ -645,42 +663,6 @@ auto_load_objfile_script (struct objfile + + if (!input) + { +- char *debugdir; +- VEC (char_ptr) *debugdir_vec; +- int ix; +- +- debugdir_vec = dirnames_to_char_ptr_vec (debug_file_directory); +- make_cleanup_free_char_ptr_vec (debugdir_vec); +- +- if (debug_auto_load) +- fprintf_unfiltered (gdb_stdlog, +- _("auto-load: Searching 'set debug-file-directory' " +- "path \"%s\".\n"), +- debug_file_directory); +- +- for (ix = 0; VEC_iterate (char_ptr, debugdir_vec, ix, debugdir); ++ix) +- { +- /* Also try the same file in the separate debug info directory. */ +- debugfile = xmalloc (strlen (debugdir) + strlen (filename) + 1); +- strcpy (debugfile, debugdir); +- +- /* FILENAME is absolute, so we don't need a "/" here. */ +- strcat (debugfile, filename); +- +- make_cleanup (xfree, debugfile); +- input = fopen (debugfile, "r"); +- if (debug_auto_load) +- fprintf_unfiltered (gdb_stdlog, _("auto-load: Attempted file " +- "\"%s\" %s.\n"), +- debugfile, +- input ? _("exists") : _("does not exist")); +- if (input != NULL) +- break; +- } +- } +- +- if (!input) +- { + VEC (char_ptr) *vec; + int ix; + char *dir; +@@ -688,7 +670,7 @@ auto_load_objfile_script (struct objfile + /* Also try the same file in a subdirectory of gdb's data + directory. */ + +- vec = dirnames_to_char_ptr_vec (auto_load_dir); ++ vec = auto_load_expand_dir_vars (auto_load_dir); + make_cleanup_free_char_ptr_vec (vec); + + if (debug_auto_load) +@@ -698,10 +680,8 @@ auto_load_objfile_script (struct objfile + + for (ix = 0; VEC_iterate (char_ptr, vec, ix, dir); ++ix) + { +- debugfile = xstrdup (dir); +- substitute_path_component (&debugfile, "$datadir", gdb_datadir); +- debugfile = xrealloc (debugfile, (strlen (debugfile) +- + strlen (filename) + 1)); ++ debugfile = xmalloc (strlen (dir) + strlen (filename) + 1); ++ strcpy (debugfile, dir); + + /* FILENAME is absolute, so we don't need a "/" here. */ + strcat (debugfile, filename); +Index: gdb-7.4.50.20120120/gdb/configure +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/configure 2012-05-14 14:24:38.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/configure 2012-05-14 14:24:55.856409977 +0200 +@@ -1670,7 +1670,7 @@ Optional Packages: + def. auto=librpm.so) + --with-auto-load-dir=PATH + directories from which to load auto-loaded scripts +- [$datadir/auto-load] ++ [$debugdir:$datadir/auto-load] + --with-auto-load-safe-path=PATH + directories safe to hold auto-loaded files + [--with-auto-load-dir] +@@ -8494,10 +8494,10 @@ $as_echo_n "checking for default auto-lo + if test "${with_auto_load_dir+set}" = set; then : + withval=$with_auto_load_dir; + else +- with_auto_load_dir='$datadir/auto-load' ++ with_auto_load_dir='$debugdir:$datadir/auto-load' + fi + +-escape_dir=`echo $with_auto_load_dir | sed 's/[$]datadir\>/\\\\\\\\\\\\&/g'` ++escape_dir=`echo $with_auto_load_dir | sed 's/[$]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +@@ -8524,7 +8524,7 @@ else + with_auto_load_safe_path="$with_auto_load_dir" + fi + +-escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]datadir\>/\\\\\\\\\\\\&/g'` ++escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +Index: gdb-7.4.50.20120120/gdb/configure.ac +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/configure.ac 2012-05-14 14:24:20.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/configure.ac 2012-05-14 14:24:49.515422477 +0200 +@@ -342,9 +342,9 @@ fi + AC_MSG_CHECKING([for default auto-load directory]) + AC_ARG_WITH(auto-load-dir, + AS_HELP_STRING([--with-auto-load-dir=PATH], +- [directories from which to load auto-loaded scripts @<:@$datadir/auto-load@:>@]),, +- [with_auto_load_dir='$datadir/auto-load']) +-escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]datadir\>/\\\\\\\\\\\\&/g'` ++ [directories from which to load auto-loaded scripts @<:@$debugdir:$datadir/auto-load@:>@]),, ++ [with_auto_load_dir='$debugdir:$datadir/auto-load']) ++escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` + AC_DEFINE_DIR(AUTO_LOAD_DIR, escape_dir, + [Directories from which to load auto-loaded scripts.]) + AC_MSG_RESULT([$with_auto_load_dir]) +@@ -359,7 +359,7 @@ AS_HELP_STRING([--without-auto-load-safe + with_auto_load_safe_path="/" + fi], + [with_auto_load_safe_path="$with_auto_load_dir"]) +-escape_dir=`echo $with_auto_load_safe_path | sed 's/[[$]]datadir\>/\\\\\\\\\\\\&/g'` ++escape_dir=`echo $with_auto_load_safe_path | sed 's/[[$]]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` + AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, + [Directories safe to hold auto-loaded files.]) + AC_MSG_RESULT([$with_auto_load_safe_path]) +Index: gdb-7.4.50.20120120/gdb/doc/gdb.texinfo +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/doc/gdb.texinfo 2012-05-14 14:24:20.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/doc/gdb.texinfo 2012-05-14 14:24:49.520422467 +0200 +@@ -16028,8 +16028,11 @@ debug information files, in the indicate + @file{/usr/lib/debug/usr/bin/ls.debug}. + @end itemize + +-You can set the global debugging info directories, and view the +-list @value{GDBN} is currently using. ++@anchor{debug-file-directory} ++Global debugging info directories default to what is set by @value{GDBN} ++configure option @option{--with-separate-debug-dir}. During @value{GDBN} run ++you can also set the global debugging info directories, and view the list ++@value{GDBN} is currently using. + + @table @code + +@@ -20807,9 +20810,9 @@ local-gdbinit: Auto-loading of .gdbinit + is on. + python-scripts: Auto-loading of Python scripts is on. + safe-path: List of directories from which it is safe to auto-load files +- is $datadir/auto-load. ++ is $debugdir:$datadir/auto-load. + scripts-directory: List of directories from which to load auto-loaded scripts +- is $datadir/auto-load. ++ is $debugdir:$datadir/auto-load. + @end smallexample + + @anchor{info auto-load} +@@ -21025,9 +21028,11 @@ get loaded: + $ ./gdb -q ./gdb + Reading symbols from /home/user/gdb/gdb...done. + warning: File "/home/user/gdb/gdb-gdb.gdb" auto-loading has been +- declined by your `auto-load safe-path' set to "$datadir/auto-load". ++ declined by your `auto-load safe-path' set ++ to "$debugdir:$datadir/auto-load". + warning: File "/home/user/gdb/gdb-gdb.py" auto-loading has been +- declined by your `auto-load safe-path' set to "$datadir/auto-load". ++ declined by your `auto-load safe-path' set ++ to "$debugdir:$datadir/auto-load". + @end smallexample + + The list of trusted directories is controlled by the following commands: +@@ -21060,11 +21065,10 @@ host platform path separator in use. + @end table + + This variable defaults to what @code{--with-auto-load-dir} has been configured +-to (@pxref{with-auto-load-dir}). @file{$datadir} substituation applies the same +-as for @xref{set auto-load scripts-directory}. +-The default @code{set +-auto-load safe-path} value can be also overriden by @value{GDBN} configuration +-option @option{--with-auto-load-safe-path}. ++to (@pxref{with-auto-load-dir}). @file{$debugdir} and @file{$datadir} ++substituation applies the same as for @xref{set auto-load scripts-directory}. ++The default @code{set auto-load safe-path} value can be also overriden by ++@value{GDBN} configuration option @option{--with-auto-load-safe-path}. + + Setting this variable to @file{/} disables this security protection, + corresponding @value{GDBN} configuration option is +@@ -25158,12 +25162,7 @@ that the file name is absolute, followin + @code{.} and @code{..} components. If this file exists and is + readable, @value{GDBN} will evaluate it as a Python script. + +-If this file does not exist, and if the parameter +-@code{debug-file-directory} is set (@pxref{Separate Debug Files}), +-then @value{GDBN} will look for @var{script-name} in all of the +-directories mentioned in the value of @code{debug-file-directory}. +- +-Finally, if this file does not exist, then @value{GDBN} will look for ++If this file does not exist, then @value{GDBN} will look for + @var{script-name} file in all of the directories as specified below. + + Note that loading of this script file also requires accordingly configured +@@ -25181,12 +25180,14 @@ Each entry here needs to be covered also + @code{set auto-load safe-path} (@pxref{set auto-load safe-path}). + + @anchor{with-auto-load-dir} +-This variable defaults to @file{$datadir/auto-load}. The default @code{set +-auto-load safe-path} value can be also overriden by @value{GDBN} configuration +-option @option{--with-auto-load-dir}. +- +-Any used string @file{$datadir} will get replaced by @var{data-directory} which +-is determined at @value{GDBN} startup (@pxref{Data Files}). @file{$datadir} ++This variable defaults to @file{$debugdir:$datadir/auto-load}. The default ++@code{set auto-load safe-path} value can be also overriden by @value{GDBN} ++configuration option @option{--with-auto-load-dir}. ++ ++Any used string @file{$debugdir} will get replaced by @var{debug-file-directory} ++value (@pxref{Separate Debug Files}) and any used string @file{$datadir} will ++get replaced by @var{data-directory} which is determined at @value{GDBN} startup ++(@pxref{Data Files}). @file{$debugdir} and @file{$datadir} + must be placed as a directory component --- either alone or delimited by + @file{/} or @file{\} directory separators, depending on the host platform. + +Index: gdb-7.4.50.20120120/gdb/utils.c +=================================================================== +--- gdb-7.4.50.20120120.orig/gdb/utils.c 2012-05-14 14:24:11.000000000 +0200 ++++ gdb-7.4.50.20120120/gdb/utils.c 2012-05-14 14:24:49.521422465 +0200 +@@ -3927,8 +3927,8 @@ dirnames_to_char_ptr_vec (const char *di + + /* Substitute all occurences of string FROM by string TO in *STRINGP. *STRINGP + must come from xrealloc-compatible allocator and it may be updated. FROM +- needs to be delimited by IS_DIR_SEPARATOR (or be located at the start or +- end of *STRINGP. */ ++ needs to be delimited by IS_DIR_SEPARATOR or DIRNAME_SEPARATOR (or be ++ located at the start or end of *STRINGP. */ + + void + substitute_path_component (char **stringp, const char *from, const char *to) +@@ -3943,8 +3943,10 @@ substitute_path_component (char **string + if (s == NULL) + break; + +- if ((s == string || IS_DIR_SEPARATOR (s[-1])) +- && (s[from_len] == '\0' || IS_DIR_SEPARATOR (s[from_len]))) ++ if ((s == string || IS_DIR_SEPARATOR (s[-1]) ++ || s[-1] == DIRNAME_SEPARATOR) ++ && (s[from_len] == '\0' || IS_DIR_SEPARATOR (s[from_len]) ++ || s[from_len] == DIRNAME_SEPARATOR)) + { + char *string_new; + diff --git a/gdb.spec b/gdb.spec index d4b96da..2573b92 100644 --- a/gdb.spec +++ b/gdb.spec @@ -35,7 +35,7 @@ Version: 7.4.50.%{snap} # 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: 44%{?dist} +Release: 45%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers @@ -590,28 +590,34 @@ Patch661: gdb-stale-frame_info.patch # Security fix for loading untrusted inferiors, see "set auto-load" (BZ 756117). #=push -Patch662: gdb-autoload-01of22.patch -Patch663: gdb-autoload-02of22.patch -Patch664: gdb-autoload-03of22.patch -Patch665: gdb-autoload-04of22.patch -Patch666: gdb-autoload-05of22.patch -Patch667: gdb-autoload-06of22.patch -Patch668: gdb-autoload-07of22.patch -Patch669: gdb-autoload-08of22.patch -Patch670: gdb-autoload-09of22.patch -Patch671: gdb-autoload-10of22.patch -Patch672: gdb-autoload-11of22.patch -Patch673: gdb-autoload-12of22.patch -Patch674: gdb-autoload-13of22.patch -Patch675: gdb-autoload-14of22.patch -Patch676: gdb-autoload-15of22.patch -Patch677: gdb-autoload-16of22.patch -Patch678: gdb-autoload-17of22.patch -Patch679: gdb-autoload-18of22.patch -Patch680: gdb-autoload-19of22.patch -Patch681: gdb-autoload-20of22.patch -Patch682: gdb-autoload-21of22.patch -Patch683: gdb-autoload-22of22.patch +Patch662: gdb-autoload-01of28.patch +Patch663: gdb-autoload-02of28.patch +Patch664: gdb-autoload-03of28.patch +Patch665: gdb-autoload-04of28.patch +Patch666: gdb-autoload-05of28.patch +Patch667: gdb-autoload-06of28.patch +Patch668: gdb-autoload-07of28.patch +Patch669: gdb-autoload-08of28.patch +Patch670: gdb-autoload-09of28.patch +Patch671: gdb-autoload-10of28.patch +Patch672: gdb-autoload-11of28.patch +Patch673: gdb-autoload-12of28.patch +Patch674: gdb-autoload-13of28.patch +Patch675: gdb-autoload-14of28.patch +Patch676: gdb-autoload-15of28.patch +Patch677: gdb-autoload-16of28.patch +Patch678: gdb-autoload-17of28.patch +Patch679: gdb-autoload-18of28.patch +Patch680: gdb-autoload-19of28.patch +Patch681: gdb-autoload-20of28.patch +Patch682: gdb-autoload-21of28.patch +Patch683: gdb-autoload-22of28.patch +Patch684: gdb-autoload-23of28.patch +Patch685: gdb-autoload-24of28.patch +Patch686: gdb-autoload-25of28.patch +Patch687: gdb-autoload-26of28.patch +Patch688: gdb-autoload-27of28.patch +Patch689: gdb-autoload-28of28.patch %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: @@ -925,6 +931,12 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch681 -p1 %patch682 -p1 %patch683 -p1 +%patch684 -p1 +%patch685 -p1 +%patch686 -p1 +%patch687 -p1 +%patch688 -p1 +%patch689 -p1 %patch393 -p1 %if 0%{!?el5:1} || 0%{?scl:1} @@ -1047,8 +1059,8 @@ $(: RHEL-5 librpm has incompatible API. ) \ --disable-inprocess-agent \ %endif $(: %{_bindir}/mono-gdb.py is workaround for mono BZ 815501. ) \ - --with-auto-load-dir='$ddir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}' \ - --with-auto-load-safe-path='$ddir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}:/usr/lib/debug:%{_root_bindir}/mono-gdb.py' \ + --with-auto-load-dir='$debugdir:$datadir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}' \ + --with-auto-load-safe-path='$debugdir:$datadir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}:%{_root_bindir}/mono-gdb.py' \ %ifarch sparc sparcv9 sparc-%{_vendor}-%{_target_os}%{?_gnu} %else @@ -1409,6 +1421,9 @@ fi %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %changelog +* Mon May 14 2012 Jan Kratochvil - 7.4.50.20120120-45.fc17 +- Rename "set auto-load" patchset variable $ddir to $datadir. + * Wed May 9 2012 Jan Kratochvil - 7.4.50.20120120-44.fc17 - Fix in "set auto-load" patchset for SCL scripts inheritance (BZ 815910).