From 8dadf561851211cb9a5f0b828aa59f896406db53 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 7 Mar 2009 00:32:30 +0000 Subject: [PATCH] - Archer update to the snapshot: 6cf16c0711e844094ab694b3d929f7bd30b49f61 - Fix crash on the inlined functions support. - Fix crash from the PIE support, its varobj_refresh() was called only before varobj_invalidate() which is sufficient. - Fix BuildRequires for the `--with testsuite' runs. - Use the newly introduced `--with-pythondir' option. - Remove libstdcxx [python] pretty printers (as included in libstdc++ rpm now). --- gdb-6.3-pie-20050110.patch | 179 ++---- gdb-6.8-inlining-addon.patch | 128 ++-- gdb-archer.patch | 1181 ++++++++++++++++++++-------------- gdb.spec | 26 +- 4 files changed, 841 insertions(+), 673 deletions(-) diff --git a/gdb-6.3-pie-20050110.patch b/gdb-6.3-pie-20050110.patch index ef41d33..6600d2e 100644 --- a/gdb-6.3-pie-20050110.patch +++ b/gdb-6.3-pie-20050110.patch @@ -26,10 +26,10 @@ Fix scan_dyntag() for binaries provided by valgrind (BZ 460319). -Index: gdb-6.8.50.20090226/gdb/amd64-tdep.c +Index: gdb-6.8.50.20090302/gdb/amd64-tdep.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/amd64-tdep.c 2009-02-28 07:31:48.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/amd64-tdep.c 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/amd64-tdep.c 2009-03-07 00:30:09.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/amd64-tdep.c 2009-03-07 00:30:12.000000000 +0100 @@ -36,6 +36,7 @@ #include "regcache.h" #include "regset.h" @@ -132,10 +132,10 @@ Index: gdb-6.8.50.20090226/gdb/amd64-tdep.c return pc; } -Index: gdb-6.8.50.20090226/gdb/auxv.c +Index: gdb-6.8.50.20090302/gdb/auxv.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/auxv.c 2009-02-27 00:04:32.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/auxv.c 2009-02-28 07:40:35.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/auxv.c 2009-03-07 00:30:06.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/auxv.c 2009-03-07 00:30:12.000000000 +0100 @@ -81,7 +81,7 @@ procfs_xfer_auxv (struct target_ops *ops Return 1 if an entry was read into *TYPEP and *VALP. */ static int @@ -224,10 +224,10 @@ Index: gdb-6.8.50.20090226/gdb/auxv.c break; } -Index: gdb-6.8.50.20090226/gdb/auxv.h +Index: gdb-6.8.50.20090302/gdb/auxv.h =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/auxv.h 2009-01-03 06:57:50.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/auxv.h 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/auxv.h 2009-01-03 06:57:50.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/auxv.h 2009-03-07 00:30:12.000000000 +0100 @@ -36,14 +36,14 @@ struct target_ops; /* Forward declarati Return 1 if an entry was read into *TYPEP and *VALP. */ extern int target_auxv_parse (struct target_ops *ops, @@ -245,10 +245,10 @@ Index: gdb-6.8.50.20090226/gdb/auxv.h /* Print the contents of the target's AUXV on the specified file. */ extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops); -Index: gdb-6.8.50.20090226/gdb/breakpoint.c +Index: gdb-6.8.50.20090302/gdb/breakpoint.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/breakpoint.c 2009-02-28 07:38:47.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/breakpoint.c 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/breakpoint.c 2009-03-07 00:30:10.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/breakpoint.c 2009-03-07 00:30:12.000000000 +0100 @@ -3920,7 +3920,8 @@ describe_other_breakpoints (CORE_ADDR pc printf_filtered (" (thread %d)", b->thread); printf_filtered ("%s%s ", @@ -321,10 +321,10 @@ Index: gdb-6.8.50.20090226/gdb/breakpoint.c static void create_fork_vfork_event_catchpoint (int tempflag, char *cond_string, struct breakpoint_ops *ops) -Index: gdb-6.8.50.20090226/gdb/breakpoint.h +Index: gdb-6.8.50.20090302/gdb/breakpoint.h =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/breakpoint.h 2009-02-27 00:04:32.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/breakpoint.h 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/breakpoint.h 2009-03-07 00:30:06.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/breakpoint.h 2009-03-07 00:30:12.000000000 +0100 @@ -127,6 +127,7 @@ enum enable_state automatically enabled and reset when the call "lands" (either completes, or stops at another @@ -344,11 +344,11 @@ Index: gdb-6.8.50.20090226/gdb/breakpoint.h /* This function returns TRUE if ep is a catchpoint. */ extern int ep_is_catchpoint (struct breakpoint *); -Index: gdb-6.8.50.20090226/gdb/dwarf2read.c +Index: gdb-6.8.50.20090302/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/dwarf2read.c 2009-02-28 07:38:48.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/dwarf2read.c 2009-02-28 07:38:59.000000000 +0100 -@@ -1421,7 +1421,7 @@ dwarf2_build_psymtabs (struct objfile *o +--- gdb-6.8.50.20090302.orig/gdb/dwarf2read.c 2009-03-07 00:30:10.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/dwarf2read.c 2009-03-07 00:30:12.000000000 +0100 +@@ -1413,7 +1413,7 @@ dwarf2_build_psymtabs (struct objfile *o else dwarf2_per_objfile->loc_buffer = NULL; @@ -357,10 +357,10 @@ Index: gdb-6.8.50.20090226/gdb/dwarf2read.c || (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)) { -Index: gdb-6.8.50.20090226/gdb/elfread.c +Index: gdb-6.8.50.20090302/gdb/elfread.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/elfread.c 2009-02-27 00:04:32.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/elfread.c 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/elfread.c 2009-03-07 00:30:06.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/elfread.c 2009-03-07 00:30:12.000000000 +0100 @@ -680,7 +680,7 @@ elf_symfile_read (struct objfile *objfil /* If we are reinitializing, or if we have never loaded syms yet, set table to empty. MAINLINE is cleared so that *_read_psymtab @@ -370,11 +370,11 @@ Index: gdb-6.8.50.20090226/gdb/elfread.c { init_psymbol_list (objfile, 0); mainline = 0; -Index: gdb-6.8.50.20090226/gdb/infrun.c +Index: gdb-6.8.50.20090302/gdb/infrun.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/infrun.c 2009-02-28 07:37:54.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/infrun.c 2009-02-28 07:38:59.000000000 +0100 -@@ -3328,6 +3328,11 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( +--- gdb-6.8.50.20090302.orig/gdb/infrun.c 2009-03-07 00:30:10.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/infrun.c 2009-03-07 00:30:12.000000000 +0100 +@@ -3354,6 +3354,11 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( #endif target_terminal_inferior (); @@ -386,10 +386,10 @@ Index: gdb-6.8.50.20090226/gdb/infrun.c /* If requested, stop when the dynamic linker notifies gdb of events. This allows the user to get control and place breakpoints in initializer routines for -Index: gdb-6.8.50.20090226/gdb/objfiles.c +Index: gdb-6.8.50.20090302/gdb/objfiles.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/objfiles.c 2009-02-27 00:04:32.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/objfiles.c 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/objfiles.c 2009-03-07 00:30:06.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/objfiles.c 2009-03-07 00:30:12.000000000 +0100 @@ -51,6 +51,9 @@ #include "arch-utils.h" #include "exec.h" @@ -431,10 +431,10 @@ Index: gdb-6.8.50.20090226/gdb/objfiles.c /* Before the symbol table code was redone to make it easier to selectively load and remove information particular to a specific linkage unit, gdb used to do these things whenever the monolithic -Index: gdb-6.8.50.20090226/gdb/solib-svr4.c +Index: gdb-6.8.50.20090302/gdb/solib-svr4.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/solib-svr4.c 2009-02-28 07:31:58.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/solib-svr4.c 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/solib-svr4.c 2009-03-07 00:30:09.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/solib-svr4.c 2009-03-07 00:30:12.000000000 +0100 @@ -45,6 +45,7 @@ #include "exec.h" #include "auxv.h" @@ -1116,10 +1116,10 @@ Index: gdb-6.8.50.20090226/gdb/solib-svr4.c + add_info ("linkmap", info_linkmap_command, + "Display the inferior's linkmap."); } -Index: gdb-6.8.50.20090226/gdb/solib.c +Index: gdb-6.8.50.20090302/gdb/solib.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/solib.c 2009-02-21 17:14:49.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/solib.c 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/solib.c 2009-02-21 17:14:49.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/solib.c 2009-03-07 00:30:12.000000000 +0100 @@ -81,6 +81,8 @@ set_solib_ops (struct gdbarch *gdbarch, /* external data declarations */ @@ -1306,10 +1306,10 @@ Index: gdb-6.8.50.20090226/gdb/solib.c + NULL, NULL, + &setdebuglist, &showdebuglist); } -Index: gdb-6.8.50.20090226/gdb/solist.h +Index: gdb-6.8.50.20090302/gdb/solist.h =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/solist.h 2009-02-04 09:42:11.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/solist.h 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/solist.h 2009-02-04 09:42:11.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/solist.h 2009-03-07 00:30:12.000000000 +0100 @@ -61,6 +61,8 @@ struct so_list bfd *abfd; char symbols_loaded; /* flag: symbols read in yet? */ @@ -1330,10 +1330,10 @@ Index: gdb-6.8.50.20090226/gdb/solist.h +extern int debug_solib; + #endif -Index: gdb-6.8.50.20090226/gdb/symfile-mem.c +Index: gdb-6.8.50.20090302/gdb/symfile-mem.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/symfile-mem.c 2009-02-28 07:22:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/symfile-mem.c 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/symfile-mem.c 2009-03-07 00:30:08.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/symfile-mem.c 2009-03-07 00:30:12.000000000 +0100 @@ -116,7 +116,7 @@ symbol_file_add_from_memory (struct bfd } @@ -1343,10 +1343,10 @@ Index: gdb-6.8.50.20090226/gdb/symfile-mem.c /* This might change our ideas about frames already looked at. */ reinit_frame_cache (); -Index: gdb-6.8.50.20090226/gdb/symfile.c +Index: gdb-6.8.50.20090302/gdb/symfile.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/symfile.c 2009-02-28 07:31:58.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/symfile.c 2009-02-28 07:39:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/symfile.c 2009-03-07 00:30:09.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/symfile.c 2009-03-07 00:31:24.000000000 +0100 @@ -47,6 +47,7 @@ #include "readline/readline.h" #include "gdb_assert.h" @@ -1426,95 +1426,10 @@ Index: gdb-6.8.50.20090226/gdb/symfile.c /* If the mtime has changed between the time we set new_modtime and now, we *want* this to be out of date, so don't call stat again now. */ -@@ -3644,6 +3655,7 @@ clear_symtab_users (void) - breakpoint_re_set (); - set_default_breakpoint (0, 0, 0, 0); - clear_pc_function_cache (); -+ varobj_refresh (); - observer_notify_new_objfile (NULL); - - /* Clear globals which might have pointed into a removed objfile. -Index: gdb-6.8.50.20090226/gdb/varobj.c +Index: gdb-6.8.50.20090302/gdb/target.h =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/varobj.c 2009-02-27 00:04:32.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/varobj.c 2009-02-28 07:41:30.000000000 +0100 -@@ -1505,6 +1505,61 @@ varobj_set_visualizer (struct varobj *va - #endif - } - -+void -+varobj_refresh (void) -+{ -+ struct varobj *var; -+ struct varobj_root *croot; -+ int mycount = rootcount; -+ char * name; -+ -+ croot = rootlist; -+ while ((croot != NULL) && (mycount > 0)) -+ { -+ var = croot->rootvar; -+ -+ /* Get rid of the memory for the old expression. This also -+ leaves var->root->exp == NULL, which is ok for the parsing -+ below. */ -+ free_current_contents (&var->root->exp); -+ -+ value_free (var->value); -+ var->type = NULL; -+ -+ name = xstrdup (var->name); -+ -+ /* Reparse the expression. Wrap the call to parse expression, -+ so we can return a sensible error. */ -+ if (!gdb_parse_exp_1 (&name, var->root->valid_block, 0, &var->root->exp)) -+ { -+ return; -+ } -+ -+ /* We definitively need to catch errors here. -+ If evaluate_expression succeeds we got the value we wanted. -+ But if it fails, we still go on with a call to evaluate_type() */ -+ if (gdb_evaluate_expression (var->root->exp, &var->value)) -+ { -+ /* no error */ -+ release_value (var->value); -+ if (value_lazy (var->value)) -+ gdb_value_fetch_lazy (var->value); -+ } -+ else -+ var->value = evaluate_type (var->root->exp); -+ -+ var->type = value_type (var->value); -+ -+ mycount--; -+ croot = croot->next; -+ } -+ -+ if (mycount || (croot != NULL)) -+ warning -+ ("varobj_refresh: assertion failed - wrong tally of root vars (%d:%d)", -+ rootcount, mycount); -+} -+ - /* Update the values for a variable and its children. This is a - two-pronged attack. First, re-parse the value for the root's - expression to see if it's changed. Then go all the way -Index: gdb-6.8.50.20090226/gdb/varobj.h -=================================================================== ---- gdb-6.8.50.20090226.orig/gdb/varobj.h 2009-02-27 00:04:32.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/varobj.h 2009-02-28 07:39:19.000000000 +0100 -@@ -163,4 +163,6 @@ varobj_clear_type_visualizers (); - extern void - varobj_set_visualizer (struct varobj *var, const char *visualizer); - -+extern void varobj_refresh(void); -+ - #endif /* VAROBJ_H */ -Index: gdb-6.8.50.20090226/gdb/target.h -=================================================================== ---- gdb-6.8.50.20090226.orig/gdb/target.h 2009-02-28 07:32:32.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/target.h 2009-02-28 07:38:59.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/target.h 2009-03-07 00:30:09.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/target.h 2009-03-07 00:30:12.000000000 +0100 @@ -542,7 +542,7 @@ struct target_ops Return -1 if there is insufficient buffer for a whole entry. Return 1 if an entry was read into *TYPEP and *VALP. */ diff --git a/gdb-6.8-inlining-addon.patch b/gdb-6.8-inlining-addon.patch index 4d1d988..211b4f4 100644 --- a/gdb-6.8-inlining-addon.patch +++ b/gdb-6.8-inlining-addon.patch @@ -5,10 +5,10 @@ causing: FAIL: gdb.base/unwindonsignal.exp: unwindonsignal, stack unwound resume() -> target_resume() move of clear_inline_frame_state() is for: gdb.mi/mi-nsmoribund.exp -Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-bt.c +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.opt/inline-bt.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-bt.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-bt.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.c 2009-03-06 19:07:30.000000000 +0100 @@ -13,10 +13,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,10 +28,10 @@ Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-bt.c inline int func1(void) { -Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-bt.exp +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.exp =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.opt/inline-bt.exp 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-bt.exp 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-bt.exp 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-bt.exp 2009-03-06 19:07:30.000000000 +0100 @@ -41,18 +41,19 @@ if { [skip_inline_frame_tests] } { return } @@ -60,10 +60,10 @@ Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-bt.exp gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)" gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*func2.*#3 .*main.*" \ -Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-cmds.c +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.opt/inline-cmds.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-cmds.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-cmds.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.c 2009-03-06 19:07:30.000000000 +0100 @@ -13,13 +13,19 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -86,10 +86,10 @@ Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-cmds.c inline int func1(void) { bar (); -Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-cmds.exp +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-03-06 19:07:30.000000000 +0100 @@ -45,28 +45,28 @@ if { [skip_inline_frame_tests] } { # First, check that the things we expected to be inlined really were, @@ -180,10 +180,10 @@ Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-cmds.exp +gdb_test "info frame" "inlined into frame.*" "outer_inline2 inlined" +gdb_test "fini" "" "up from outer_inline2" +gdb_test "info frame" " in main \[^\n\]*\n source language.*" "main not inlined" -Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-locals.c +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.opt/inline-locals.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-locals.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-locals.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.c 2009-03-06 19:07:30.000000000 +0100 @@ -13,11 +13,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -203,10 +203,10 @@ Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-locals.c inline int func1(int arg1) { -Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-locals.exp +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.exp =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.opt/inline-locals.exp 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-locals.exp 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-locals.exp 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-locals.exp 2009-03-06 19:07:30.000000000 +0100 @@ -43,8 +43,8 @@ if { [skip_inline_var_tests] } { set no_frames [skip_inline_frame_tests] @@ -236,10 +236,10 @@ Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-locals.exp + setup_kfail *-*-* "gcc/debug.optimization" +} gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)" -Index: gdb-6.8.50.20090226/gdb/frame.c +Index: gdb-6.8.50.20090302/gdb/frame.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/frame.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/frame.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/frame.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/frame.c 2009-03-06 19:07:30.000000000 +0100 @@ -269,7 +269,7 @@ fprint_frame (struct ui_file *file, stru static struct frame_info * skip_inlined_frames (struct frame_info *frame) @@ -276,10 +276,10 @@ Index: gdb-6.8.50.20090226/gdb/frame.c { sal->symtab = SYMBOL_SYMTAB (sym); sal->line = SYMBOL_LINE (sym); -Index: gdb-6.8.50.20090226/gdb/breakpoint.c +Index: gdb-6.8.50.20090302/gdb/breakpoint.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/breakpoint.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/breakpoint.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/breakpoint.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/breakpoint.c 2009-03-06 19:07:30.000000000 +0100 @@ -57,6 +57,7 @@ #include "top.h" #include "wrapper.h" @@ -343,10 +343,10 @@ Index: gdb-6.8.50.20090226/gdb/breakpoint.c b = set_raw_breakpoint (sal, type); b->enable_state = bp_enabled; -Index: gdb-6.8.50.20090226/gdb/inline-frame.c +Index: gdb-6.8.50.20090302/gdb/inline-frame.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/inline-frame.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/inline-frame.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/inline-frame.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/inline-frame.c 2009-03-06 19:07:30.000000000 +0100 @@ -183,6 +183,12 @@ inline_frame_sniffer (const struct frame if (frame_block == NULL) return 0; @@ -423,10 +423,10 @@ Index: gdb-6.8.50.20090226/gdb/inline-frame.c /* Return the number of hidden functions inlined into the current frame. */ -Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-markers.c +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-markers.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.opt/inline-markers.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-markers.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/testsuite/gdb.opt/inline-markers.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.opt/inline-markers.c 2009-03-06 19:07:30.000000000 +0100 @@ -15,11 +15,6 @@ extern int x, y; @@ -439,10 +439,10 @@ Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.opt/inline-markers.c void marker(void) { x += y; /* set breakpoint 2 here */ -Index: gdb-6.8.50.20090226/gdb/gdbthread.h +Index: gdb-6.8.50.20090302/gdb/gdbthread.h =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/gdbthread.h 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/gdbthread.h 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/gdbthread.h 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/gdbthread.h 2009-03-06 19:07:30.000000000 +0100 @@ -180,6 +180,12 @@ struct thread_info /* Private data used by the target vector implementation. */ @@ -456,10 +456,10 @@ Index: gdb-6.8.50.20090226/gdb/gdbthread.h }; /* Create an empty thread list, or empty the existing one. */ -Index: gdb-6.8.50.20090226/gdb/infcmd.c +Index: gdb-6.8.50.20090302/gdb/infcmd.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/infcmd.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/infcmd.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/infcmd.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/infcmd.c 2009-03-06 19:07:30.000000000 +0100 @@ -1391,11 +1391,11 @@ finish_command_continuation (void *arg) struct type *value_type; @@ -600,10 +600,10 @@ Index: gdb-6.8.50.20090226/gdb/infcmd.c } -Index: gdb-6.8.50.20090226/gdb/infrun.c +Index: gdb-6.8.50.20090302/gdb/infrun.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/infrun.c 2009-02-28 07:37:36.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/infrun.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/infrun.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/infrun.c 2009-03-06 19:07:30.000000000 +0100 @@ -1152,8 +1152,6 @@ a command like `return' or `jump' to con step = 0; } @@ -622,10 +622,10 @@ Index: gdb-6.8.50.20090226/gdb/infrun.c } static int -Index: gdb-6.8.50.20090226/gdb/target.c +Index: gdb-6.8.50.20090302/gdb/target.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/target.c 2009-02-28 07:31:48.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/target.c 2009-02-28 07:38:36.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/target.c 2009-03-06 19:07:26.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/target.c 2009-03-06 19:07:30.000000000 +0100 @@ -41,6 +41,7 @@ #include "target-descriptions.h" #include "gdbthread.h" @@ -642,10 +642,10 @@ Index: gdb-6.8.50.20090226/gdb/target.c dcache_invalidate (target_dcache); for (t = current_target.beneath; t != NULL; t = t->beneath) -Index: gdb-6.8.50.20090226/gdb/inline-frame.h +Index: gdb-6.8.50.20090302/gdb/inline-frame.h =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/inline-frame.h 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/inline-frame.h 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/inline-frame.h 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/inline-frame.h 2009-03-06 19:07:30.000000000 +0100 @@ -43,6 +43,10 @@ void clear_inline_frame_state (ptid_t pt void step_into_inline_frame (ptid_t ptid); @@ -657,10 +657,10 @@ Index: gdb-6.8.50.20090226/gdb/inline-frame.h /* Return the number of hidden functions inlined into the current frame. */ -Index: gdb-6.8.50.20090226/gdb/infcall.c +Index: gdb-6.8.50.20090302/gdb/infcall.c =================================================================== ---- gdb-6.8.50.20090226.orig/gdb/infcall.c 2009-02-28 07:34:09.000000000 +0100 -+++ gdb-6.8.50.20090226/gdb/infcall.c 2009-02-28 07:37:54.000000000 +0100 +--- gdb-6.8.50.20090302.orig/gdb/infcall.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/infcall.c 2009-03-06 19:07:30.000000000 +0100 @@ -898,8 +898,15 @@ The program being debugged exited while if (unwind_on_signal_p) @@ -679,3 +679,35 @@ Index: gdb-6.8.50.20090226/gdb/infcall.c /* FIXME: Insert a bunch of wrap_here; name can be very long if it's a C++ name with arguments and stuff. */ +Index: gdb-6.8.50.20090302/gdb/dwarf2read.c +=================================================================== +--- gdb-6.8.50.20090302.orig/gdb/dwarf2read.c 2009-03-06 19:07:30.000000000 +0100 ++++ gdb-6.8.50.20090302/gdb/dwarf2read.c 2009-03-06 19:07:40.000000000 +0100 +@@ -3463,6 +3463,7 @@ read_func_scope (struct die_info *die, s + unsigned die_children = 0; + struct attribute *call_line, *call_file; + int inlined_func = (die->tag == DW_TAG_inlined_subroutine); ++ struct type *type; + + if (inlined_func) + { +@@ -3504,7 +3505,10 @@ read_func_scope (struct die_info *die, s + add_to_cu_func_list (name, lowpc, highpc, cu); + + new = push_context (0, lowpc); +- new->name = new_symbol (die, read_type_die (die, cu), cu); ++ type = read_type_die (die, cu); ++ gdb_assert (type != NULL); ++ new->name = new_symbol (die, type, cu); ++ gdb_assert (TYPE_CODE (SYMBOL_TYPE (new->name)) == TYPE_CODE_FUNC); + + /* If there is a location expression for DW_AT_frame_base, record + it. */ +@@ -8746,6 +8750,7 @@ read_type_die (struct die_info *die, str + break; + case DW_TAG_subprogram: + case DW_TAG_subroutine_type: ++ case DW_TAG_inlined_subroutine: + this_type = read_subroutine_type (die, cu); + break; + case DW_TAG_array_type: diff --git a/gdb-archer.patch b/gdb-archer.patch index c05498e..7970678 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,7 +2,7 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit 8cc3753a9aad85bf53bef54c04334c60d16cb251 +commit 6cf16c0711e844094ab694b3d929f7bd30b49f61 branch `archer' - the merge of branches: archer-jankratochvil-merge-expr @@ -21,10 +21,10 @@ archer-tromey-delayed-symfile diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 74aa72e..fdb0582 100644 +index 74aa72e..c84a4ac 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -167,11 +167,18 @@ INTL_CFLAGS = @INCINTL@ +@@ -167,11 +167,20 @@ INTL_CFLAGS = @INCINTL@ # Where is the ICONV library? This can be empty if libc has iconv. LIBICONV = @LIBICONV@ @@ -38,12 +38,14 @@ index 74aa72e..fdb0582 100644 +# Did the user give us a --with-gdb-datadir option? +GDB_DATADIR_PATH = @GDB_DATADIR_PATH@ + -+GDB_PYTHONDIR_PATH = @GDB_PYTHONDIR_PATH@ ++# The argument to --with-pythondir. If not given, this is ++# GDB_DATADIR_PATH/python. ++pythondir = @pythondir@ + # Helper code from gnulib. LIBGNU = gnulib/libgnu.a INCGNU = -I$(srcdir)/gnulib -Ignulib -@@ -270,12 +277,34 @@ SUBDIR_TUI_CFLAGS= \ +@@ -270,12 +279,34 @@ SUBDIR_TUI_CFLAGS= \ # SUBDIR_PYTHON_OBS = \ python.o \ @@ -78,7 +80,7 @@ index 74aa72e..fdb0582 100644 python/python-utils.c \ python/python-value.c SUBDIR_PYTHON_DEPS = -@@ -390,7 +419,8 @@ INTERNAL_CFLAGS_BASE = \ +@@ -390,7 +421,8 @@ INTERNAL_CFLAGS_BASE = \ $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \ $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \ $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \ @@ -88,7 +90,7 @@ index 74aa72e..fdb0582 100644 INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS) INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS) -@@ -402,7 +432,7 @@ LDFLAGS = @LDFLAGS@ +@@ -402,7 +434,7 @@ LDFLAGS = @LDFLAGS@ # I think it's perfectly reasonable for a user to set -pg in CFLAGS # and have it work; that's why CFLAGS is here. # PROFILE_CFLAGS is _not_ included, however, because we use monstartup. @@ -97,7 +99,7 @@ index 74aa72e..fdb0582 100644 # If your system is missing alloca(), or, more likely, it's there but # it doesn't work, then refer to libiberty. -@@ -663,6 +693,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ +@@ -663,6 +695,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ valarith.c valops.c valprint.c value.c varobj.c vec.c \ wrapper.c \ xml-tdesc.c xml-support.c \ @@ -105,7 +107,7 @@ index 74aa72e..fdb0582 100644 inferior.c LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c -@@ -733,7 +764,8 @@ config/sparc/nm-sol2.h config/nm-linux.h config/mips/nm-irix5.h \ +@@ -733,7 +766,8 @@ config/sparc/nm-sol2.h config/nm-linux.h config/mips/nm-irix5.h \ config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \ annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \ remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \ @@ -115,7 +117,7 @@ index 74aa72e..fdb0582 100644 # Header files that already have srcdir in them, or which are in objdir. -@@ -812,10 +844,16 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ +@@ -812,10 +846,16 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ trad-frame.o \ tramp-frame.o \ solib.o solib-null.o \ @@ -133,7 +135,7 @@ index 74aa72e..fdb0582 100644 TSOBS = inflow.o SUBDIRS = @subdirs@ -@@ -849,11 +887,38 @@ generated_files = config.h observer.h observer.inc ada-lex.c \ +@@ -849,11 +889,38 @@ generated_files = config.h observer.h observer.inc ada-lex.c \ $(COMPILE) $< $(POSTCOMPILE) @@ -173,7 +175,7 @@ index 74aa72e..fdb0582 100644 installcheck: # The check target can not use subdir_do, because subdir_do does not -@@ -907,8 +972,11 @@ gdb.z:gdb.1 +@@ -907,8 +974,11 @@ gdb.z:gdb.1 # source file and doesn't care about rebuilding or just wants to save the # time it takes for make to check that all is up to date. # install-only is intended to address that need. @@ -187,7 +189,7 @@ index 74aa72e..fdb0582 100644 transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1202,6 +1270,12 @@ stamp-h: config.in config.status +@@ -1202,6 +1272,12 @@ stamp-h: config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -200,7 +202,7 @@ index 74aa72e..fdb0582 100644 config.status: configure configure.tgt configure.host $(SHELL) config.status --recheck -@@ -1845,10 +1919,54 @@ python.o: $(srcdir)/python/python.c +@@ -1845,10 +1921,54 @@ python.o: $(srcdir)/python/python.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python.c $(POSTCOMPILE) @@ -255,7 +257,7 @@ index 74aa72e..fdb0582 100644 python-utils.o: $(srcdir)/python/python-utils.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-utils.c $(POSTCOMPILE) -@@ -1857,6 +1975,39 @@ python-value.o: $(srcdir)/python/python-value.c +@@ -1857,6 +1977,38 @@ python-value.o: $(srcdir)/python/python-value.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-value.c $(POSTCOMPILE) @@ -271,24 +273,23 @@ index 74aa72e..fdb0582 100644 + gdb/__init__.py + +# Install the Python library. Python library files go under -+# $(GDB_PYTHONDIR_PATH)/python. ++# $(pythondir). +install-python: + files='$(PY_FILES)'; for file in $$files; do \ + dir=`echo "$$file" | sed 's,/[^/]*$$,,'`; \ -+ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_PYTHONDIR_PATH)/$$dir; \ -+ $(INSTALL_DATA) $(srcdir)/python/lib/$$file $(DESTDIR)$(GDB_PYTHONDIR_PATH)/$$file; \ ++ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(pythondir)/$$dir; \ ++ $(INSTALL_DATA) $(srcdir)/python/lib/$$file $(DESTDIR)$(pythondir)/$$file; \ + done + -+# Other packages may have their files installed in $(GDB_PYTHONDIR_PATH). ++# Other packages may have their files installed in $(pythondir). +uninstall-python: -+ rm -rf $(DESTDIR)/$(GDB_PYTHONDIR_PATH)/python + files='$(PY_FILES)'; for file in $$files; do \ -+ dir=`echo "$$file" | sed 's,/[^/]*$$,,'`; \ -+ rm -f $(DESTDIR)$(GDB_PYTHONDIR_PATH)/$$file; \ -+ while test "x$$file" != "x$$dir"; do \ -+ rmdir 2>/dev/null "$(DESTDIR)$(GDB_PYTHONDIR_PATH)/$$dir"; \ -+ file="$$dir"; \ -+ dir=`echo "$$file" | sed 's,/[^/]*$$,,'`; \ ++ slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'`; \ ++ rm -f $(DESTDIR)$(pythondir)/$$file; \ ++ while test "x$$file" != "x$$slashdir"; do \ ++ rmdir 2>/dev/null "$(DESTDIR)$(pythondir)$$slashdir"; \ ++ file="$$slashdir"; \ ++ slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'`; \ + done \ + done + @@ -7099,7 +7100,7 @@ index 6059d68..47ee601 100644 default_symfile_offsets, /* sym_offsets: xlate external to internal form */ default_symfile_segments, /* sym_segments: Get segment information from diff --git a/gdb/config.in b/gdb/config.in -index 6aaf77a..1cfb12b 100644 +index 6aaf77a..0c8ccab 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -42,6 +42,12 @@ @@ -7115,17 +7116,7 @@ index 6aaf77a..1cfb12b 100644 /* Define to be a string naming the default host character set. */ #undef GDB_DEFAULT_HOST_CHARSET -@@ -60,6 +66,9 @@ - /* Define to the default OS ABI for this configuration. */ - #undef GDB_OSABI_DEFAULT - -+/* Base directory for GDB Python modules. */ -+#undef GDB_PYTHONDIR_PATH -+ - /* Define to 1 if you have `alloca', as a function or macro. */ - #undef HAVE_ALLOCA - -@@ -169,12 +178,18 @@ +@@ -169,12 +175,18 @@ /* Define if you have the iconv() function. */ #undef HAVE_ICONV @@ -7144,8 +7135,18 @@ index 6aaf77a..1cfb12b 100644 /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES +@@ -618,6 +630,9 @@ + 'ptrdiff_t'. */ + #undef PTRDIFF_T_SUFFIX + ++/* Define to install path for Python sources */ ++#undef PYTHONDIR ++ + /* Bug reporting address */ + #undef REPORT_BUGS_TO + diff --git a/gdb/configure b/gdb/configure -index 7579c84..aa1dd84 100755 +index 7579c84..3a5b582 100755 --- a/gdb/configure +++ b/gdb/configure @@ -314,7 +314,7 @@ ac_subdirs_all="$ac_subdirs_all doc testsuite" @@ -7153,16 +7154,18 @@ index 7579c84..aa1dd84 100755 ac_subdirs_all="$ac_subdirs_all multi-ice" ac_subdirs_all="$ac_subdirs_all gdbserver" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBICONV LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS' -+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE GDB_DATADIR_PATH subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG LIBICONV LIBICONV_INCLUDE LIBICONV_LIBDIR READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT GDB_PYTHONDIR_PATH PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS' ++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE GDB_DATADIR_PATH pythondir subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG LIBICONV LIBICONV_INCLUDE LIBICONV_LIBDIR READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags nm_h LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS' ac_subst_files='host_makefile_frag' ac_pwd=`pwd` -@@ -882,9 +882,12 @@ Optional Packages: +@@ -882,9 +882,14 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-separate-debug-dir=path Look for global separate debug info in this path LIBDIR/debug + --with-gdb-datadir look for global separate data files in this path + [DATADIR/gdb] ++ --with-pythondir install Python data files in this path ++ [DATADIR/gdb/python] --with-libunwind Use libunwind frame unwinding support --with-pkgversion=PKG Use PKG in the version string in place of "GDB" --with-bugurl=URL Direct users to URL to report a bug @@ -7170,7 +7173,7 @@ index 7579c84..aa1dd84 100755 --with-system-readline use installed readline library --with-expat include expat support (auto/yes/no) --with-gnu-ld assume the C compiler uses GNU ld default=no -@@ -899,7 +902,6 @@ Optional Packages: +@@ -899,7 +904,6 @@ Optional Packages: --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-x use the X Window System @@ -7178,7 +7181,7 @@ index 7579c84..aa1dd84 100755 Some influential environment variables: CC C compiler command -@@ -7130,6 +7132,52 @@ _ACEOF +@@ -7130,6 +7134,75 @@ _ACEOF ;; esac @@ -7227,11 +7230,34 @@ index 7579c84..aa1dd84 100755 +esac +GDB_DATADIR_PATH=${gdbdatadir} + ++ ++ ++# Check whether --with-pythondir or --without-pythondir was given. ++if test "${with_pythondir+set}" = set; then ++ withval="$with_pythondir" ++ pythondir="${withval}" ++else ++ pythondir=no ++fi; ++ ++# If the user passed in a path, define it. Otherwise, compute it at ++# runtime based on the possibly-relocatable datadir. ++if test "$pythondir" = "no"; then ++ pythondir='$(GDB_DATADIR_PATH)/python' ++else ++ ++cat >>confdefs.h <<_ACEOF ++#define PYTHONDIR "$pythondir" ++_ACEOF ++ ++fi ++ ++ + subdirs="$subdirs doc testsuite" -@@ -9989,6 +10037,226 @@ if test "$ac_cv_search_dlgetmodinfo" != no; then +@@ -9989,6 +10062,226 @@ if test "$ac_cv_search_dlgetmodinfo" != no; then fi @@ -7458,46 +7484,7 @@ index 7579c84..aa1dd84 100755 # On alpha-osf, it appears that libtermcap and libcurses are not compatible. # There is a very specific comment in /usr/include/curses.h explaining that # termcap routines built into libcurses must not be used. -@@ -11156,6 +11424,7 @@ echo $ECHO_N "checking whether to use python... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $with_python" >&5 - echo "${ECHO_T}$with_python" >&6 - -+GDB_PYTHONDIR_PATH= - if test "${with_python}" = no; then - { echo "$as_me:$LINENO: WARNING: python support disabled; some features may be unavailable." >&5 - echo "$as_me: WARNING: python support disabled; some features may be unavailable." >&2;} -@@ -11387,7 +11656,20 @@ _ACEOF - - fi - fi -- if test ${have_libpython} = no; then -+ if test ${have_libpython} != no; then -+ GDB_PYTHONDIR_PATH="`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib();"`" -+ -+ test "x$prefix" = xNONE && prefix="$ac_default_prefix" -+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -+ ac_define_dir=`eval echo $GDB_PYTHONDIR_PATH` -+ ac_define_dir=`eval echo $ac_define_dir` -+ -+cat >>confdefs.h <<_ACEOF -+#define GDB_PYTHONDIR_PATH "$ac_define_dir" -+_ACEOF -+ -+ -+ else - case "${with_python}" in - yes) - { { echo "$as_me:$LINENO: error: python is missing or unusable" >&5 -@@ -11409,6 +11691,8 @@ echo "$as_me: error: no usable python found at ${with_python}" >&2;} - fi - fi - -+ -+PYTHON_CFLAGS= - if test "${have_libpython}" = yes; then - - cat >>confdefs.h <<\_ACEOF -@@ -11418,6 +11702,8 @@ _ACEOF +@@ -11418,6 +11711,8 @@ _ACEOF CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)" CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)" CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)" @@ -7506,7 +7493,7 @@ index 7579c84..aa1dd84 100755 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)" # Flags needed to compile Python code (taken from python-config --cflags). -@@ -15445,10 +15731,11 @@ fi +@@ -15445,10 +15740,11 @@ fi @@ -7519,7 +7506,7 @@ index 7579c84..aa1dd84 100755 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 -@@ -15550,6 +15837,70 @@ fi +@@ -15550,6 +15846,70 @@ fi done @@ -7590,7 +7577,7 @@ index 7579c84..aa1dd84 100755 # Check the return and argument types of ptrace. No canned test for # this, so roll our own. gdb_ptrace_headers=' -@@ -20776,230 +21127,11 @@ done +@@ -20776,230 +21136,11 @@ done @@ -7822,15 +7809,16 @@ index 7579c84..aa1dd84 100755 ac_config_files="$ac_config_files Makefile .gdbinit:gdbinit.in gnulib/Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF -@@ -21865,6 +21997,7 @@ s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +@@ -21865,6 +22006,8 @@ s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@GDB_DATADIR_PATH@,$GDB_DATADIR_PATH,;t t ++s,@pythondir@,$pythondir,;t t s,@subdirs@,$subdirs,;t t s,@TARGET_OBS@,$TARGET_OBS,;t t s,@PKGVERSION@,$PKGVERSION,;t t -@@ -21880,12 +22013,16 @@ s,@WINDRES@,$WINDRES,;t t +@@ -21880,6 +22023,9 @@ s,@WINDRES@,$WINDRES,;t t s,@ac_ct_WINDRES@,$ac_ct_WINDRES,;t t s,@MIG@,$MIG,;t t s,@ac_ct_MIG@,$ac_ct_MIG,;t t @@ -7840,14 +7828,7 @@ index 7579c84..aa1dd84 100755 s,@READLINE@,$READLINE,;t t s,@READLINE_DEPS@,$READLINE_DEPS,;t t s,@READLINE_CFLAGS@,$READLINE_CFLAGS,;t t - s,@HAVE_LIBEXPAT@,$HAVE_LIBEXPAT,;t t - s,@LIBEXPAT@,$LIBEXPAT,;t t - s,@LTLIBEXPAT@,$LTLIBEXPAT,;t t -+s,@GDB_PYTHONDIR_PATH@,$GDB_PYTHONDIR_PATH,;t t - s,@PYTHON_CFLAGS@,$PYTHON_CFLAGS,;t t - s,@ALLOCA@,$ALLOCA,;t t - s,@CONFIG_LDFLAGS@,$CONFIG_LDFLAGS,;t t -@@ -21944,7 +22081,6 @@ s,@CONFIG_UNINSTALL@,$CONFIG_UNINSTALL,;t t +@@ -21944,7 +22090,6 @@ s,@CONFIG_UNINSTALL@,$CONFIG_UNINSTALL,;t t s,@target_subdir@,$target_subdir,;t t s,@frags@,$frags,;t t s,@nm_h@,$nm_h,;t t @@ -7856,7 +7837,7 @@ index 7579c84..aa1dd84 100755 s,@LTLIBOBJS@,$LTLIBOBJS,;t t s,@gl_LIBOBJS@,$gl_LIBOBJS,;t t diff --git a/gdb/configure.ac b/gdb/configure.ac -index 3f81ff2..857a7cd 100644 +index 3f81ff2..ff76053 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1,6 +1,6 @@ @@ -7867,7 +7848,7 @@ index 3f81ff2..857a7cd 100644 dnl Free Software Foundation, Inc. dnl dnl This file is part of GDB. -@@ -118,6 +118,36 @@ case ${debugdir} in +@@ -118,6 +118,51 @@ case ${debugdir} in ;; esac @@ -7900,11 +7881,26 @@ index 3f81ff2..857a7cd 100644 +esac +GDB_DATADIR_PATH=${gdbdatadir} +AC_SUBST(GDB_DATADIR_PATH) ++ ++AC_ARG_WITH([pythondir], ++ [AS_HELP_STRING([--with-pythondir], ++ [install Python data files in this path [DATADIR/gdb/python]])], [pythondir="${withval}"], [pythondir=no]) ++ ++# If the user passed in a path, define it. Otherwise, compute it at ++# runtime based on the possibly-relocatable datadir. ++if test "$pythondir" = "no"; then ++ pythondir='$(GDB_DATADIR_PATH)/python' ++else ++ AC_DEFINE_UNQUOTED(PYTHONDIR, "$pythondir", ++ [Define to install path for Python sources]) ++fi ++AC_SUBST(pythondir) ++ + AC_CONFIG_SUBDIRS(doc testsuite) # Check whether to support alternative target configurations -@@ -430,6 +460,8 @@ AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)]) +@@ -430,6 +475,8 @@ AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)]) # On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c). AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl]) @@ -7913,36 +7909,7 @@ index 3f81ff2..857a7cd 100644 # On alpha-osf, it appears that libtermcap and libcurses are not compatible. # There is a very specific comment in /usr/include/curses.h explaining that # termcap routines built into libcurses must not be used. -@@ -585,6 +617,7 @@ AC_ARG_WITH(python, - AC_MSG_CHECKING([whether to use python]) - AC_MSG_RESULT([$with_python]) - -+GDB_PYTHONDIR_PATH= - if test "${with_python}" = no; then - AC_MSG_WARN([python support disabled; some features may be unavailable.]) - have_libpython=no -@@ -627,7 +660,11 @@ else - AC_DEFINE(HAVE_LIBPYTHON2_4, 1, [Define if Python 2.4 is being used.]) - fi - fi -- if test ${have_libpython} = no; then -+ if test ${have_libpython} != no; then -+ GDB_PYTHONDIR_PATH="`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib();"`" -+ AC_DEFINE_DIR(GDB_PYTHONDIR_PATH, GDB_PYTHONDIR_PATH, -+ [Base directory for GDB Python modules.]) -+ else - case "${with_python}" in - yes) - AC_MSG_ERROR([python is missing or unusable]) -@@ -643,12 +680,16 @@ else - LIBS=$save_LIBS - fi - fi -+AC_SUBST(GDB_PYTHONDIR_PATH) - -+PYTHON_CFLAGS= - if test "${have_libpython}" = yes; then - AC_DEFINE(HAVE_PYTHON, 1, [Define if Python interpreter is being linked in.]) +@@ -649,6 +696,8 @@ if test "${have_libpython}" = yes; then CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)" CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)" CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)" @@ -7951,7 +7918,7 @@ index 3f81ff2..857a7cd 100644 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)" # Flags needed to compile Python code (taken from python-config --cflags). -@@ -776,7 +817,8 @@ AC_FUNC_VFORK +@@ -776,7 +825,8 @@ AC_FUNC_VFORK AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid \ getgid poll pread64 sbrk setpgid setpgrp setsid \ sigaction sigprocmask sigsetmask socketpair syscall \ @@ -7961,7 +7928,7 @@ index 3f81ff2..857a7cd 100644 # Check the return and argument types of ptrace. No canned test for # this, so roll our own. -@@ -1930,17 +1972,10 @@ dnl Check for exe extension set on certain hosts (e.g. Win32) +@@ -1930,17 +1980,10 @@ dnl Check for exe extension set on certain hosts (e.g. Win32) AC_EXEEXT dnl Detect the character set used by this host. @@ -8747,7 +8714,7 @@ index 845b320..ad6e7d7 100644 extern struct cleanup *make_final_cleanup (make_cleanup_ftype *, void *); diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 10e7388..ef41312 100644 +index 10e7388..86941fe 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -955,8 +955,10 @@ Connect to process ID @var{number}, as with the @code{attach} command. @@ -9236,7 +9203,7 @@ index 10e7388..ef41312 100644 @node Exception Handling @subsubsection Exception Handling @cindex python exceptions -@@ -18224,6 +18473,38 @@ message as its value, and the Python call stack backtrace at the +@@ -18224,6 +18473,44 @@ message as its value, and the Python call stack backtrace at the Python statement closest to where the @value{GDBN} error occured as the traceback. @@ -9255,6 +9222,12 @@ index 10e7388..ef41312 100644 +@code{debug-file-directory} is set, then @value{GDBN} will append the +object file's real name to the value of this parameter, and try again. + ++Finally, if this file does not exist, then @value{GDBN} will look in ++subdirectory of @code{gdb_datadir} (whose value is available from ++@code{maint show gdb_datadir}). Specifically, @value{GDBN} will take ++the value of @code{gdb_datadir}, append @samp{python/auto-load}, and ++then append the object file's real name. ++ +Also, if a separate debug file is used, @value{GDBN} will look for the +@samp{-gdb.py} file both in the directory associated with the +application and the directory associated with the separate debug file. @@ -9275,7 +9248,7 @@ index 10e7388..ef41312 100644 @node Values From Inferior @subsubsection Values From Inferior @cindex values from inferior, with Python -@@ -18258,8 +18539,21 @@ bar = some_val['foo'] +@@ -18258,8 +18545,21 @@ bar = some_val['foo'] Again, @code{bar} will also be a @code{gdb.Value} object. @@ -9299,7 +9272,7 @@ index 10e7388..ef41312 100644 @defmethod Value dereference This method returns a new @code{gdb.Value} object whose contents is -@@ -18282,7 +18576,7 @@ The result @code{bar} will be a @code{gdb.Value} object holding the +@@ -18282,7 +18582,7 @@ The result @code{bar} will be a @code{gdb.Value} object holding the value pointed to by @code{foo}. @end defmethod @@ -9308,7 +9281,7 @@ index 10e7388..ef41312 100644 If this @code{gdb.Value} represents a string, then this method converts the contents to a Python string. Otherwise, this method will throw an exception. -@@ -18309,6 +18603,468 @@ The optional @var{errors} argument is the same as the corresponding +@@ -18309,6 +18609,468 @@ The optional @var{errors} argument is the same as the corresponding argument to Python's @code{string.decode} method. @end defmethod @@ -9777,7 +9750,7 @@ index 10e7388..ef41312 100644 @node Commands In Python @subsubsection Commands In Python -@@ -18320,7 +19076,7 @@ You can implement new @value{GDBN} CLI commands in Python. A CLI +@@ -18320,7 +19082,7 @@ You can implement new @value{GDBN} CLI commands in Python. A CLI command is implemented using an instance of the @code{gdb.Command} class, most commonly using a subclass. @@ -9786,7 +9759,7 @@ index 10e7388..ef41312 100644 The object initializer for @code{Command} registers the new command with @value{GDBN}. This initializer is normally invoked from the subclass' own @code{__init__} method. -@@ -18332,11 +19088,11 @@ an exception is raised. +@@ -18332,11 +19094,11 @@ an exception is raised. There is no support for multi-line commands. @@ -9800,7 +9773,7 @@ index 10e7388..ef41312 100644 one of the @samp{COMPLETE_} constants defined below. This argument tells @value{GDBN} how to perform completion for this command. If not given, @value{GDBN} will attempt to complete using the object's -@@ -18563,6 +19319,374 @@ registration of the command with @value{GDBN}. Depending on how the +@@ -18563,6 +19325,374 @@ registration of the command with @value{GDBN}. Depending on how the Python code is read into @value{GDBN}, you may need to import the @code{gdb} module explicitly. @@ -10166,7 +10139,7 @@ index 10e7388..ef41312 100644 +Return the frame's symtab and line object. @c (see @xref{Symtab_and_line,, Symtab and line}). +@end defmethod + -+@defmethod Frame read_var_value @var{variable} ++@defmethod Frame read_var @var{variable} +Return the value of the given variable in this frame. @code{variable} can be +either a string or a @code{gdb.Symbol} object. @c (@pxref{Symbols In Python}). +@end defmethod @@ -10175,7 +10148,7 @@ index 10e7388..ef41312 100644 @node Interpreters @chapter Command Interpreters @cindex command interpreters -@@ -22273,6 +23397,103 @@ Unfreezing a variable does not update it, only subsequent +@@ -22273,6 +23403,103 @@ Unfreezing a variable does not update it, only subsequent (gdb) @end smallexample @@ -10279,7 +10252,7 @@ index 10e7388..ef41312 100644 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Data Manipulation -@@ -23832,6 +25053,10 @@ as possible presense of the @code{frozen} field in the output +@@ -23832,6 +25059,10 @@ as possible presense of the @code{frozen} field in the output of @code{-varobj-create}. @item pending-breakpoints Indicates presence of the @option{-f} option to the @code{-break-insert} command. @@ -10666,7 +10639,7 @@ index 76577f1..bf46761 100644 #endif /* dwarf2loc.h */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 55868da..f9d1c41 100644 +index 55868da..de93d08 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1,8 +1,7 @@ @@ -11579,7 +11552,7 @@ index 55868da..f9d1c41 100644 } +/* read the given die's decl_line number. Return -1 if in case of an error */ -+static const int dwarf2_read_decl_line (struct die_info *die, struct dwarf2_cu *cu){ ++static int dwarf2_read_decl_line (struct die_info *die, struct dwarf2_cu *cu){ + struct attribute *line_attr; + + line_attr = dwarf2_attr (die, DW_AT_decl_line, cu); @@ -11811,7 +11784,7 @@ index 55868da..f9d1c41 100644 + child_die = die->child; + die_children = 0; + while (child_die && child_die->tag) -+ { + { + process_die (child_die, cu); + child_die = sibling_die (child_die); + die_children++; @@ -11819,7 +11792,7 @@ index 55868da..f9d1c41 100644 + + attr = dwarf2_attr (die, DW_AT_abstract_origin, cu); + if (attr) - { ++ { + /* For the list of CHILD_DIEs. */ + unsigned *offsets; + unsigned *offsets_end, *offsetp; @@ -12813,7 +12786,17 @@ index 55868da..f9d1c41 100644 default: /* Not a tag we recognize. Hopefully we aren't processing trash data, but since we must specifically ignore things -@@ -8128,6 +8826,19 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) +@@ -8048,6 +8746,9 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) + break; + } + ++ if (this_type) ++ finalize_type (this_type); ++ + return this_type; + } + +@@ -8128,6 +8829,19 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) members; no typedefs, no member functions, et cetera. So it does not need a prefix. */ return ""; @@ -12833,7 +12816,7 @@ index 55868da..f9d1c41 100644 default: return determine_prefix (parent, cu); } -@@ -8192,23 +8903,62 @@ dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) +@@ -8192,23 +8906,62 @@ dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); if (attr && DW_STRING (attr)) return DW_STRING (attr); @@ -12902,7 +12885,7 @@ index 55868da..f9d1c41 100644 } /* Return the die that this die in an extension of, or NULL if there -@@ -8703,6 +9453,8 @@ dwarf_form_name (unsigned form) +@@ -8703,6 +9456,8 @@ dwarf_form_name (unsigned form) return "DW_FORM_ref_udata"; case DW_FORM_indirect: return "DW_FORM_indirect"; @@ -12911,7 +12894,7 @@ index 55868da..f9d1c41 100644 default: return "DW_FORM_"; } -@@ -9248,6 +10000,7 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) +@@ -9248,6 +10003,7 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) break; case DW_FORM_string: case DW_FORM_strp: @@ -12919,7 +12902,7 @@ index 55868da..f9d1c41 100644 fprintf_unfiltered (f, "string: \"%s\"", DW_STRING (&die->attrs[i]) ? DW_STRING (&die->attrs[i]) : ""); -@@ -9353,26 +10106,35 @@ dwarf2_get_ref_die_offset (struct attribute *attr) +@@ -9353,26 +10109,35 @@ dwarf2_get_ref_die_offset (struct attribute *attr) return result; } @@ -12970,7 +12953,7 @@ index 55868da..f9d1c41 100644 } /* THIS_CU has a reference to PER_CU. If necessary, load the new compilation -@@ -9963,6 +10725,17 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -9963,6 +10728,17 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, { gdb_byte *mac_ptr, *mac_end; struct macro_source_file *current_file = 0; @@ -12988,7 +12971,7 @@ index 55868da..f9d1c41 100644 if (dwarf2_per_objfile->macinfo_buffer == NULL) { -@@ -9970,19 +10743,24 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -9970,19 +10746,24 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, return; } @@ -13017,7 +13000,7 @@ index 55868da..f9d1c41 100644 } macinfo_type = read_1_byte (abfd, mac_ptr); -@@ -9993,7 +10771,81 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -9993,7 +10774,81 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, /* A zero macinfo type indicates the end of the macro information. */ case 0: @@ -13100,7 +13083,7 @@ index 55868da..f9d1c41 100644 case DW_MACINFO_define: case DW_MACINFO_undef: -@@ -10008,19 +10860,31 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -10008,19 +10863,31 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, mac_ptr += bytes_read; if (! current_file) @@ -13143,7 +13126,7 @@ index 55868da..f9d1c41 100644 } break; -@@ -10034,9 +10898,22 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -10034,9 +10901,22 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read); mac_ptr += bytes_read; @@ -13169,7 +13152,7 @@ index 55868da..f9d1c41 100644 } break; -@@ -10090,7 +10967,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -10090,7 +10970,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, } break; } @@ -13178,7 +13161,7 @@ index 55868da..f9d1c41 100644 } /* Check if the attribute's form is a DW_FORM_block* -@@ -10150,6 +11027,34 @@ attr_form_is_constant (struct attribute *attr) +@@ -10150,6 +11030,34 @@ attr_form_is_constant (struct attribute *attr) } } @@ -13213,7 +13196,7 @@ index 55868da..f9d1c41 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) -@@ -10179,35 +11084,24 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, +@@ -10179,35 +11087,24 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_OPS (sym) = &dwarf2_loclist_funcs; SYMBOL_LOCATION_BATON (sym) = baton; } @@ -13263,7 +13246,7 @@ index 55868da..f9d1c41 100644 } } -@@ -10482,6 +11376,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -10482,6 +11379,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -13295,7 +13278,7 @@ index 55868da..f9d1c41 100644 /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. */ -@@ -10490,6 +11409,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -10490,6 +11412,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { struct dwarf2_offset_and_type **slot, ofs; @@ -13337,7 +13320,7 @@ index ff220a2..13158f4 100644 default_symfile_offsets, /* sym_offsets: Translate ext. to int. relocation */ elf_symfile_segments, /* sym_segments: Get segment information from diff --git a/gdb/eval.c b/gdb/eval.c -index 1d35571..b2a1931 100644 +index 1d35571..6a97e09 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -39,10 +39,16 @@ @@ -13690,22 +13673,35 @@ index 1d35571..b2a1931 100644 if (x == NULL) error (_("There is no field named %s"), &exp->elts[pc + 3].string); return x; -@@ -2624,12 +2770,13 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -2613,7 +2759,7 @@ evaluate_subexp_with_coercion (struct expression *exp, + { + enum exp_opcode op; + int pc; +- struct value *val; ++ struct value *val = NULL; + struct symbol *var; + struct type *type; + +@@ -2624,12 +2770,17 @@ evaluate_subexp_with_coercion (struct expression *exp, { case OP_VAR_VALUE: var = exp->elts[pc + 2].symbol; -+ /* address_of_variable will call object_address_set for check_typedef. */ -+ val = address_of_variable (var, exp->elts[pc + 1].block); ++ /* address_of_variable will call object_address_set for check_typedef. ++ Call it only if required as it can error-out on VAR in register. */ ++ if (TYPE_DYNAMIC (SYMBOL_TYPE (var))) ++ val = address_of_variable (var, exp->elts[pc + 1].block); type = check_typedef (SYMBOL_TYPE (var)); if (TYPE_CODE (type) == TYPE_CODE_ARRAY && CAST_IS_CONVERSION) { (*pos) += 4; - val = address_of_variable (var, exp->elts[pc + 1].block); ++ if (!val) ++ val = address_of_variable (var, exp->elts[pc + 1].block); return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), val); } -@@ -2681,9 +2828,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) +@@ -2681,9 +2832,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) case OP_VAR_VALUE: (*pos) += 4; @@ -15686,7 +15682,7 @@ index 3a405a8..a2e2636 100644 once for each known thread. */ typedef int (*thread_callback_func) (struct thread_info *, void *); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index 8102321..b3217fb 100644 +index 8102321..012485c 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -38,6 +38,8 @@ @@ -15902,7 +15898,7 @@ index 8102321..b3217fb 100644 *lowp = TYPE_LOW_BOUND (type); *highp = TYPE_HIGH_BOUND (type); return 1; -@@ -805,30 +850,65 @@ create_array_type (struct type *result_type, +@@ -805,30 +850,56 @@ create_array_type (struct type *result_type, if (result_type == NULL) { @@ -15962,15 +15958,6 @@ index 8102321..b3217fb 100644 + TYPE_LENGTH (result_type) = + TYPE_LENGTH (element_type) * (high_bound - low_bound + 1); + } -+ -+ if (TYPE_DYNAMIC (range_type)) -+ TYPE_DYNAMIC (result_type) = 1; -+ -+ /* Multidimensional dynamic arrays need to have all the outer dimensions -+ dynamic to update the outer TYPE_TARGET_TYPE pointer with the new type -+ with statically evaluated dimensions. */ -+ if (TYPE_DYNAMIC (element_type)) -+ TYPE_DYNAMIC (result_type) = 1; + if (TYPE_LENGTH (result_type) == 0) - TYPE_TARGET_STUB (result_type) = 1; @@ -15982,7 +15969,7 @@ index 8102321..b3217fb 100644 return (result_type); } -@@ -865,7 +945,12 @@ create_set_type (struct type *result_type, struct type *domain_type) +@@ -865,7 +936,12 @@ create_set_type (struct type *result_type, struct type *domain_type) { if (result_type == NULL) { @@ -15996,7 +15983,7 @@ index 8102321..b3217fb 100644 } TYPE_CODE (result_type) = TYPE_CODE_SET; TYPE_NFIELDS (result_type) = 1; -@@ -1368,6 +1453,65 @@ stub_noname_complaint (void) +@@ -1368,6 +1444,84 @@ stub_noname_complaint (void) complaint (&symfile_complaints, _("stub type has NULL name")); } @@ -16058,11 +16045,30 @@ index 8102321..b3217fb 100644 + element_size = type_length_get (target_type, NULL, 1); + return (count - 1) * byte_stride + element_size; +} ++ ++/* Prepare TYPE after being read in by the backend. Currently this function ++ only propagates the TYPE_DYNAMIC flag. */ ++ ++void ++finalize_type (struct type *type) ++{ ++ int i; ++ ++ for (i = 0; i < TYPE_NFIELDS (type); ++i) ++ if (TYPE_FIELD_TYPE (type, i) && TYPE_DYNAMIC (TYPE_FIELD_TYPE (type, i))) ++ break; ++ ++ /* FIXME: cplus_stuff is ignored here. */ ++ if (i < TYPE_NFIELDS (type) ++ || (TYPE_VPTR_BASETYPE (type) && TYPE_DYNAMIC (TYPE_VPTR_BASETYPE (type))) ++ || (TYPE_TARGET_TYPE (type) && TYPE_DYNAMIC (TYPE_TARGET_TYPE (type)))) ++ TYPE_DYNAMIC (type) = 1; ++} + /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989. If this is a stubbed struct (i.e. declared as struct foo *), see if -@@ -1384,7 +1528,8 @@ stub_noname_complaint (void) +@@ -1384,7 +1538,8 @@ stub_noname_complaint (void) /* Find the real type of TYPE. This function returns the real type, after removing all layers of typedefs and completing opaque or stub types. Completion changes the TYPE argument, but stripping of @@ -16072,7 +16078,7 @@ index 8102321..b3217fb 100644 struct type * check_typedef (struct type *type) -@@ -1420,7 +1565,7 @@ check_typedef (struct type *type) +@@ -1420,7 +1575,7 @@ check_typedef (struct type *type) if (sym) TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym); else /* TYPE_CODE_UNDEF */ @@ -16081,7 +16087,7 @@ index 8102321..b3217fb 100644 } type = TYPE_TARGET_TYPE (type); } -@@ -1494,34 +1639,37 @@ check_typedef (struct type *type) +@@ -1494,34 +1649,37 @@ check_typedef (struct type *type) } } @@ -16137,7 +16143,7 @@ index 8102321..b3217fb 100644 TYPE_TARGET_STUB (type) = 0; } else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -@@ -1529,9 +1677,12 @@ check_typedef (struct type *type) +@@ -1529,9 +1687,12 @@ check_typedef (struct type *type) TYPE_LENGTH (type) = TYPE_LENGTH (target_type); TYPE_TARGET_STUB (type) = 0; } @@ -16150,7 +16156,7 @@ index 8102321..b3217fb 100644 return type; } -@@ -1753,7 +1904,7 @@ init_type (enum type_code code, int length, int flags, +@@ -1753,7 +1914,7 @@ init_type (enum type_code code, int length, int flags, { struct type *type; @@ -16159,7 +16165,7 @@ index 8102321..b3217fb 100644 TYPE_CODE (type) = code; TYPE_LENGTH (type) = length; -@@ -1783,15 +1934,24 @@ init_type (enum type_code code, int length, int flags, +@@ -1783,15 +1944,24 @@ init_type (enum type_code code, int length, int flags, if (flags & TYPE_FLAG_FIXED_INSTANCE) TYPE_FIXED_INSTANCE (type) = 1; @@ -16193,7 +16199,7 @@ index 8102321..b3217fb 100644 /* C++ fancies. */ -@@ -1803,6 +1963,10 @@ init_type (enum type_code code, int length, int flags, +@@ -1803,6 +1973,10 @@ init_type (enum type_code code, int length, int flags, { INIT_CPLUS_SPECIFIC (type); } @@ -16204,7 +16210,7 @@ index 8102321..b3217fb 100644 return (type); } -@@ -2916,33 +3080,47 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) +@@ -2916,33 +3090,47 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) } /* Allocate the hash table used by copy_type_recursive to walk @@ -16267,7 +16273,7 @@ index 8102321..b3217fb 100644 return type; /* This type shouldn't be pointing to any types in other objfiles; -@@ -2954,11 +3132,15 @@ copy_type_recursive (struct objfile *objfile, +@@ -2954,11 +3142,15 @@ copy_type_recursive (struct objfile *objfile, if (*slot != NULL) return ((struct type_pair *) *slot)->new; @@ -16286,7 +16292,7 @@ index 8102321..b3217fb 100644 stored->old = type; stored->new = new_type; *slot = stored; -@@ -2968,6 +3150,13 @@ copy_type_recursive (struct objfile *objfile, +@@ -2968,6 +3160,13 @@ copy_type_recursive (struct objfile *objfile, *TYPE_MAIN_TYPE (new_type) = *TYPE_MAIN_TYPE (type); TYPE_OBJFILE (new_type) = NULL; @@ -16300,7 +16306,7 @@ index 8102321..b3217fb 100644 if (TYPE_NAME (type)) TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type)); if (TYPE_TAG_NAME (type)) -@@ -2976,12 +3165,45 @@ copy_type_recursive (struct objfile *objfile, +@@ -2976,12 +3175,45 @@ copy_type_recursive (struct objfile *objfile, TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); TYPE_LENGTH (new_type) = TYPE_LENGTH (type); @@ -16346,7 +16352,7 @@ index 8102321..b3217fb 100644 TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field); for (i = 0; i < nfields; i++) { -@@ -2990,8 +3212,8 @@ copy_type_recursive (struct objfile *objfile, +@@ -2990,8 +3222,8 @@ copy_type_recursive (struct objfile *objfile, TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i); if (TYPE_FIELD_TYPE (type, i)) TYPE_FIELD_TYPE (new_type, i) @@ -16357,7 +16363,7 @@ index 8102321..b3217fb 100644 if (TYPE_FIELD_NAME (type, i)) TYPE_FIELD_NAME (new_type, i) = xstrdup (TYPE_FIELD_NAME (type, i)); -@@ -3010,6 +3232,16 @@ copy_type_recursive (struct objfile *objfile, +@@ -3010,6 +3242,16 @@ copy_type_recursive (struct objfile *objfile, xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type, i))); break; @@ -16374,7 +16380,7 @@ index 8102321..b3217fb 100644 default: internal_error (__FILE__, __LINE__, _("Unexpected type field location kind: %d"), -@@ -3018,17 +3250,32 @@ copy_type_recursive (struct objfile *objfile, +@@ -3018,17 +3260,32 @@ copy_type_recursive (struct objfile *objfile, } } @@ -16413,7 +16419,7 @@ index 8102321..b3217fb 100644 /* Maybe copy the type_specific bits. NOTE drow/2005-12-09: We do not copy the C++-specific bits like -@@ -3046,6 +3293,20 @@ copy_type_recursive (struct objfile *objfile, +@@ -3046,6 +3303,20 @@ copy_type_recursive (struct objfile *objfile, return new_type; } @@ -16434,7 +16440,7 @@ index 8102321..b3217fb 100644 /* Make a copy of the given TYPE, except that the pointer & reference types are not preserved. -@@ -3059,7 +3320,7 @@ copy_type (const struct type *type) +@@ -3059,7 +3330,7 @@ copy_type (const struct type *type) gdb_assert (TYPE_OBJFILE (type) != NULL); @@ -16443,7 +16449,7 @@ index 8102321..b3217fb 100644 TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); TYPE_LENGTH (new_type) = TYPE_LENGTH (type); memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type), -@@ -3068,6 +3329,232 @@ copy_type (const struct type *type) +@@ -3068,6 +3339,232 @@ copy_type (const struct type *type) return new_type; } @@ -16676,7 +16682,7 @@ index 8102321..b3217fb 100644 static struct type * build_flt (int bit, char *name, const struct floatformat **floatformats) { -@@ -3105,7 +3592,7 @@ build_complex (int bit, char *name, struct type *target_type) +@@ -3105,7 +3602,7 @@ build_complex (int bit, char *name, struct type *target_type) return builtin_type_error; } t = init_type (TYPE_CODE_COMPLEX, 2 * bit / TARGET_CHAR_BIT, @@ -16685,7 +16691,7 @@ index 8102321..b3217fb 100644 TYPE_TARGET_TYPE (t) = target_type; return t; } -@@ -3119,56 +3606,56 @@ gdbtypes_post_init (struct gdbarch *gdbarch) +@@ -3119,56 +3616,56 @@ gdbtypes_post_init (struct gdbarch *gdbarch) builtin_type->builtin_void = init_type (TYPE_CODE_VOID, 1, 0, @@ -16754,7 +16760,7 @@ index 8102321..b3217fb 100644 builtin_type->builtin_float = build_flt (gdbarch_float_bit (gdbarch), "float", gdbarch_float_format (gdbarch)); -@@ -3187,26 +3674,26 @@ gdbtypes_post_init (struct gdbarch *gdbarch) +@@ -3187,26 +3684,26 @@ gdbtypes_post_init (struct gdbarch *gdbarch) builtin_type->builtin_string = init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, @@ -16786,7 +16792,7 @@ index 8102321..b3217fb 100644 /* Pointer/Address types. */ -@@ -3245,27 +3732,28 @@ gdbtypes_post_init (struct gdbarch *gdbarch) +@@ -3245,27 +3742,28 @@ gdbtypes_post_init (struct gdbarch *gdbarch) init_type (TYPE_CODE_INT, gdbarch_addr_bit (gdbarch) / 8, TYPE_FLAG_UNSIGNED, @@ -16820,7 +16826,7 @@ index 8102321..b3217fb 100644 return builtin_type; } -@@ -3276,6 +3764,9 @@ _initialize_gdbtypes (void) +@@ -3276,6 +3774,9 @@ _initialize_gdbtypes (void) { gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); @@ -16830,7 +16836,7 @@ index 8102321..b3217fb 100644 /* FIXME: The following types are architecture-neutral. However, they contain pointer_type and reference_type fields potentially caching pointer or reference types that *are* architecture -@@ -3284,47 +3775,47 @@ _initialize_gdbtypes (void) +@@ -3284,47 +3785,47 @@ _initialize_gdbtypes (void) builtin_type_int0 = init_type (TYPE_CODE_INT, 0 / 8, 0, @@ -16889,7 +16895,7 @@ index 8102321..b3217fb 100644 builtin_type_ieee_single = build_flt (-1, "builtin_type_ieee_single", floatformats_ieee_single); -@@ -3344,15 +3835,15 @@ _initialize_gdbtypes (void) +@@ -3344,15 +3845,15 @@ _initialize_gdbtypes (void) builtin_type_void = init_type (TYPE_CODE_VOID, 1, 0, @@ -16909,7 +16915,7 @@ index 8102321..b3217fb 100644 add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, _("\ Set debugging of C++ overloading."), _("\ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h -index c90b6d7..dccc06f 100644 +index c90b6d7..077b89c 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -134,7 +134,10 @@ enum type_code @@ -17120,7 +17126,7 @@ index c90b6d7..dccc06f 100644 extern struct type *init_type (enum type_code, int, int, char *, struct objfile *); -@@ -1172,6 +1260,16 @@ extern struct type *create_range_type (struct type *, struct type *, int, +@@ -1172,6 +1260,18 @@ extern struct type *create_range_type (struct type *, struct type *, int, extern struct type *create_array_type (struct type *, struct type *, struct type *); @@ -17133,11 +17139,13 @@ index c90b6d7..dccc06f 100644 + +extern CORE_ADDR type_range_byte_stride_internal (struct type *range_type, + struct type *element_type); ++ ++extern void finalize_type (struct type *type); + extern struct type *create_string_type (struct type *, struct type *); extern struct type *create_set_type (struct type *, struct type *); -@@ -1263,10 +1361,15 @@ extern void maintenance_print_type (char *, int); +@@ -1263,10 +1363,15 @@ extern void maintenance_print_type (char *, int); extern htab_t create_copied_types_hash (struct objfile *objfile); @@ -20127,7 +20135,7 @@ index 0000000..96b6618 +AliasCommand() diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py new file mode 100644 -index 0000000..008e5dd +index 0000000..f07696e --- /dev/null +++ b/gdb/python/lib/gdb/command/backtrace.py @@ -0,0 +1,197 @@ @@ -20166,7 +20174,7 @@ index 0000000..008e5dd + + stream.write (sym.print_name + "=") + try: -+ val = self.frame.read_var_value (sym) ++ val = self.frame.read_var (sym) + if val != None: + val = str (val) + # FIXME: would be nice to have a more precise exception here. @@ -20460,13 +20468,13 @@ index 0000000..569b816 +Pahole() diff --git a/gdb/python/lib/gdb/command/require.py b/gdb/python/lib/gdb/command/require.py new file mode 100644 -index 0000000..f75faad +index 0000000..1fbc1e8 --- /dev/null +++ b/gdb/python/lib/gdb/command/require.py @@ -0,0 +1,57 @@ +# Demand-loading commands. + -+# Copyright (C) 2008 Free Software Foundation, Inc. ++# Copyright (C) 2008, 2009 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 @@ -20507,7 +20515,7 @@ index 0000000..f75faad + exec ('import gdb.' + self.name + '.' + cmd, globals ()) + + def complete (self, text, word): -+ dir = gdb.pythonlibdir + '/gdb/' + self.name ++ dir = gdb.pythondir + '/gdb/' + self.name + result = [] + for file in os.listdir(dir): + if not file.startswith (word) or not file.endswith ('.py'): @@ -22439,10 +22447,10 @@ index 36cde34..e6e3ac0 100644 diff --git a/gdb/python/python-frame.c b/gdb/python/python-frame.c new file mode 100644 -index 0000000..7305199 +index 0000000..c257ac3 --- /dev/null +++ b/gdb/python/python-frame.c -@@ -0,0 +1,668 @@ +@@ -0,0 +1,686 @@ +/* Python interface to stack frames + + Copyright (C) 2008, 2009 Free Software Foundation, Inc. @@ -22836,13 +22844,13 @@ index 0000000..7305199 + return sal_obj; +} + -+/* Implementation of gdb.Frame.read_var_value (self, variable) -> gdb.Value. ++/* Implementation of gdb.Frame.read_var (self, variable) -> gdb.Value. + Returns the value of the given variable in this frame. The argument can be + either a gdb.Symbol or a string. Returns None if GDB can't find the + specified variable. */ + +static PyObject * -+frapy_read_var_value (PyObject *self, PyObject *args) ++frapy_read_var (PyObject *self, PyObject *args) +{ + struct frame_info *frame; + PyObject *sym_obj; @@ -22863,6 +22871,8 @@ index 0000000..7305199 + volatile struct gdb_exception except; + + var_name = python_string_to_target_string (sym_obj); ++ if (!var_name) ++ return NULL; + cleanup = make_cleanup (xfree, var_name); + + TRY_CATCH (except, RETURN_MASK_ALL) @@ -23057,26 +23067,42 @@ index 0000000..7305199 + + +static PyMethodDef frame_object_methods[] = { -+ { "equals", frapy_equal_p, METH_VARARGS, "Compare frames." }, ++ { "equals", frapy_equal_p, METH_VARARGS, ++ "equals (frame) -> Boolean.\n\ ++Compare this frame to the given frame." }, + { "is_valid", frapy_is_valid, METH_NOARGS, -+ "Return true if this frame is valid, false if not." }, ++ "is_valid () -> Boolean.\n\ ++Return true if this frame is valid, false if not." }, + { "name", frapy_name, METH_NOARGS, -+ "Return the function name of the frame." }, -+ { "type", frapy_type, METH_NOARGS, "Return the type of the frame." }, ++ "name () -> String.\n\ ++Return the function name of the frame, or None if it can't be determined." }, ++ { "type", frapy_type, METH_NOARGS, ++ "type () -> Integer.\n\ ++Return the type of the frame." }, + { "unwind_stop_reason", frapy_unwind_stop_reason, METH_NOARGS, -+ "Return the reason why it's not possible to find frames older than this." }, -+ { "pc", frapy_pc, METH_NOARGS, "Return the frame's resume address." }, -+ { "block", frapy_block, METH_NOARGS, "Return the frame's code block." }, ++ "unwind_stop_reason () -> Integer.\n\ ++Return the reason why it's not possible to find frames older than this." }, ++ { "pc", frapy_pc, METH_NOARGS, ++ "pc () -> Long.\n\ ++Return the frame's resume address." }, ++ { "block", frapy_block, METH_NOARGS, ++ "block () -> gdb.Block.\n\ ++Return the frame's code block." }, + { "addr_in_block", frapy_addr_in_block, METH_NOARGS, -+ "Return an address which falls within the frame's code block." }, ++ "addr_in_block () -> Long.\n\ ++Return an address which falls within the frame's code block." }, + { "older", frapy_older, METH_NOARGS, -+ "Return the frame immediately older (outer) to this frame." }, ++ "older () -> gdb.Frame.\n\ ++Return the frame immediately older (outer) to this frame." }, + { "newer", frapy_newer, METH_NOARGS, -+ "Return the frame immetidaely newer (inner) to this frame." }, ++ "newer () -> gdb.Frame.\n\ ++Return the frame immetidaely newer (inner) to this frame." }, + { "find_sal", frapy_find_sal, METH_NOARGS, -+ "Return the frame's symtab and line." }, -+ { "read_var_value", frapy_read_var_value, METH_VARARGS, -+ "Return the value of the variable in this frame." }, ++ "find_sal () -> gdb.Symtab_and_line.\n\ ++Return the frame's symtab and line." }, ++ { "read_var", frapy_read_var, METH_VARARGS, ++ "read_var (variable) -> gdb.Value.\n\ ++Return the value of the variable in this frame." }, + {NULL} /* Sentinel */ +}; + @@ -23113,13 +23139,13 @@ index 0000000..7305199 +}; diff --git a/gdb/python/python-function.c b/gdb/python/python-function.c new file mode 100644 -index 0000000..5e346d6 +index 0000000..4a85a33 --- /dev/null +++ b/gdb/python/python-function.c -@@ -0,0 +1,184 @@ +@@ -0,0 +1,180 @@ +/* Convenience functions implemented in Python. + -+ Copyright (C) 2008 Free Software Foundation, Inc. ++ Copyright (C) 2008, 2009 Free Software Foundation, Inc. + + This file is part of GDB. + @@ -23212,23 +23238,10 @@ index 0000000..5e346d6 + + Py_DECREF (result); + do_cleanups (cleanup); -+ ++ + return value; +} + -+/* Called when destroying a struct internal_function. */ -+ -+static void -+fnpy_destroy (void *cookie) -+{ -+ PyGILState_STATE state; -+ -+ state = PyGILState_Ensure (); -+ Py_DECREF ((PyObject *) cookie); -+ PyGILState_Release (state); -+ -+} -+ +/* Initializer for a Function object. It takes one argument, the name + of the function. */ + @@ -23250,7 +23263,7 @@ index 0000000..5e346d6 + if (! docstring) + docstring = _("This function is not documented."); + -+ add_internal_function (name, docstring, fnpy_call, self, fnpy_destroy); ++ add_internal_function (name, docstring, fnpy_call, self); + return 0; +} + @@ -23259,10 +23272,9 @@ index 0000000..5e346d6 +void +gdbpy_initialize_functions (void) +{ -+ fnpy_object_type.tp_new = PyType_GenericNew; -+ fnpy_object_type.tp_init = fnpy_init; + if (PyType_Ready (&fnpy_object_type) < 0) + return; ++ + Py_INCREF (&fnpy_object_type); + PyModule_AddObject (gdb_module, "Function", (PyObject *) &fnpy_object_type); +} @@ -23299,7 +23311,17 @@ index 0000000..5e346d6 + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ -+ 0 /* tp_methods */ ++ 0, /* tp_methods */ ++ 0, /* tp_members */ ++ 0, /* tp_getset */ ++ 0, /* tp_base */ ++ 0, /* tp_dict */ ++ 0, /* tp_descr_get */ ++ 0, /* tp_descr_set */ ++ 0, /* tp_dictoffset */ ++ fnpy_init, /* tp_init */ ++ 0, /* tp_alloc */ ++ PyType_GenericNew /* tp_new */ +}; diff --git a/gdb/python/python-hooks.c b/gdb/python/python-hooks.c new file mode 100644 @@ -23495,10 +23517,10 @@ index 02dbfc4..4aae0aa 100644 #endif /* GDB_PYTHON_INTERNAL_H */ diff --git a/gdb/python/python-membuf.c b/gdb/python/python-membuf.c new file mode 100644 -index 0000000..57836f9 +index 0000000..a4c7d74 --- /dev/null +++ b/gdb/python/python-membuf.c -@@ -0,0 +1,227 @@ +@@ -0,0 +1,243 @@ +/* Python interface to the inferior memory. + + Copyright (C) 2008, 2009 Free Software Foundation, Inc. @@ -23626,12 +23648,12 @@ index 0000000..57836f9 +{ + membuf_object *membuf_obj = (membuf_object *) self; + -+ return PyString_FromFormat ("memory buffer for address %p, %u bytes long", -+ (void *) (uintptr_t) membuf_obj->addr, -+ (unsigned int) membuf_obj->length); ++ return PyString_FromFormat ("memory buffer for address %s, %s bytes long", ++ paddress (membuf_obj->addr), ++ pulongest (membuf_obj->length)); +} + -+Py_ssize_t ++static Py_ssize_t +get_read_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr) +{ + membuf_object *membuf_obj = (membuf_object *) self; @@ -23648,13 +23670,13 @@ index 0000000..57836f9 + return membuf_obj->length; +} + -+Py_ssize_t ++static Py_ssize_t +get_write_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr) +{ + return get_read_buffer (self, segment, ptrptr); +} + -+Py_ssize_t ++static Py_ssize_t +get_seg_count (PyObject *self, Py_ssize_t *lenp) +{ + if (lenp) @@ -23663,7 +23685,7 @@ index 0000000..57836f9 + return 1; +} + -+Py_ssize_t ++static Py_ssize_t +get_char_buffer (PyObject *self, Py_ssize_t segment, char **ptrptr) +{ + void *ptr = NULL; @@ -23713,13 +23735,29 @@ index 0000000..57836f9 + 0, /*tp_setattro*/ + &buffer_procs, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ -+ "GDB memory buffer object" /*tp_doc*/ ++ "GDB memory buffer object", /*tp_doc*/ ++ 0, /* tp_traverse */ ++ 0, /* tp_clear */ ++ 0, /* tp_richcompare */ ++ 0, /* tp_weaklistoffset */ ++ 0, /* tp_iter */ ++ 0, /* tp_iternext */ ++ 0, /* tp_methods */ ++ 0, /* tp_members */ ++ 0, /* tp_getset */ ++ 0, /* tp_base */ ++ 0, /* tp_dict */ ++ 0, /* tp_descr_get */ ++ 0, /* tp_descr_set */ ++ 0, /* tp_dictoffset */ ++ 0, /* tp_init */ ++ 0, /* tp_alloc */ ++ PyType_GenericNew /* tp_new */ +}; + +void +gdbpy_initialize_membuf (void) +{ -+ membuf_object_type.tp_new = PyType_GenericNew; + if (PyType_Ready (&membuf_object_type) < 0) + return; + @@ -26125,7 +26163,7 @@ index ddac2f5..f9c9486 100644 + return 1; +} diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c -index bc077b6..de54b9d 100644 +index bc077b6..2507fcd 100644 --- a/gdb/python/python-value.c +++ b/gdb/python/python-value.c @@ -52,6 +52,10 @@ struct value *values_in_python = NULL; @@ -26209,6 +26247,29 @@ index bc077b6..de54b9d 100644 static Py_ssize_t valpy_length (PyObject *self) { +@@ -306,11 +349,11 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other) + a gdb.Value object and need to convert it from python as well. */ + arg1 = convert_value_from_python (self); + if (arg1 == NULL) +- return NULL; ++ break; + + arg2 = convert_value_from_python (other); + if (arg2 == NULL) +- return NULL; ++ break; + + switch (opcode) + { +@@ -387,7 +430,7 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other) + } + GDB_PY_HANDLE_EXCEPTION (except); + +- return value_to_value_object (res_val); ++ return res_val ? value_to_value_object (res_val) : NULL; + } + + static PyObject * @@ -718,6 +761,17 @@ value_to_value_object (struct value *val) return (PyObject *) val_obj; } @@ -26307,7 +26368,7 @@ index bc077b6..de54b9d 100644 }; diff --git a/gdb/python/python.c b/gdb/python/python.c -index b3a27d6..18578f0 100644 +index b3a27d6..2b06748 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -22,6 +22,12 @@ @@ -27034,7 +27095,7 @@ index b3a27d6..18578f0 100644 /* Printing. */ -@@ -302,6 +888,754 @@ gdbpy_print_stack (void) +@@ -302,6 +888,769 @@ gdbpy_print_stack (void) PyErr_Clear (); } @@ -27117,10 +27178,11 @@ index b3a27d6..18578f0 100644 +gdbpy_new_objfile (struct objfile *objfile) +{ + char *realname; -+ char *filename; ++ char *filename, *debugfile; + int len; + FILE *input; + PyGILState_STATE state; ++ struct cleanup *cleanups; + + if (!gdbpy_auto_load || !objfile || !objfile->name) + return; @@ -27136,35 +27198,49 @@ index b3a27d6..18578f0 100644 + strcpy (filename + len, GDBPY_AUTO_FILENAME); + + input = fopen (filename, "r"); ++ debugfile = filename; ++ ++ cleanups = make_cleanup (xfree, filename); ++ make_cleanup (xfree, realname); + + if (!input && debug_file_directory) + { + /* Also try the same file in the separate debug info directory. */ -+ char *debugfile; -+ + debugfile = xmalloc (strlen (filename) + + strlen (debug_file_directory) + 1); + strcpy (debugfile, debug_file_directory); + /* FILENAME is absolute, so we don't need a "/" here. */ + strcat (debugfile, filename); + -+ xfree (filename); -+ filename = debugfile; ++ make_cleanup (xfree, debugfile); ++ input = fopen (debugfile, "r"); ++ } + -+ input = fopen (filename, "r"); ++ if (!input && gdb_datadir) ++ { ++ /* Also try the same file in a subdirectory of gdb's data ++ directory. */ ++ debugfile = xmalloc (strlen (gdb_datadir) + strlen (filename) ++ + strlen ("/auto-load") + 1); ++ strcpy (debugfile, gdb_datadir); ++ strcat (debugfile, "/auto-load"); ++ /* FILENAME is absolute, so we don't need a "/" here. */ ++ strcat (debugfile, filename); ++ ++ make_cleanup (xfree, debugfile); ++ input = fopen (debugfile, "r"); + } + + if (input) + { + /* We don't want to throw an exception here -- but the user + would like to know that something went wrong. */ -+ if (PyRun_SimpleFile (input, filename)) ++ if (PyRun_SimpleFile (input, debugfile)) + gdbpy_print_stack (); + fclose (input); + } + -+ xfree (realname); -+ xfree (filename); ++ do_cleanups (cleanups); + gdbpy_current_objfile = NULL; + + PyGILState_Release (state); @@ -27789,7 +27865,7 @@ index b3a27d6..18578f0 100644 #else /* HAVE_PYTHON */ /* Dummy implementation of the gdb "python" command. */ -@@ -328,6 +1662,24 @@ eval_python_from_control_command (struct command_line *cmd) +@@ -328,6 +1677,24 @@ eval_python_from_control_command (struct command_line *cmd) error (_("Python scripting is not supported in this copy of GDB.")); } @@ -27814,7 +27890,7 @@ index b3a27d6..18578f0 100644 #endif /* HAVE_PYTHON */ -@@ -355,9 +1707,6 @@ show_python (char *args, int from_tty) +@@ -355,9 +1722,6 @@ show_python (char *args, int from_tty) /* Initialize the Python code. */ @@ -27824,7 +27900,7 @@ index b3a27d6..18578f0 100644 void _initialize_python (void) { -@@ -400,6 +1749,15 @@ Enables or disables printing of Python stack traces."), +@@ -400,6 +1764,15 @@ Enables or disables printing of Python stack traces."), &set_python_list, &show_python_list); @@ -27840,8 +27916,16 @@ index b3a27d6..18578f0 100644 #ifdef HAVE_PYTHON Py_Initialize (); PyEval_InitThreads (); -@@ -412,9 +1770,28 @@ Enables or disables printing of Python stack traces."), +@@ -410,11 +1783,36 @@ Enables or disables printing of Python stack traces."), + PyModule_AddStringConstant (gdb_module, "VERSION", (char*) version); + PyModule_AddStringConstant (gdb_module, "HOST_CONFIG", (char*) host_name); PyModule_AddStringConstant (gdb_module, "TARGET_CONFIG", (char*) target_name); ++#ifdef PYTHONDIR ++ PyModule_AddStringConstant (gdb_module, "pythondir", PYTHONDIR); ++#else ++ if (gdb_datadir) ++ PyModule_AddStringConstant (gdb_module, "datadir", gdb_datadir); ++#endif gdbpy_initialize_values (); + gdbpy_initialize_breakpoints (); @@ -27869,21 +27953,23 @@ index b3a27d6..18578f0 100644 gdbpy_doc_cst = PyString_FromString ("__doc__"); -@@ -442,6 +1819,13 @@ class GdbOutputFile:\n\ +@@ -442,6 +1840,15 @@ class GdbOutputFile:\n\ \n\ sys.stderr = GdbOutputFile()\n\ sys.stdout = GdbOutputFile()\n\ -+# FIXME: gdb.pythonlibdir is deprecated as it is just the standard libdir.\n\ -+gdb.pythonlibdir = '" GDB_PYTHONDIR_PATH "'\n\ -+gdb.__path__ = [gdb.pythonlibdir + '/gdb']\n\ -+from os.path import exists\n\ -+ipy = gdb.pythonlibdir + '/gdb/__init__.py'\n\ -+if exists (ipy):\n\ -+ execfile (ipy)\n\ ++if hasattr (gdb, 'datadir'):\n\ ++ gdb.pythondir = gdb.datadir + '/python'\n\ ++if hasattr (gdb, 'pythondir'):\n\ ++ sys.path.insert(0, gdb.pythondir)\n\ ++ gdb.__path__ = [gdb.pythondir + '/gdb']\n\ ++ from os.path import exists\n\ ++ ipy = gdb.pythondir + '/gdb/__init__.py'\n\ ++ if exists (ipy):\n\ ++ execfile (ipy)\n\ "); /* Release the GIL while gdb runs. */ -@@ -461,9 +1845,74 @@ static PyMethodDef GdbMethods[] = +@@ -461,9 +1868,79 @@ static PyMethodDef GdbMethods[] = "Get a value from history" }, { "execute", execute_gdb_command, METH_VARARGS, "Execute a gdb command" }, @@ -27905,13 +27991,17 @@ index b3a27d6..18578f0 100644 + "Return a sequence of all loaded objfiles." }, + + { "frames", gdbpy_frames, METH_NOARGS, -+ "Return a tuple of all frame objects." }, ++ "frames () -> (gdb.Frame, ...).\n\ ++Return a tuple of all frame objects." }, + { "newest_frame", gdbpy_newest_frame, METH_NOARGS, -+ "Return the newest frame object." }, ++ "newest_frame () -> gdb.Frame.\n\ ++Return the newest frame object." }, + { "selected_frame", gdbpy_selected_frame, METH_NOARGS, -+ "Return the selected frame object." }, -+ { "frame_stop_reason_string", gdbpy_frame_stop_reason_string, -+ METH_VARARGS, "Return a string explaining unwind stop reason." }, ++ "selected_frame () -> gdb.Frame.\n\ ++Return the selected frame object." }, ++ { "frame_stop_reason_string", gdbpy_frame_stop_reason_string, METH_VARARGS, ++ "stop_reason_string (Integer) -> String.\n\ ++Return a string explaining unwind stop reason." }, + + { "lookup_symbol", (PyCFunction) gdbpy_lookup_symbol, + METH_VARARGS | METH_KEYWORDS, @@ -27920,7 +28010,8 @@ index b3a27d6..18578f0 100644 +a boolean indicating if name is a field of the current implied argument\n\ +`this' (when the current language is object-oriented)." }, + { "solib_address", gdbpy_solib_address, METH_VARARGS, -+ "Return shared library holding a given address, or None." }, ++ "solib_address (Long) -> String.\n\ ++Return the name of the shared library holding a given address, or None." }, + + { "find_pc_function", gdbpy_find_pc_function, METH_VARARGS, + "Return the function containing the given pc value, or None." }, @@ -27978,98 +28069,6 @@ index e63c447..767af86 100644 + const struct language_defn *language); + #endif /* GDB_PYTHON_H */ -diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c -index 926d0b6..1c59a42 100644 ---- a/gdb/rs6000-tdep.c -+++ b/gdb/rs6000-tdep.c -@@ -117,6 +117,9 @@ static const char *powerpc_vector_strings[] = - NULL - }; - -+/* The configurable `disassemble_info.disassembler_options' string. */ -+static char *disassembler_options; -+ - /* A variable that can be configured by the user. */ - static enum powerpc_vector_abi powerpc_vector_abi_global = POWERPC_VEC_AUTO; - static const char *powerpc_vector_abi_string = "auto"; -@@ -2993,15 +2996,17 @@ find_variant_by_arch (enum bfd_architecture arch, unsigned long mach) - } - - static int --gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info) -+gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info_pointer) - { -- if (!info->disassembler_options) -- info->disassembler_options = "any"; -+ disassemble_info info = *info_pointer; - -- if (info->endian == BFD_ENDIAN_BIG) -- return print_insn_big_powerpc (memaddr, info); -+ if (disassembler_options && disassembler_options[0]) -+ info.disassembler_options = disassembler_options; -+ -+ if (info.endian == BFD_ENDIAN_BIG) -+ return print_insn_big_powerpc (memaddr, &info); - else -- return print_insn_little_powerpc (memaddr, info); -+ return print_insn_little_powerpc (memaddr, &info); - } - - static CORE_ADDR -@@ -3326,7 +3331,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - enum bfd_architecture arch; - unsigned long mach; - bfd abfd; -- asection *sect; - enum auto_boolean soft_float_flag = powerpc_soft_float_global; - int soft_float; - enum powerpc_vector_abi vector_abi = powerpc_vector_abi_global; -@@ -3375,26 +3379,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - arch = info.bfd_arch_info->arch; - mach = info.bfd_arch_info->mach; - -- /* For e500 executables, the apuinfo section is of help here. Such -- section contains the identifier and revision number of each -- Application-specific Processing Unit that is present on the -- chip. The content of the section is determined by the assembler -- which looks at each instruction and determines which unit (and -- which version of it) can execute it. In our case we just look for -- the existance of the section. */ -- -- if (info.abfd) -- { -- sect = bfd_get_section_by_name (info.abfd, ".PPC.EMB.apuinfo"); -- if (sect) -- { -- arch = info.bfd_arch_info->arch; -- mach = bfd_mach_ppc_e500; -- bfd_default_set_arch_mach (&abfd, arch, mach); -- info.bfd_arch_info = bfd_get_arch_info (&abfd); -- } -- } -- - /* Find a default target description which describes our register - layout, if we do not already have one. */ - if (! tdesc_has_registers (tdesc)) -@@ -4058,4 +4042,18 @@ _initialize_rs6000_tdep (void) - _("Show the vector ABI."), - NULL, powerpc_set_vector_abi, NULL, - &setpowerpccmdlist, &showpowerpccmdlist); -+ -+ /* Arches list is taken from opcodes/ppc-dis.c powerpc_init_dialect. */ -+ disassembler_options = xstrdup ("any"); -+ add_setshow_string_cmd ("disassembler-options", class_support, -+ &disassembler_options, _("\ -+Pass the text on to disassembler."), _("\ -+Show the text passed on to disassembler."), _("\ -+This is the objdump option -M to specify the PowerPC model. The possible\n\ -+(sub)strings are: ppcps, booke, e500mc, e500, efs, e300, 440, 464, power4,\n\ -+power5, cell, power6, power7, vsx, any, 32 and 64. Unlike objdump GDB uses\n\ -+the default value `any'."), -+ NULL, -+ NULL, -+ &setpowerpccmdlist, &showpowerpccmdlist); - } diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 345befd..e2568c8 100644 --- a/gdb/scm-lang.c @@ -30038,10 +30037,10 @@ index 3d8fae4..5fb9067 100644 # This program is free software; you can redistribute it and/or modify diff --git a/gdb/testsuite/gdb.arch/powerpc-power7.exp b/gdb/testsuite/gdb.arch/powerpc-power7.exp new file mode 100644 -index 0000000..e1fc23f +index 0000000..d9c48f9 --- /dev/null +++ b/gdb/testsuite/gdb.arch/powerpc-power7.exp -@@ -0,0 +1,176 @@ +@@ -0,0 +1,166 @@ +# Copyright 2009 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -30081,16 +30080,6 @@ index 0000000..e1fc23f +gdb_load ${objfile} + + -+# Setup the disassembler. With the default `any' flavor the instruction: -+# 0x20: xxmrghd vs3,vs4,vs5 -+# (incl. many others) would get disassembled as: -+# 0x20: stfq f3,10320(r4) -+ -+gdb_test "set powerpc disassembler-options power7" -+gdb_test "show powerpc disassembler-options power7" \ -+ "The text passed on to disassembler is \"power7\"." -+ -+ +# Disassemble the function. + +set test "disass func" @@ -35092,6 +35081,107 @@ index 495ae45..d08d7a4 100644 -re ".*time_at_startup = get_run_time.*$gdb_prompt $" { set description "next over get_run_time and everything it calls" set command "next" +diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c +new file mode 100644 +index 0000000..729f457 +--- /dev/null ++++ b/gdb/testsuite/gdb.opt/array-from-register-func.c +@@ -0,0 +1,22 @@ ++/* This file is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . */ ++ ++int ++func (int *arr) ++{ ++ return arr[0]; ++} +diff --git a/gdb/testsuite/gdb.opt/array-from-register.c b/gdb/testsuite/gdb.opt/array-from-register.c +new file mode 100644 +index 0000000..3090e7e +--- /dev/null ++++ b/gdb/testsuite/gdb.opt/array-from-register.c +@@ -0,0 +1,28 @@ ++/* This file is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . */ ++ ++extern int func (int *arr); ++ ++int ++main (void) ++{ ++ int arr[] = { 42 }; ++ ++ func (arr); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.opt/array-from-register.exp b/gdb/testsuite/gdb.opt/array-from-register.exp +new file mode 100644 +index 0000000..f2de718 +--- /dev/null ++++ b/gdb/testsuite/gdb.opt/array-from-register.exp +@@ -0,0 +1,33 @@ ++# Copyright 2009 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 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++# ++# This file is part of the gdb testsuite. ++ ++if { [prepare_for_testing array-from-register.exp "array-from-register" \ ++ {array-from-register.c array-from-register-func.c} \ ++ {debug optimize=-O2}] } { ++ return -1 ++} ++ ++if ![runto func] then { ++ return -1 ++} ++ ++gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+" ++ ++# Seen regression: ++# Address requested for identifier "arr" which is in register $rdi ++gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42" diff --git a/gdb/testsuite/gdb.python/Makefile.in b/gdb/testsuite/gdb.python/Makefile.in index 79be9e7..c49f713 100644 --- a/gdb/testsuite/gdb.python/Makefile.in @@ -35177,7 +35267,7 @@ index 0000000..35ddd8c +} diff --git a/gdb/testsuite/gdb.python/find.exp b/gdb/testsuite/gdb.python/find.exp new file mode 100644 -index 0000000..a7dad97 +index 0000000..dd9aabc --- /dev/null +++ b/gdb/testsuite/gdb.python/find.exp @@ -0,0 +1,203 @@ @@ -35273,7 +35363,7 @@ index 0000000..a7dad97 +# Test string pattern. + +gdb_test "set *(int32_t*) &int8_search_buf\[10\] = 0x61616161" "" "" -+gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('int8_search_buf')" "" "" ++gdb_test "py search_buf = gdb.selected_frame ().read_var ('int8_search_buf')" "" "" +gdb_test "py start_addr = search_buf.address ()" "" "" +gdb_test "py length = search_buf.type ().sizeof ()" "" "" + @@ -35311,7 +35401,7 @@ index 0000000..a7dad97 +# Test 16-bit pattern. + +gdb_test "set int16_search_buf\[10\] = 0x1234" "" "" -+gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('int16_search_buf')" "" "" ++gdb_test "py search_buf = gdb.selected_frame ().read_var ('int16_search_buf')" "" "" +gdb_test "py start_addr = search_buf.address ()" "" "" +gdb_test "py length = search_buf.type ().sizeof ()" "" "" +gdb_test "py pattern = gdb.parse_and_eval ('(int16_t) 0x1234')" "" "" @@ -35325,7 +35415,7 @@ index 0000000..a7dad97 +# Test 32-bit pattern. + +gdb_test "set int32_search_buf\[10\] = 0x12345678" "" "" -+gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('int32_search_buf')" "" "" ++gdb_test "py search_buf = gdb.selected_frame ().read_var ('int32_search_buf')" "" "" +gdb_test "py start_addr = search_buf.address ()" "" "" +gdb_test "py length = search_buf.type ().sizeof ()" "" "" +gdb_test "py pattern = gdb.parse_and_eval ('(int32_t) 0x12345678')" "" "" @@ -35338,7 +35428,7 @@ index 0000000..a7dad97 +# Test 64-bit pattern. + +gdb_test "set int64_search_buf\[10\] = 0xfedcba9876543210LL" "" "" -+gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('int64_search_buf')" "" "" ++gdb_test "py search_buf = gdb.selected_frame ().read_var ('int64_search_buf')" "" "" +gdb_test "py start_addr = search_buf.address ()" "" "" +gdb_test "py length = search_buf.type ().sizeof ()" "" "" +gdb_test "py pattern = gdb.parse_and_eval ('(int64_t) 0xfedcba9876543210LL')" "" "" @@ -35353,7 +35443,7 @@ index 0000000..a7dad97 +gdb_test "set *(int8_t*) &search_buf\[10\] = 0x62" "" "" +gdb_test "set *(int16_t*) &search_buf\[11\] = 0x6363" "" "" +gdb_test "set *(int32_t*) &search_buf\[13\] = 0x64646464" "" "" -+gdb_test "py search_buf = gdb.selected_frame ().read_var_value ('search_buf')" "" "" ++gdb_test "py search_buf = gdb.selected_frame ().read_var ('search_buf')" "" "" +gdb_test "py start_addr = search_buf\[0\].address ()" "" "" +gdb_test "py pattern1 = gdb.parse_and_eval ('(int8_t) 0x62')" "" "" +gdb_test "py pattern2 = gdb.parse_and_eval ('(int16_t) 0x6363')" "" "" @@ -35370,8 +35460,8 @@ index 0000000..a7dad97 + +gdb_test "set *(int32_t*) &search_buf\[0*${CHUNK_SIZE}+100\] = 0x12345678" "" "" +gdb_test "set *(int32_t*) &search_buf\[1*${CHUNK_SIZE}+100\] = 0x12345678" "" "" -+gdb_test "py start_addr = gdb.selected_frame ().read_var_value ('search_buf')" "" "" -+gdb_test "py length = gdb.selected_frame ().read_var_value ('search_buf_size')" "" "" ++gdb_test "py start_addr = gdb.selected_frame ().read_var ('search_buf')" "" "" ++gdb_test "py length = gdb.selected_frame ().read_var ('search_buf_size')" "" "" + +gdb_test "py print gdb.search_memory (start_addr, length, 0x12345678, 4)" \ + "${two_patterns_found}" "search spanning large range" @@ -35443,7 +35533,7 @@ index 0000000..22eb9f2 +} diff --git a/gdb/testsuite/gdb.python/python-frame.exp b/gdb/testsuite/gdb.python/python-frame.exp new file mode 100644 -index 0000000..f62f63d +index 0000000..674c25e --- /dev/null +++ b/gdb/testsuite/gdb.python/python-frame.exp @@ -0,0 +1,92 @@ @@ -35530,10 +35620,10 @@ index 0000000..f62f63d +gdb_test "python print 'result =', f0.addr_in_block ()" " = \[0-9\]+" "test Frame.addr_in_block" +gdb_test "python print 'result =', f0.older ().equals (f1)" " = True" "test Frame.older" +gdb_test "python print 'result =', f1.newer ().equals (f0)" " = True" "test Frame.newer" -+gdb_test "python print 'result =', f0.read_var_value ('b')" \ -+ "ValueError: variable 'b' not found.*Error while executing Python code." \ -+ "test Frame.read_var_value - error" -+gdb_test "python print 'result =', f0.read_var_value ('a')" " = 1" "test Frame.read_var_value - success" ++gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_exist')" \ ++ "ValueError: variable 'variable_which_surely_doesnt_exist' not found.*Error while executing Python code." \ ++ "test Frame.read_var - error" ++gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success" + +gdb_test "python print 'result =', gdb.newest_frame ().equals (f0)" " = True" "test gdb.newest_frame" +gdb_test "python print 'result =', gdb.selected_frame ().equals (f1)" " = True" "test gdb.selected_frame" @@ -37721,7 +37811,7 @@ index 8b65af6..4f63fa6 100644 + #endif diff --git a/gdb/value.c b/gdb/value.c -index 4d4329e..9312468 100644 +index 4d4329e..5c81d83 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -36,6 +36,7 @@ @@ -37732,7 +37822,7 @@ index 4d4329e..9312468 100644 #include "valprint.h" #include "python/python.h" -@@ -44,6 +45,27 @@ +@@ -44,6 +45,23 @@ void _initialize_values (void); @@ -37749,10 +37839,6 @@ index 4d4329e..9312468 100644 + + /* User data for the handler. */ + void *cookie; -+ -+ /* Function called to destroy the cookie when the function object is -+ destroyed. */ -+ void (*destroyer) (void *cookie); +}; + +static struct cmd_list_element *functionlist; @@ -37760,7 +37846,7 @@ index 4d4329e..9312468 100644 struct value { /* Type of value; either not an lval, or one of the various -@@ -203,6 +225,10 @@ struct value_history_chunk +@@ -203,6 +221,10 @@ struct value_history_chunk static struct value_history_chunk *value_history_chain; static int value_history_count; /* Abs number of last entry stored */ @@ -37771,7 +37857,7 @@ index 4d4329e..9312468 100644 /* List of all value objects currently allocated (except for those released by calls to release_value) -@@ -225,9 +251,11 @@ allocate_value_lazy (struct type *type) +@@ -225,9 +247,11 @@ allocate_value_lazy (struct type *type) val->next = all_values; all_values = val; val->type = type; @@ -37784,7 +37870,7 @@ index 4d4329e..9312468 100644 VALUE_FRAME_ID (val) = null_frame_id; val->offset = 0; val->bitpos = 0; -@@ -269,13 +297,9 @@ struct value * +@@ -269,13 +293,9 @@ struct value * allocate_repeat_value (struct type *type, int count) { int low_bound = current_language->string_lower_bound; /* ??? */ @@ -37798,7 +37884,7 @@ index 4d4329e..9312468 100644 return allocate_value (create_array_type ((struct type *) NULL, type, range_type)); } -@@ -335,6 +359,8 @@ value_type (struct value *value) +@@ -335,6 +355,8 @@ value_type (struct value *value) void deprecated_set_value_type (struct value *value, struct type *type) { @@ -37807,7 +37893,7 @@ index 4d4329e..9312468 100644 value->type = type; } -@@ -509,6 +535,32 @@ deprecated_value_address_hack (struct value *value) +@@ -509,6 +531,32 @@ deprecated_value_address_hack (struct value *value) return &value->location.address; } @@ -37840,7 +37926,7 @@ index 4d4329e..9312468 100644 struct internalvar ** deprecated_value_internalvar_hack (struct value *value) { -@@ -547,11 +599,16 @@ value_mark (void) +@@ -547,11 +595,16 @@ value_mark (void) return all_values; } @@ -37857,7 +37943,7 @@ index 4d4329e..9312468 100644 if (VALUE_LVAL (val) == lval_computed) { struct lval_funcs *funcs = val->location.computed.funcs; -@@ -655,6 +712,8 @@ value_copy (struct value *arg) +@@ -655,6 +708,8 @@ value_copy (struct value *arg) val = allocate_value_lazy (encl_type); else val = allocate_value (encl_type); @@ -37866,7 +37952,7 @@ index 4d4329e..9312468 100644 val->type = arg->type; VALUE_LVAL (val) = VALUE_LVAL (arg); val->location = arg->location; -@@ -693,6 +752,7 @@ set_value_component_location (struct value *component, struct value *whole) +@@ -693,6 +748,7 @@ set_value_component_location (struct value *component, struct value *whole) VALUE_LVAL (component) = VALUE_LVAL (whole); component->location = whole->location; @@ -37874,7 +37960,7 @@ index 4d4329e..9312468 100644 if (VALUE_LVAL (whole) == lval_computed) { struct lval_funcs *funcs = whole->location.computed.funcs; -@@ -700,6 +760,8 @@ set_value_component_location (struct value *component, struct value *whole) +@@ -700,6 +756,8 @@ set_value_component_location (struct value *component, struct value *whole) if (funcs->copy_closure) component->location.computed.closure = funcs->copy_closure (whole); } @@ -37883,7 +37969,7 @@ index 4d4329e..9312468 100644 } -@@ -830,6 +892,25 @@ show_values (char *num_exp, int from_tty) +@@ -830,6 +888,25 @@ show_values (char *num_exp, int from_tty) num_exp[1] = '\0'; } } @@ -37909,7 +37995,7 @@ index 4d4329e..9312468 100644 /* Internal variables. These are variables within the debugger that hold values assigned by debugger commands. -@@ -878,7 +959,7 @@ init_if_undefined_command (char* args, int from_tty) +@@ -878,7 +955,7 @@ init_if_undefined_command (char* args, int from_tty) the return value is NULL. */ struct internalvar * @@ -37918,7 +38004,7 @@ index 4d4329e..9312468 100644 { struct internalvar *var; -@@ -894,7 +975,7 @@ lookup_only_internalvar (char *name) +@@ -894,7 +971,7 @@ lookup_only_internalvar (char *name) NAME should not normally include a dollar sign. */ struct internalvar * @@ -37927,7 +38013,15 @@ index 4d4329e..9312468 100644 { struct internalvar *var; var = (struct internalvar *) xmalloc (sizeof (struct internalvar)); -@@ -934,7 +1015,7 @@ create_internalvar_type_lazy (char *name, internalvar_make_value fun) +@@ -902,6 +979,7 @@ create_internalvar (char *name) + var->value = allocate_value (builtin_type_void); + var->endian = gdbarch_byte_order (current_gdbarch); + var->make_value = NULL; ++ var->canonical = 0; + release_value (var->value); + var->next = internalvars; + internalvars = var; +@@ -934,7 +1012,7 @@ create_internalvar_type_lazy (char *name, internalvar_make_value fun) one is created, with a void value. */ struct internalvar * @@ -37936,6 +38030,16 @@ index 4d4329e..9312468 100644 { struct internalvar *var; +@@ -1031,6 +1109,9 @@ set_internalvar (struct internalvar *var, struct value *val) + { + struct value *newval; + ++ if (var->canonical) ++ error (_("Cannot overwrite convenience function %s"), var->name); ++ + newval = value_copy (val); + newval->modifiable = 1; + @@ -1042,7 +1123,7 @@ set_internalvar (struct internalvar *var, struct value *val) /* Begin code which must not call error(). If var->value points to @@ -37945,29 +38049,22 @@ index 4d4329e..9312468 100644 something in the value chain (i.e., before release_value is called), because after the error free_all_values will get called before long. */ -@@ -1059,6 +1140,85 @@ internalvar_name (struct internalvar *var) +@@ -1059,6 +1140,76 @@ internalvar_name (struct internalvar *var) return var->name; } +static struct value * +value_create_internal_function (const char *name, + internal_function_fn handler, -+ void *cookie, -+ void (*destroyer) (void *)) ++ void *cookie) +{ + struct value *result = allocate_value (internal_fn_type); + gdb_byte *addr = value_contents_writeable (result); + struct internal_function **fnp = (struct internal_function **) addr; -+ /* The internal_function object is leaked here -- to make it truly -+ deletable, we would have to reference count it and add special -+ code to value_free and value_copy. The setup here is a bit odd -+ in general. It would be better to have a special case in -+ help_command. */ + struct internal_function *ifn = XNEW (struct internal_function); + ifn->name = xstrdup (name); + ifn->handler = handler; + ifn->cookie = cookie; -+ ifn->destroyer = destroyer; + *fnp = ifn; + return result; +} @@ -38009,19 +38106,17 @@ index 4d4329e..9312468 100644 +/* Add a new internal function. NAME is the name of the function; DOC + is a documentation string describing the function. HANDLER is + called when the function is invoked. COOKIE is an arbitrary -+ pointer which is passed to HANDLER and is intended for "user data". -+ DESTROYER is invoked when the function is destroyed. */ ++ pointer which is passed to HANDLER and is intended for "user ++ data". */ +void +add_internal_function (const char *name, const char *doc, -+ internal_function_fn handler, -+ void *cookie, void (*destroyer) (void *)) ++ internal_function_fn handler, void *cookie) +{ + struct cmd_list_element *cmd; + struct internalvar *var = lookup_internalvar (name); -+ struct value *fnval = value_create_internal_function (name, handler, cookie, -+ destroyer); -+ release_value (fnval); ++ struct value *fnval = value_create_internal_function (name, handler, cookie); + set_internalvar (var, fnval); ++ var->canonical = 1; + + cmd = add_cmd (xstrdup (name), no_class, function_command, (char *) doc, + &functionlist); @@ -38031,7 +38126,7 @@ index 4d4329e..9312468 100644 /* Update VALUE before discarding OBJFILE. COPIED_TYPES is used to prevent cycles / duplicates. */ -@@ -1067,12 +1227,21 @@ preserve_one_value (struct value *value, struct objfile *objfile, +@@ -1067,12 +1218,21 @@ preserve_one_value (struct value *value, struct objfile *objfile, htab_t copied_types) { if (TYPE_OBJFILE (value->type) == objfile) @@ -38057,7 +38152,7 @@ index 4d4329e..9312468 100644 } /* Update the internal variables and value history when OBJFILE is -@@ -1196,7 +1365,7 @@ value_as_address (struct value *val) +@@ -1196,7 +1356,7 @@ value_as_address (struct value *val) Upon entry to this function, if VAL is a value of type `function' (that is, TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC), then @@ -38066,7 +38161,7 @@ index 4d4329e..9312468 100644 you'll get if you evaluate an expression like `main'. The call to COERCE_ARRAY below actually does all the usual unary conversions, which includes converting values of type `function' -@@ -1216,7 +1385,7 @@ value_as_address (struct value *val) +@@ -1216,7 +1376,7 @@ value_as_address (struct value *val) function, just return its address directly. */ if (TYPE_CODE (value_type (val)) == TYPE_CODE_FUNC || TYPE_CODE (value_type (val)) == TYPE_CODE_METHOD) @@ -38075,7 +38170,7 @@ index 4d4329e..9312468 100644 val = coerce_array (val); -@@ -1447,7 +1616,7 @@ value_static_field (struct type *type, int fieldno) +@@ -1447,7 +1607,7 @@ value_static_field (struct type *type, int fieldno) } if (retval && VALUE_LVAL (retval) == lval_memory) SET_FIELD_PHYSADDR (TYPE_FIELD (type, fieldno), @@ -38084,7 +38179,7 @@ index 4d4329e..9312468 100644 } return retval; } -@@ -1465,6 +1634,8 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type) +@@ -1465,6 +1625,8 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type) val->contents = (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type)); @@ -38093,7 +38188,7 @@ index 4d4329e..9312468 100644 val->enclosing_type = new_encl_type; return val; } -@@ -1516,6 +1687,8 @@ value_primitive_field (struct value *arg1, int offset, +@@ -1516,6 +1678,8 @@ value_primitive_field (struct value *arg1, int offset, memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1), TYPE_LENGTH (value_enclosing_type (arg1))); } @@ -38102,7 +38197,7 @@ index 4d4329e..9312468 100644 v->type = type; v->offset = value_offset (arg1); v->embedded_offset = (offset + value_embedded_offset (arg1) -@@ -1592,7 +1765,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty +@@ -1592,7 +1756,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty v = allocate_value (ftype); if (sym) { @@ -38111,7 +38206,7 @@ index 4d4329e..9312468 100644 } else { -@@ -1601,9 +1774,9 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty +@@ -1601,9 +1765,9 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty struct objfile *objfile = msymbol_objfile (msym); struct gdbarch *gdbarch = get_objfile_arch (objfile); @@ -38124,7 +38219,7 @@ index 4d4329e..9312468 100644 } if (arg1p) -@@ -1750,6 +1923,41 @@ pack_long (gdb_byte *buf, struct type *type, LONGEST num) +@@ -1750,6 +1914,41 @@ pack_long (gdb_byte *buf, struct type *type, LONGEST num) } @@ -38166,7 +38261,7 @@ index 4d4329e..9312468 100644 /* Convert C numbers into newly allocated values. */ struct value * -@@ -1763,6 +1971,19 @@ value_from_longest (struct type *type, LONGEST num) +@@ -1763,6 +1962,19 @@ value_from_longest (struct type *type, LONGEST num) } @@ -38186,7 +38281,7 @@ index 4d4329e..9312468 100644 /* Create a value representing a pointer of type TYPE to the address ADDR. */ struct value * -@@ -1816,8 +2037,9 @@ value_from_contents_and_address (struct type *type, +@@ -1816,8 +2028,9 @@ value_from_contents_and_address (struct type *type, set_value_lazy (v, 1); else memcpy (value_contents_raw (v), valaddr, TYPE_LENGTH (type)); @@ -38198,7 +38293,7 @@ index 4d4329e..9312468 100644 return v; } -@@ -1944,4 +2166,15 @@ init-if-undefined VARIABLE = EXPRESSION\n\ +@@ -1944,4 +2157,15 @@ init-if-undefined VARIABLE = EXPRESSION\n\ Set an internal VARIABLE to the result of the EXPRESSION if it does not\n\ exist or does not contain a value. The EXPRESSION is not evaluated if the\n\ VARIABLE is already initialized.")); @@ -38215,7 +38310,7 @@ index 4d4329e..9312468 100644 + make_final_cleanup (value_history_cleanup, NULL); } diff --git a/gdb/value.h b/gdb/value.h -index aa43365..f41def9 100644 +index aa43365..1ad3c75 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -272,12 +272,23 @@ extern void set_value_component_location (struct value *component, @@ -38245,7 +38340,17 @@ index aa43365..f41def9 100644 /* Pointer to internal variable. */ extern struct internalvar **deprecated_value_internalvar_hack (struct value *); #define VALUE_INTERNALVAR(val) (*deprecated_value_internalvar_hack (val)) -@@ -342,12 +353,17 @@ extern LONGEST unpack_field_as_long (struct type *type, +@@ -314,6 +325,9 @@ struct internalvar + struct value *value; + internalvar_make_value make_value; + int endian; ++ /* True if this internalvar is the canonical name for a convenience ++ function. */ ++ int canonical; + }; + + +@@ -342,12 +356,17 @@ extern LONGEST unpack_field_as_long (struct type *type, extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); extern struct value *value_from_longest (struct type *type, LONGEST num); @@ -38263,7 +38368,7 @@ index aa43365..f41def9 100644 extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); -@@ -388,6 +404,8 @@ extern struct value *value_mark (void); +@@ -388,6 +407,8 @@ extern struct value *value_mark (void); extern void value_free_to_mark (struct value *mark); @@ -38272,7 +38377,7 @@ index aa43365..f41def9 100644 extern struct value *value_string (char *ptr, int len); extern struct value *value_bitstring (char *ptr, int len); -@@ -435,6 +453,7 @@ extern struct value *value_struct_elt (struct value **argp, +@@ -435,6 +456,7 @@ extern struct value *value_struct_elt (struct value **argp, extern struct value *value_aggregate_elt (struct type *curtype, char *name, @@ -38280,7 +38385,7 @@ index aa43365..f41def9 100644 int want_address, enum noside noside); -@@ -533,14 +552,14 @@ extern void set_internalvar_component (struct internalvar *var, +@@ -533,14 +555,14 @@ extern void set_internalvar_component (struct internalvar *var, int bitpos, int bitsize, struct value *newvalue); @@ -38298,7 +38403,7 @@ index aa43365..f41def9 100644 extern int value_equal (struct value *arg1, struct value *arg2); -@@ -619,7 +638,7 @@ extern int common_val_print (struct value *val, +@@ -619,7 +641,7 @@ extern int common_val_print (struct value *val, const struct value_print_options *options, const struct language_defn *language); @@ -38307,7 +38412,7 @@ index aa43365..f41def9 100644 struct ui_file *stream, const struct value_print_options *options); -@@ -658,5 +677,22 @@ extern struct value *value_allocate_space_in_inferior (int); +@@ -658,5 +680,22 @@ extern struct value *value_allocate_space_in_inferior (int); extern struct value *value_of_local (const char *name, int complain); @@ -38323,7 +38428,7 @@ index aa43365..f41def9 100644 + +void add_internal_function (const char *name, const char *doc, + internal_function_fn handler, -+ void *cookie, void (*destroyer) (void *)); ++ void *cookie); + +struct value *call_internal_function (struct value *function, + int argc, struct value **argv); @@ -38332,7 +38437,7 @@ index aa43365..f41def9 100644 + #endif /* !defined (VALUE_H) */ diff --git a/gdb/varobj.c b/gdb/varobj.c -index 2ec6d90..d18f6e7 100644 +index 2ec6d90..1237c96 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -29,11 +29,20 @@ @@ -38397,7 +38502,16 @@ index 2ec6d90..d18f6e7 100644 /* Utility routines */ static struct varobj *new_variable (void); -@@ -215,6 +244,8 @@ static char *cppop (struct cpstack **pstack); +@@ -200,6 +229,8 @@ static void free_variable (struct varobj *var); + + static struct cleanup *make_cleanup_free_variable (struct varobj *var); + ++static struct cleanup *make_cleanup_uninstall_variable (struct varobj *var); ++ + static struct type *get_type (struct varobj *var); + + static struct type *get_value_type (struct varobj *var); +@@ -215,6 +246,8 @@ static char *cppop (struct cpstack **pstack); static int install_new_value (struct varobj *var, struct value *value, int initial); @@ -38406,7 +38520,7 @@ index 2ec6d90..d18f6e7 100644 /* Language-specific routines. */ static enum varobj_languages variable_language (struct varobj *var); -@@ -232,13 +263,17 @@ static struct value *value_of_child (struct varobj *parent, int index); +@@ -232,13 +265,17 @@ static struct value *value_of_child (struct varobj *parent, int index); static char *my_value_of_variable (struct varobj *var, enum varobj_display_formats format); @@ -38426,15 +38540,18 @@ index 2ec6d90..d18f6e7 100644 /* C implementation */ static int c_number_of_children (struct varobj *var); -@@ -572,6 +607,7 @@ varobj_create (char *objname, +@@ -570,8 +607,10 @@ varobj_create (char *objname, + do_cleanups (old_chain); + return NULL; } ++ make_cleanup_uninstall_variable (var); } + install_default_visualizer (var); discard_cleanups (old_chain); return var; } -@@ -678,6 +714,33 @@ varobj_delete (struct varobj *var, char ***dellist, int only_children) +@@ -678,6 +717,33 @@ varobj_delete (struct varobj *var, char ***dellist, int only_children) return delcount; } @@ -38468,7 +38585,7 @@ index 2ec6d90..d18f6e7 100644 /* Set/Get variable object display format */ enum varobj_display_formats -@@ -702,7 +765,8 @@ varobj_set_display_format (struct varobj *var, +@@ -702,7 +768,8 @@ varobj_set_display_format (struct varobj *var, && var->value && !value_lazy (var->value)) { xfree (var->print_value); @@ -38478,7 +38595,7 @@ index 2ec6d90..d18f6e7 100644 } return var->format; -@@ -714,6 +778,21 @@ varobj_get_display_format (struct varobj *var) +@@ -714,6 +781,21 @@ varobj_get_display_format (struct varobj *var) return var->format; } @@ -38500,7 +38617,7 @@ index 2ec6d90..d18f6e7 100644 /* If the variable object is bound to a specific thread, that is its evaluation can always be done in context of a frame inside that thread, returns GDB id of the thread -- which -@@ -746,12 +825,141 @@ varobj_get_frozen (struct varobj *var) +@@ -746,12 +828,141 @@ varobj_get_frozen (struct varobj *var) return var->frozen; } @@ -38643,7 +38760,7 @@ index 2ec6d90..d18f6e7 100644 return var->num_children; } -@@ -764,7 +972,16 @@ varobj_list_children (struct varobj *var) +@@ -764,7 +975,16 @@ varobj_list_children (struct varobj *var) { struct varobj *child; char *name; @@ -38661,7 +38778,7 @@ index 2ec6d90..d18f6e7 100644 if (var->num_children == -1) var->num_children = number_of_children (var); -@@ -790,12 +1007,24 @@ varobj_list_children (struct varobj *var) +@@ -790,12 +1010,24 @@ varobj_list_children (struct varobj *var) name = name_of_child (var, i); existing = create_child (var, i, name); VEC_replace (varobj_p, var->children, i, existing); @@ -38686,7 +38803,7 @@ index 2ec6d90..d18f6e7 100644 /* Obtain the type of an object Variable as a string similar to the one gdb prints on the console */ -@@ -1002,6 +1231,13 @@ install_new_value (struct varobj *var, struct value *value, int initial) +@@ -1002,6 +1234,13 @@ install_new_value (struct varobj *var, struct value *value, int initial) a type. */ gdb_assert (var->type || CPLUS_FAKE_CHILD (var)); changeable = varobj_value_is_changeable_p (var); @@ -38700,7 +38817,7 @@ index 2ec6d90..d18f6e7 100644 need_to_fetch = changeable; /* We are not interested in the address of references, and given -@@ -1053,12 +1289,14 @@ install_new_value (struct varobj *var, struct value *value, int initial) +@@ -1053,12 +1292,14 @@ install_new_value (struct varobj *var, struct value *value, int initial) } } @@ -38716,7 +38833,7 @@ index 2ec6d90..d18f6e7 100644 /* If the type is changeable, compare the old and the new values. If this is the initial assignment, we don't have any old value -@@ -1123,6 +1361,150 @@ install_new_value (struct varobj *var, struct value *value, int initial) +@@ -1123,6 +1364,150 @@ install_new_value (struct varobj *var, struct value *value, int initial) return changed; } @@ -38810,7 +38927,7 @@ index 2ec6d90..d18f6e7 100644 + install_visualizer (var, pretty_printer); + do_cleanups (cleanup); +#else -+ error ("Python support required"); ++ /* No error is right as this function is inserted just as a hook. */ +#endif +} + @@ -38867,7 +38984,7 @@ index 2ec6d90..d18f6e7 100644 /* Update the values for a variable and its children. This is a two-pronged attack. First, re-parse the value for the root's expression to see if it's changed. Then go all the way -@@ -1148,7 +1530,7 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) +@@ -1148,7 +1533,7 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) struct varobj **cv; struct varobj **templist = NULL; struct value *new; @@ -38876,7 +38993,7 @@ index 2ec6d90..d18f6e7 100644 VEC (varobj_update_result) *result = NULL; struct frame_info *fi; -@@ -1187,20 +1569,85 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) +@@ -1187,20 +1572,85 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) if (new == NULL) r.status = VAROBJ_NOT_IN_SCOPE; @@ -38970,7 +39087,7 @@ index 2ec6d90..d18f6e7 100644 /* Push any children. Use reverse order so that the first child is popped from the work stack first, and so -@@ -1211,26 +1658,18 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) +@@ -1211,26 +1661,18 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) varobj_p c = VEC_index (varobj_p, v->children, i); /* Child may be NULL if explicitly deleted by -var-delete. */ if (c != NULL && !c->frozen) @@ -39004,7 +39121,7 @@ index 2ec6d90..d18f6e7 100644 return result; } -@@ -1429,16 +1868,23 @@ uninstall_variable (struct varobj *var) +@@ -1429,16 +1871,23 @@ uninstall_variable (struct varobj *var) static struct varobj * create_child (struct varobj *parent, int index, char *name) { @@ -39031,7 +39148,7 @@ index 2ec6d90..d18f6e7 100644 child->parent = parent; child->root = parent->root; childs_name = xstrprintf ("%s.%s", parent->obj_name, name); -@@ -1487,6 +1933,10 @@ new_variable (void) +@@ -1487,6 +1936,10 @@ new_variable (void) var->print_value = NULL; var->frozen = 0; var->not_fetched = 0; @@ -39042,7 +39159,7 @@ index 2ec6d90..d18f6e7 100644 return var; } -@@ -1519,6 +1969,14 @@ free_variable (struct varobj *var) +@@ -1519,6 +1972,14 @@ free_variable (struct varobj *var) xfree (var->root); } @@ -39057,7 +39174,26 @@ index 2ec6d90..d18f6e7 100644 xfree (var->name); xfree (var->obj_name); xfree (var->print_value); -@@ -1792,24 +2250,71 @@ my_value_of_variable (struct varobj *var, enum varobj_display_formats format) +@@ -1538,6 +1999,18 @@ make_cleanup_free_variable (struct varobj *var) + return make_cleanup (do_free_variable_cleanup, var); + } + ++static void ++do_uninstall_variable_cleanup (void *var) ++{ ++ uninstall_variable (var); ++} ++ ++static struct cleanup * ++make_cleanup_uninstall_variable (struct varobj *var) ++{ ++ return make_cleanup (do_uninstall_variable_cleanup, var); ++} ++ + /* This returns the type of the variable. It also skips past typedefs + to return the real type of the variable. + +@@ -1792,24 +2265,71 @@ my_value_of_variable (struct varobj *var, enum varobj_display_formats format) return NULL; } @@ -39133,7 +39269,7 @@ index 2ec6d90..d18f6e7 100644 thevalue = ui_file_xstrdup (stb, &dummy); do_cleanups (old_chain); -@@ -1900,7 +2405,7 @@ varobj_floating_p (struct varobj *var) +@@ -1900,7 +2420,7 @@ varobj_floating_p (struct varobj *var) value is not known. If WAS_PTR is not NULL, set *WAS_PTR to 0 or 1 @@ -39142,7 +39278,7 @@ index 2ec6d90..d18f6e7 100644 in this function. */ static void adjust_value_for_child_access (struct value **value, -@@ -2269,6 +2774,11 @@ c_value_of_variable (struct varobj *var, enum varobj_display_formats format) +@@ -2269,6 +2789,11 @@ c_value_of_variable (struct varobj *var, enum varobj_display_formats format) catch that case explicitly. */ struct type *type = get_type (var); @@ -39154,7 +39290,7 @@ index 2ec6d90..d18f6e7 100644 /* Strip top-level references. */ while (TYPE_CODE (type) == TYPE_CODE_REF) type = check_typedef (TYPE_TARGET_TYPE (type)); -@@ -2313,7 +2823,8 @@ c_value_of_variable (struct varobj *var, enum varobj_display_formats format) +@@ -2313,7 +2838,8 @@ c_value_of_variable (struct varobj *var, enum varobj_display_formats format) if (format == var->format) return xstrdup (var->print_value); else @@ -39721,3 +39857,72 @@ index 0000000..ff11f20 +const char **xml_list_of_syscalls (const struct syscalls_info *sysinfo); + +#endif /* XML_SYSCALL_H */ +diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c +index c872db5..5e70395 100644 +--- a/opcodes/ppc-opc.c ++++ b/opcodes/ppc-opc.c +@@ -4560,8 +4560,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { + + {"lhbrx", X(31,790), X_MASK, COM, PPCNONE, {RT, RA0, RB}}, + +-{"lfqx", X(31,791), X_MASK, POWER2, PPCNONE, {FRT, RA, RB}}, + {"lfdpx", X(31,791), X_MASK, POWER6, POWER7, {FRT, RA, RB}}, ++{"lfqx", X(31,791), X_MASK, POWER2, PPCNONE, {FRT, RA, RB}}, + + {"sraw", XRC(31,792,0), X_MASK, PPCCOM, PPCNONE, {RA, RS, RB}}, + {"sra", XRC(31,792,0), X_MASK, PWRCOM, PPCNONE, {RA, RS, RB}}, +@@ -4638,8 +4638,8 @@ const struct powerpc_opcode powerpc_opcodes[] = { + + {"sthbrx", X(31,918), X_MASK, COM, PPCNONE, {RS, RA0, RB}}, + +-{"stfqx", X(31,919), X_MASK, POWER2, PPCNONE, {FRS, RA, RB}}, + {"stfdpx", X(31,919), X_MASK, POWER6, PPCNONE, {FRS, RA, RB}}, ++{"stfqx", X(31,919), X_MASK, POWER2, PPCNONE, {FRS, RA, RB}}, + + {"sraq", XRC(31,920,0), X_MASK, M601, PPCNONE, {RA, RS, RB}}, + {"sraq.", XRC(31,920,1), X_MASK, M601, PPCNONE, {RA, RS, RB}}, +@@ -4801,12 +4801,12 @@ const struct powerpc_opcode powerpc_opcodes[] = { + + {"psq_l", OP(56), OP_MASK, PPCPS, PPCNONE, {FRT,PSD,RA,PSW,PSQ}}, + ++{"lfdp", OP(57), OP_MASK, POWER6, POWER7, {FRT, D, RA0}}, ++ + {"lfqu", OP(57), OP_MASK, POWER2, PPCNONE, {FRT, D, RA0}}, + + {"psq_lu", OP(57), OP_MASK, PPCPS, PPCNONE, {FRT,PSD,RA,PSW,PSQ}}, + +-{"lfdp", OP(57), OP_MASK, POWER6, POWER7, {FRT, D, RA0}}, +- + {"ld", DSO(58,0), DS_MASK, PPC64, PPCNONE, {RT, DS, RA0}}, + {"ldu", DSO(58,1), DS_MASK, PPC64, PPCNONE, {RT, DS, RAL}}, + {"lwa", DSO(58,2), DS_MASK, PPC64, PPCNONE, {RT, DS, RA0}}, +@@ -4921,10 +4921,6 @@ const struct powerpc_opcode powerpc_opcodes[] = { + {"fcfidus", XRC(59,974,0), XRA_MASK, POWER7, PPCNONE, {FRT, FRB}}, + {"fcfidus.", XRC(59,974,1), XRA_MASK, POWER7, PPCNONE, {FRT, FRB}}, + +-{"stfq", OP(60), OP_MASK, POWER2, PPCNONE, {FRS, D, RA}}, +- +-{"psq_st", OP(60), OP_MASK, PPCPS, PPCNONE, {FRS,PSD,RA,PSW,PSQ}}, +- + {"xxsldwi", XX3(60,2), XX3SHW_MASK, PPCVSX, PPCNONE, {XT6, XA6, XB6, SHW}}, + {"xxsel", XX4(60,3), XX4_MASK, PPCVSX, PPCNONE, {XT6, XA6, XB6, XC6}}, + {"xxspltd", XX3(60,10), XX3DM_MASK, PPCVSX, PPCNONE, {XT6, XA6, XB6S, DMEX}}, +@@ -5067,12 +5063,16 @@ const struct powerpc_opcode powerpc_opcodes[] = { + {"xvcvsxddp", XX2(60,504), XX2_MASK, PPCVSX, PPCNONE, {XT6, XB6}}, + {"xvnegdp", XX2(60,505), XX2_MASK, PPCVSX, PPCNONE, {XT6, XB6}}, + +-{"psq_stu", OP(61), OP_MASK, PPCPS, PPCNONE, {FRS,PSD,RA,PSW,PSQ}}, ++{"stfq", OP(60), OP_MASK, POWER2, PPCNONE, {FRS, D, RA}}, + +-{"stfqu", OP(61), OP_MASK, POWER2, PPCNONE, {FRS, D, RA}}, ++{"psq_st", OP(60), OP_MASK, PPCPS, PPCNONE, {FRS,PSD,RA,PSW,PSQ}}, + + {"stfdp", OP(61), OP_MASK, POWER6, PPCNONE, {FRT, D, RA0}}, + ++{"stfqu", OP(61), OP_MASK, POWER2, PPCNONE, {FRS, D, RA}}, ++ ++{"psq_stu", OP(61), OP_MASK, PPCPS, PPCNONE, {FRS,PSD,RA,PSW,PSQ}}, ++ + {"std", DSO(62,0), DS_MASK, PPC64, PPCNONE, {RS, DS, RA0}}, + {"stdu", DSO(62,1), DS_MASK, PPC64, PPCNONE, {RS, DS, RAS}}, + {"stq", DSO(62,2), DS_MASK, POWER4, PPCNONE, {RSQ, DS, RA0}}, diff --git a/gdb.spec b/gdb.spec index fcdc8ba..5c361fd 100644 --- a/gdb.spec +++ b/gdb.spec @@ -13,7 +13,7 @@ Version: 6.8.50.20090302 # 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: 2%{?_with_upstream:.upstream}%{?dist} +Release: 3%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers @@ -386,21 +386,23 @@ BuildRequires: python-devel %if 0%{?_with_testsuite:1} BuildRequires: sharutils dejagnu # gcc-objc++ is not covered by the GDB testsuite. -BuildRequires: gcc gcc-c++ gcc-gfortran gcc-java gcc-objc fpc +BuildRequires: gcc gcc-c++ gcc-gfortran gcc-java gcc-objc fpc glibc-static # Ensure the devel libraries are installed for both multilib arches. %define multilib_64_archs sparc64 ppc64 s390x x86_64 # Copied from gcc-4.1.2-32 %ifarch %{ix86} x86_64 ia64 ppc alpha BuildRequires: gcc-gnat %ifarch %{multilib_64_archs} ppc -BuildRequires: %{_exec_prefix}/lib64/libgnat-4.3.so %{_exec_prefix}/lib/libgnat-4.3.so +BuildRequires: %{_exec_prefix}/lib64/libgnat-4.4.so %{_exec_prefix}/lib/libgnat-4.4.so %endif %endif %ifarch %{multilib_64_archs} sparc sparcv9 ppc BuildRequires: /lib/libc.so.6 %{_exec_prefix}/lib/libc.so /lib64/libc.so.6 %{_exec_prefix}/lib64/libc.so BuildRequires: /lib/libgcc_s.so.1 /lib64/libgcc_s.so.1 BuildRequires: %{_exec_prefix}/lib/libstdc++.so.6 %{_exec_prefix}/lib64/libstdc++.so.6 -BuildRequires: %{_exec_prefix}/lib64/libgcj.so.9 %{_exec_prefix}/lib/libgcj.so.9 +BuildRequires: %{_exec_prefix}/lib64/libgcj.so.10 %{_exec_prefix}/lib/libgcj.so.10 +# multilib glibc-static is open Bug 488472: +#BuildRequires: %{_exec_prefix}/lib64/libc.a %{_exec_prefix}/lib/libc.a # for gcc-java: BuildRequires: %{_exec_prefix}/lib64/libz.so %{_exec_prefix}/lib/libz.so %endif @@ -612,7 +614,8 @@ CFLAGS="$CFLAGS -O0 -ggdb2" --sysconfdir=%{_sysconfdir} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ - --with-gdb-datadir=%{_datadir}/%{name} \ + --with-gdb-datadir=%{_datadir}/gdb \ + --with-pythondir=%{python_sitelib} \ --enable-gdb-build-warnings=,-Wno-unused \ %ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 sparcv9 sparc64 --disable-werror \ @@ -755,6 +758,9 @@ ln -sf gdb $RPM_BUILD_ROOT%{_prefix}/bin/gdbtui cmp $RPM_BUILD_ROOT%{_mandir}/*/gdb.1 $RPM_BUILD_ROOT%{_mandir}/*/gdbtui.1 ln -sf gdb.1 $RPM_BUILD_ROOT%{_mandir}/*/gdbtui.1 +# A part of the libstdc++ rpm. +rm -rf $RPM_BUILD_ROOT%{python_sitelib}/gdb/libstdcxx + # Remove the files that are part of a gdb build but that are owned and # provided by other packages. # These are part of binutils @@ -830,11 +836,21 @@ fi %endif %changelog +* Sat Mar 7 2009 Jan Kratochvil - 6.8.50.20090302-3 +- Archer update to the snapshot: 6cf16c0711e844094ab694b3d929f7bd30b49f61 +- Fix crash on the inlined functions support. +- Fix crash from the PIE support, its varobj_refresh() was called only before + varobj_invalidate() which is sufficient. +- Fix BuildRequires for the `--with testsuite' runs. +- Use the newly introduced `--with-pythondir' option. +- Remove libstdcxx [python] pretty printers (as included in libstdc++ rpm now). + * Fri Mar 06 2009 Jesse Keating - 6.8.50.20090302-2 - Rebuild for new rpm libs * Mon Mar 2 2009 Jan Kratochvil - 6.8.50.20090302-1 - Include the Archer Project: http://sourceware.org/gdb/wiki/ProjectArcher + snapshot: 8cc3753a9aad85bf53bef54c04334c60d16cb251 * [python] Python scripting support: http://sourceware.org/gdb/wiki/PythonGdb * [catch-syscall] Trap and display syscalls. * [delayed-symfile] Improve startup performance by lazily read psymtabs.