Accepting request 147743 from devel:gcc

- Merge from gdb-7.5.1-30.fc18.src.rpm.
  7.5.1 gives:
    * An "Attempt to dereference a generic pointer" errors (-var-create).
    * Backtrace problems on x32 (PR backtrace/14646).
    * next/step/finish problems on x32 (PR gdb/14647).
    * A "malformed linespec error: unexpected keyword, [...]" error
      (PR breakpoints/14643).
    * GDB crash while stepping through powerpc (32bits) code.
    * A failed assertion in linux_ptrace_test_ret_to_nx.
    * A "!frame_id_inlined_p (frame_id)" failed assertion.
    * A "No more reverse-execution history." error during reverse
      "next" execution (PR 14548).
    * Incomplete command descriptions in "apropos" output.
    * PR gdb/14494 (a GDB crash difficult to characterize).
  7.5 gives:
    * Go language support.
    * New targets (x32 ABI, microMIPS, Renesas RL78, HP OpenVMS ia64).
    * More Python scripting improvements.
    * SDT (Static Defined Tracing) probes support with SystemTap probes.
    * GDBserver improvements (stdio connections, target-side evaluation
      of breakpoint conditions, remote protocol improvements).
    * Other miscellaneous improvements (ability to stop when a shared
      library is loaded/unloaded, dynamic printf, etc).
    * Reverse debugging on ARM.

- Do not provide a custom (safe) auto-load dir.

OBS-URL: https://build.opensuse.org/request/show/147743
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=90
This commit is contained in:
Stephan Kulow 2013-01-11 14:55:20 +00:00 committed by Git OBS Bridge
parent cfb8ad09aa
commit 16b5661a6f
61 changed files with 22681 additions and 3067 deletions

View File

@ -11,11 +11,11 @@
* gdb.texinfo (File Options): Document --readnever. * gdb.texinfo (File Options): Document --readnever.
Index: gdb-7.4.50.20120602/gdb/doc/gdb.texinfo Index: gdb-7.4.50.20120703/gdb/doc/gdb.texinfo
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/doc/gdb.texinfo 2012-06-02 18:16:36.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/doc/gdb.texinfo 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/doc/gdb.texinfo 2012-06-02 18:25:20.300254019 +0200 +++ gdb-7.4.50.20120703/gdb/doc/gdb.texinfo 2012-07-03 17:31:40.695642449 +0200
@@ -1020,6 +1020,12 @@ Read each symbol file's entire symbol ta @@ -1023,6 +1023,12 @@ Read each symbol file's entire symbol ta
the default, which is to read it incrementally as it is needed. the default, which is to read it incrementally as it is needed.
This makes startup slower, but makes future operations faster. This makes startup slower, but makes future operations faster.
@ -28,10 +28,10 @@ Index: gdb-7.4.50.20120602/gdb/doc/gdb.texinfo
@end table @end table
@node Mode Options @node Mode Options
Index: gdb-7.4.50.20120602/gdb/main.c Index: gdb-7.4.50.20120703/gdb/main.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/main.c 2012-06-02 18:16:36.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/main.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/main.c 2012-06-02 18:25:20.302254019 +0200 +++ gdb-7.4.50.20120703/gdb/main.c 2012-07-03 17:31:40.696642448 +0200
@@ -414,6 +414,7 @@ captured_main (void *data) @@ -414,6 +414,7 @@ captured_main (void *data)
{"xdb", no_argument, &xdb_commands, 1}, {"xdb", no_argument, &xdb_commands, 1},
{"dbx", no_argument, &dbx_commands, 1}, {"dbx", no_argument, &dbx_commands, 1},
@ -48,11 +48,11 @@ Index: gdb-7.4.50.20120602/gdb/main.c
"), stream); "), stream);
fputs_unfiltered (_("\ fputs_unfiltered (_("\
--se=FILE Use FILE as symbol file and executable file.\n\ --se=FILE Use FILE as symbol file and executable file.\n\
Index: gdb-7.4.50.20120602/gdb/symfile.c Index: gdb-7.4.50.20120703/gdb/symfile.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/symfile.c 2012-05-31 20:44:49.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/symfile.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/symfile.c 2012-06-02 18:25:20.334254013 +0200 +++ gdb-7.4.50.20120703/gdb/symfile.c 2012-07-03 17:31:40.697642447 +0200
@@ -80,6 +80,7 @@ static void clear_symtab_users_cleanup ( @@ -81,6 +81,7 @@ static void clear_symtab_users_cleanup (
/* Global variables owned by this file. */ /* Global variables owned by this file. */
int readnow_symbol_files; /* Read full symbols immediately. */ int readnow_symbol_files; /* Read full symbols immediately. */
@ -60,19 +60,19 @@ Index: gdb-7.4.50.20120602/gdb/symfile.c
/* External variables and functions referenced. */ /* External variables and functions referenced. */
Index: gdb-7.4.50.20120602/gdb/dwarf2read.c Index: gdb-7.4.50.20120703/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/dwarf2read.c 2012-06-02 18:16:36.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/dwarf2read.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/dwarf2read.c 2012-06-02 18:25:32.837250535 +0200 +++ gdb-7.4.50.20120703/gdb/dwarf2read.c 2012-07-03 17:31:53.421627153 +0200
@@ -63,6 +63,7 @@ @@ -65,6 +65,7 @@
#include "valprint.h" #include "gdb/gdb-index.h"
#include "gdbcore.h" /* for gnutarget */
#include <ctype.h> #include <ctype.h>
#include "gdb_bfd.h"
+#include "top.h" +#include "top.h"
#include <fcntl.h> #include <fcntl.h>
#include "gdb_string.h" #include "gdb_string.h"
@@ -1514,8 +1515,9 @@ dwarf2_has_info (struct objfile *objfile @@ -1587,8 +1588,9 @@ dwarf2_has_info (struct objfile *objfile
(void *) names); (void *) names);
dwarf2_per_objfile->objfile = objfile; dwarf2_per_objfile->objfile = objfile;
} }
@ -84,10 +84,10 @@ Index: gdb-7.4.50.20120602/gdb/dwarf2read.c
} }
/* When loading sections, we look either for uncompressed section or for /* When loading sections, we look either for uncompressed section or for
Index: gdb-7.4.50.20120602/gdb/top.h Index: gdb-7.4.50.20120703/gdb/top.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/top.h 2012-01-23 18:12:30.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/top.h 2012-01-23 18:12:30.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/top.h 2012-06-02 18:25:20.367254001 +0200 +++ gdb-7.4.50.20120703/gdb/top.h 2012-07-03 17:31:40.700642444 +0200
@@ -60,6 +60,7 @@ extern void set_prompt (const char *s); @@ -60,6 +60,7 @@ extern void set_prompt (const char *s);
/* From random places. */ /* From random places. */

View File

@ -23,10 +23,10 @@ instead.
Port to GDB-6.7. Port to GDB-6.7.
Index: gdb-7.4.50.20120602/gdb/amd64-linux-tdep.c Index: gdb-7.4.50.20120703/gdb/amd64-linux-tdep.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/amd64-linux-tdep.c 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/amd64-linux-tdep.c 2012-06-13 22:36:48.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/amd64-linux-tdep.c 2012-06-02 21:06:25.536265325 +0200 +++ gdb-7.4.50.20120703/gdb/amd64-linux-tdep.c 2012-07-03 17:32:46.547563363 +0200
@@ -271,6 +271,80 @@ amd64_linux_register_reggroup_p (struct @@ -271,6 +271,80 @@ amd64_linux_register_reggroup_p (struct
/* Set the program counter for process PTID to PC. */ /* Set the program counter for process PTID to PC. */
@ -108,20 +108,20 @@ Index: gdb-7.4.50.20120602/gdb/amd64-linux-tdep.c
static void static void
amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{ {
@@ -1330,6 +1404,8 @@ amd64_linux_init_abi (struct gdbarch_inf @@ -1547,6 +1621,8 @@ amd64_linux_init_abi (struct gdbarch_inf
tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET; amd64_linux_init_abi_common (info, gdbarch);
+ tdep->outermost_frame_p = amd64_linux_outermost_frame; + tdep->outermost_frame_p = amd64_linux_outermost_frame;
+ +
/* GNU/Linux uses SVR4-style shared libraries. */ /* GNU/Linux uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_lp64_fetch_link_map_offsets); (gdbarch, svr4_lp64_fetch_link_map_offsets);
Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c Index: gdb-7.4.50.20120703/gdb/amd64-tdep.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/amd64-tdep.c 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/amd64-tdep.c 2012-06-16 17:20:22.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/amd64-tdep.c 2012-06-02 21:06:00.437274574 +0200 +++ gdb-7.4.50.20120703/gdb/amd64-tdep.c 2012-07-03 17:32:12.335604415 +0200
@@ -2138,6 +2138,7 @@ amd64_frame_unwind_stop_reason (struct f @@ -2324,6 +2324,7 @@ amd64_frame_unwind_stop_reason (struct f
{ {
struct amd64_frame_cache *cache = struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache); amd64_frame_cache (this_frame, this_cache);
@ -129,7 +129,7 @@ Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c
if (!cache->base_p) if (!cache->base_p)
return UNWIND_UNAVAILABLE; return UNWIND_UNAVAILABLE;
@@ -2146,6 +2147,10 @@ amd64_frame_unwind_stop_reason (struct f @@ -2332,6 +2333,10 @@ amd64_frame_unwind_stop_reason (struct f
if (cache->base == 0) if (cache->base == 0)
return UNWIND_OUTERMOST; return UNWIND_OUTERMOST;
@ -140,7 +140,7 @@ Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c
return UNWIND_NO_REASON; return UNWIND_NO_REASON;
} }
@@ -2155,6 +2160,7 @@ amd64_frame_this_id (struct frame_info * @@ -2341,6 +2346,7 @@ amd64_frame_this_id (struct frame_info *
{ {
struct amd64_frame_cache *cache = struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache); amd64_frame_cache (this_frame, this_cache);
@ -148,7 +148,7 @@ Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c
if (!cache->base_p) if (!cache->base_p)
return; return;
@@ -2163,6 +2169,10 @@ amd64_frame_this_id (struct frame_info * @@ -2349,6 +2355,10 @@ amd64_frame_this_id (struct frame_info *
if (cache->base == 0) if (cache->base == 0)
return; return;
@ -159,11 +159,11 @@ Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c
(*this_id) = frame_id_build (cache->base + 16, cache->pc); (*this_id) = frame_id_build (cache->base + 16, cache->pc);
} }
Index: gdb-7.4.50.20120602/gdb/i386-tdep.c Index: gdb-7.4.50.20120703/gdb/i386-tdep.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/i386-tdep.c 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/i386-tdep.c 2012-06-18 19:31:34.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/i386-tdep.c 2012-06-02 21:06:00.466274562 +0200 +++ gdb-7.4.50.20120703/gdb/i386-tdep.c 2012-07-03 17:32:12.339604409 +0200
@@ -7639,6 +7639,9 @@ i386_gdbarch_init (struct gdbarch_info i @@ -7655,6 +7655,9 @@ i386_gdbarch_init (struct gdbarch_info i
tdep->xsave_xcr0_offset = -1; tdep->xsave_xcr0_offset = -1;
@ -173,10 +173,10 @@ Index: gdb-7.4.50.20120602/gdb/i386-tdep.c
tdep->record_regmap = i386_record_regmap; tdep->record_regmap = i386_record_regmap;
set_gdbarch_long_long_align_bit (gdbarch, 32); set_gdbarch_long_long_align_bit (gdbarch, 32);
Index: gdb-7.4.50.20120602/gdb/i386-tdep.h Index: gdb-7.4.50.20120703/gdb/i386-tdep.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/i386-tdep.h 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/i386-tdep.h 2012-06-13 22:29:15.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/i386-tdep.h 2012-06-02 21:06:00.486274568 +0200 +++ gdb-7.4.50.20120703/gdb/i386-tdep.h 2012-07-03 17:32:12.340604408 +0200
@@ -219,6 +219,9 @@ struct gdbarch_tdep @@ -219,6 +219,9 @@ struct gdbarch_tdep
int (*i386_sysenter_record) (struct regcache *regcache); int (*i386_sysenter_record) (struct regcache *regcache);
/* Parse syscall args. */ /* Parse syscall args. */
@ -187,10 +187,10 @@ Index: gdb-7.4.50.20120602/gdb/i386-tdep.h
}; };
/* Floating-point registers. */ /* Floating-point registers. */
Index: gdb-7.4.50.20120602/gdb/ia64-tdep.c Index: gdb-7.4.50.20120703/gdb/ia64-tdep.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/ia64-tdep.c 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/ia64-tdep.c 2012-07-03 17:30:09.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/ia64-tdep.c 2012-06-02 21:06:00.490274552 +0200 +++ gdb-7.4.50.20120703/gdb/ia64-tdep.c 2012-07-03 17:32:12.343604405 +0200
@@ -2176,6 +2176,138 @@ static const struct frame_unwind ia64_fr @@ -2176,6 +2176,138 @@ static const struct frame_unwind ia64_fr
default_frame_sniffer default_frame_sniffer
}; };
@ -338,10 +338,10 @@ Index: gdb-7.4.50.20120602/gdb/ia64-tdep.c
#ifdef HAVE_LIBUNWIND_IA64_H #ifdef HAVE_LIBUNWIND_IA64_H
frame_unwind_append_unwinder (gdbarch, frame_unwind_append_unwinder (gdbarch,
&ia64_libunwind_sigtramp_frame_unwind); &ia64_libunwind_sigtramp_frame_unwind);
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.c Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.c 2012-06-02 21:06:00.514274544 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.c 2012-07-03 17:32:12.344604404 +0200
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -382,10 +382,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.c
+ for (;;) + for (;;)
+ pause(); + pause();
+} +}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2012-06-02 21:06:00.515274547 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2012-07-03 17:32:12.344604404 +0200
@@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
+# Copyright 2006 Free Software Foundation, Inc. +# Copyright 2006 Free Software Foundation, Inc.
+ +

View File

@ -1,18 +1,18 @@
Index: gdb-7.4.50.20120602/gdb/corelow.c Index: gdb-7.4.91.20120801/gdb/corelow.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/corelow.c 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.91.20120801.orig/gdb/corelow.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/corelow.c 2012-06-02 21:07:16.464246569 +0200 +++ gdb-7.4.91.20120801/gdb/corelow.c 2012-08-01 18:37:44.584925750 +0200
@@ -46,6 +46,9 @@ @@ -47,6 +47,9 @@
#include "filenames.h"
#include "progspace.h" #include "progspace.h"
#include "objfiles.h" #include "objfiles.h"
#include "gdb_bfd.h"
+#include "auxv.h" +#include "auxv.h"
+#include "elf/common.h" +#include "elf/common.h"
+#include "gdbcmd.h" +#include "gdbcmd.h"
#ifndef O_LARGEFILE #ifndef O_LARGEFILE
#define O_LARGEFILE 0 #define O_LARGEFILE 0
@@ -275,6 +278,52 @@ add_to_thread_list (bfd *abfd, asection @@ -274,6 +277,52 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = ptid; /* Yes, make it current. */ inferior_ptid = ptid; /* Yes, make it current. */
} }
@ -65,20 +65,22 @@ Index: gdb-7.4.50.20120602/gdb/corelow.c
/* This routine opens and sets up the core file bfd. */ /* This routine opens and sets up the core file bfd. */
static void static void
@@ -377,6 +426,12 @@ core_open (char *filename, int from_tty) @@ -418,6 +467,14 @@ core_open (char *filename, int from_tty)
push_target (&core_ops); switch_to_thread (thread->ptid);
discard_cleanups (old_chain); }
+ /* Find the build_id identifiers. If it gets executed after + /* Find the build_id identifiers. If it gets executed after
+ POST_CREATE_INFERIOR we would clash with asking to discard the already + POST_CREATE_INFERIOR we would clash with asking to discard the already
+ loaded VDSO symbols. */ + loaded VDSO symbols. If it gets executed before bfd_map_over_sections
+ INFERIOR_PTID is still not set and libthread_db initialization crashes on
+ PID == 0 in ps_pglobal_lookup. */
+ if (build_id_core_loads != 0) + if (build_id_core_loads != 0)
+ build_id_locate_exec (from_tty); + build_id_locate_exec (from_tty);
+ +
/* Do this before acknowledging the inferior, so if post_create_inferior (&core_ops, from_tty);
post_create_inferior throws (can happen easilly if you're loading
a core file with the wrong exec), we aren't left with threads /* Now go through the target stack looking for threads since there
@@ -935,4 +990,11 @@ _initialize_corelow (void) @@ -939,4 +996,11 @@ _initialize_corelow (void)
init_core_ops (); init_core_ops ();
add_target (&core_ops); add_target (&core_ops);
@ -86,15 +88,15 @@ Index: gdb-7.4.50.20120602/gdb/corelow.c
+ add_setshow_boolean_cmd ("build-id-core-loads", class_files, + add_setshow_boolean_cmd ("build-id-core-loads", class_files,
+ &build_id_core_loads, _("\ + &build_id_core_loads, _("\
+Set whether CORE-FILE loads the build-id associated files automatically."), _("\ +Set whether CORE-FILE loads the build-id associated files automatically."), _("\
+Show whether CORE-FILE loads the build-id associated files automatically.."), +Show whether CORE-FILE loads the build-id associated files automatically."),
+ NULL, NULL, NULL, + NULL, NULL, NULL,
+ &setlist, &showlist); + &setlist, &showlist);
} }
Index: gdb-7.4.50.20120602/gdb/doc/gdb.texinfo Index: gdb-7.4.91.20120801/gdb/doc/gdb.texinfo
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/doc/gdb.texinfo 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.91.20120801.orig/gdb/doc/gdb.texinfo 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/doc/gdb.texinfo 2012-06-02 21:07:16.480246563 +0200 +++ gdb-7.4.91.20120801/gdb/doc/gdb.texinfo 2012-08-01 18:37:44.598925672 +0200
@@ -16502,6 +16502,27 @@ information files. @@ -16530,6 +16530,27 @@ information files.
@end table @end table
@ -122,11 +124,11 @@ Index: gdb-7.4.50.20120602/gdb/doc/gdb.texinfo
@cindex @code{.gnu_debuglink} sections @cindex @code{.gnu_debuglink} sections
@cindex debug link sections @cindex debug link sections
A debug link is a special section of the executable file named A debug link is a special section of the executable file named
Index: gdb-7.4.50.20120602/gdb/solib-svr4.c Index: gdb-7.4.91.20120801/gdb/solib-svr4.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solib-svr4.c 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.91.20120801.orig/gdb/solib-svr4.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/solib-svr4.c 2012-06-02 21:07:16.510246552 +0200 +++ gdb-7.4.91.20120801/gdb/solib-svr4.c 2012-08-01 18:37:44.599925667 +0200
@@ -1227,9 +1227,52 @@ svr4_read_so_list (CORE_ADDR lm, struct @@ -1228,9 +1228,52 @@ svr4_read_so_list (CORE_ADDR lm, struct
continue; continue;
} }
@ -182,14 +184,14 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
xfree (buffer); xfree (buffer);
/* If this entry has no name, or its name matches the name /* If this entry has no name, or its name matches the name
Index: gdb-7.4.50.20120602/gdb/elfread.c Index: gdb-7.4.91.20120801/gdb/elfread.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/elfread.c 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.91.20120801.orig/gdb/elfread.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/elfread.c 2012-06-02 21:07:56.264232049 +0200 +++ gdb-7.4.91.20120801/gdb/elfread.c 2012-08-01 18:38:08.956790879 +0200
@@ -44,6 +44,11 @@ @@ -45,6 +45,11 @@
#include "gdbthread.h"
#include "regcache.h" #include "regcache.h"
#include "bcache.h" #include "bcache.h"
#include "gdb_bfd.h"
+#include "libbfd.h" +#include "libbfd.h"
+#include "gdbcore.h" +#include "gdbcore.h"
+#include "gdbcmd.h" +#include "gdbcmd.h"
@ -198,7 +200,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
extern void _initialize_elfread (void); extern void _initialize_elfread (void);
@@ -1072,16 +1077,65 @@ elf_gnu_ifunc_resolver_return_stop (stru @@ -1074,16 +1079,65 @@ elf_gnu_ifunc_resolver_return_stop (stru
update_breakpoint_locations (b, sals, sals_end); update_breakpoint_locations (b, sals, sals_end);
} }
@ -266,7 +268,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
{ {
struct build_id *retval; struct build_id *retval;
@@ -1097,6 +1151,348 @@ build_id_bfd_get (bfd *abfd) @@ -1099,6 +1153,348 @@ build_id_bfd_get (bfd *abfd)
return retval; return retval;
} }
@ -615,7 +617,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
/* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */ /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */
static int static int
@@ -1111,7 +1507,7 @@ build_id_verify (const char *filename, s @@ -1113,7 +1509,7 @@ build_id_verify (const char *filename, s
if (abfd == NULL) if (abfd == NULL)
return 0; return 0;
@ -624,7 +626,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
if (found == NULL) if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"), filename); warning (_("File \"%s\" has no build-id, file skipped"), filename);
@@ -1129,17 +1525,18 @@ build_id_verify (const char *filename, s @@ -1131,17 +1527,18 @@ build_id_verify (const char *filename, s
return retval; return retval;
} }
@ -647,7 +649,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */ cause "/.build-id/..." lookups. */
@@ -1152,6 +1549,8 @@ build_id_to_debug_filename (struct build @@ -1154,6 +1551,8 @@ build_id_to_debug_filename (struct build
size_t debugdir_len = strlen (debugdir); size_t debugdir_len = strlen (debugdir);
gdb_byte *data = build_id->data; gdb_byte *data = build_id->data;
size_t size = build_id->size; size_t size = build_id->size;
@ -656,7 +658,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
char *s; char *s;
memcpy (link, debugdir, debugdir_len); memcpy (link, debugdir, debugdir_len);
@@ -1166,37 +1565,240 @@ build_id_to_debug_filename (struct build @@ -1168,37 +1567,240 @@ build_id_to_debug_filename (struct build
*s++ = '/'; *s++ = '/';
while (size-- > 0) while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++); s += sprintf (s, "%02x", (unsigned) *data++);
@ -908,7 +910,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
xfree (build_id); xfree (build_id);
/* Prevent looping on a stripped .debug file. */ /* Prevent looping on a stripped .debug file. */
if (build_id_name != NULL if (build_id_name != NULL
@@ -1207,7 +1809,7 @@ find_separate_debug_file_by_buildid (str @@ -1209,7 +1811,7 @@ find_separate_debug_file_by_buildid (str
xfree (build_id_name); xfree (build_id_name);
} }
else if (build_id_name != NULL) else if (build_id_name != NULL)
@ -917,7 +919,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
} }
return NULL; return NULL;
} }
@@ -1427,9 +2029,10 @@ elf_symfile_read (struct objfile *objfil @@ -1436,9 +2038,10 @@ elf_symfile_read (struct objfile *objfil
`.note.gnu.build-id'. */ `.note.gnu.build-id'. */
else if (!objfile_has_partial_symbols (objfile)) else if (!objfile_has_partial_symbols (objfile))
{ {
@ -930,9 +932,9 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
if (debugfile == NULL) if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile); debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1441,6 +2044,12 @@ elf_symfile_read (struct objfile *objfil @@ -1452,6 +2055,12 @@ elf_symfile_read (struct objfile *objfil
symbol_file_add_separate (abfd, symfile_flags, objfile); symbol_file_add_separate (abfd, symfile_flags, objfile);
xfree (debugfile); do_cleanups (cleanup);
} }
+ /* Check if any separate debug info has been extracted out. */ + /* Check if any separate debug info has been extracted out. */
+ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink") + else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink")
@ -941,9 +943,9 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
+ +
+ xfree (build_id_filename); + xfree (build_id_filename);
} }
}
@@ -1770,4 +2379,16 @@ _initialize_elfread (void) if (symtab_create_debug)
@@ -1784,4 +2393,16 @@ _initialize_elfread (void)
elf_objfile_gnu_ifunc_cache_data = register_objfile_data (); elf_objfile_gnu_ifunc_cache_data = register_objfile_data ();
gnu_ifunc_fns_p = &elf_gnu_ifunc_fns; gnu_ifunc_fns_p = &elf_gnu_ifunc_fns;
@ -960,10 +962,10 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
+ +
+ observer_attach_executable_changed (debug_print_executable_changed); + observer_attach_executable_changed (debug_print_executable_changed);
} }
Index: gdb-7.4.50.20120602/gdb/symfile.h Index: gdb-7.4.91.20120801/gdb/symfile.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/symfile.h 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.91.20120801.orig/gdb/symfile.h 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/symfile.h 2012-06-02 21:07:16.524246547 +0200 +++ gdb-7.4.91.20120801/gdb/symfile.h 2012-08-01 18:37:44.600925662 +0200
@@ -615,6 +615,13 @@ void free_symfile_segment_data (struct s @@ -615,6 +615,13 @@ void free_symfile_segment_data (struct s
extern struct cleanup *increment_reading_symtab (void); extern struct cleanup *increment_reading_symtab (void);
@ -978,10 +980,10 @@ Index: gdb-7.4.50.20120602/gdb/symfile.h
/* From dwarf2read.c */ /* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal /* Names for a dwarf2 debugging section. The field NORMAL is the normal
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp Index: gdb-7.4.91.20120801/gdb/testsuite/lib/gdb.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/gdb.exp 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.91.20120801.orig/gdb/testsuite/lib/gdb.exp 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp 2012-06-02 21:07:16.526246546 +0200 +++ gdb-7.4.91.20120801/gdb/testsuite/lib/gdb.exp 2012-08-01 18:37:44.601925656 +0200
@@ -1388,6 +1388,16 @@ proc default_gdb_start { } { @@ -1388,6 +1388,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0." warning "Couldn't set the width to 0."
} }
@ -999,10 +1001,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp
return 0; return 0;
} }
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp Index: gdb-7.4.91.20120801/gdb/testsuite/lib/mi-support.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/mi-support.exp 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.91.20120801.orig/gdb/testsuite/lib/mi-support.exp 2012-07-25 22:35:30.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp 2012-06-02 21:07:16.535246544 +0200 +++ gdb-7.4.91.20120801/gdb/testsuite/lib/mi-support.exp 2012-08-01 18:37:44.601925656 +0200
@@ -213,6 +213,16 @@ proc default_mi_gdb_start { args } { @@ -213,6 +213,16 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0." warning "Couldn't set the width to 0."
} }
@ -1020,10 +1022,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp
# If allowing the inferior to have its own PTY then assign the inferior # If allowing the inferior to have its own PTY then assign the inferior
# its own terminal device here. # its own terminal device here.
if { $separate_inferior_pty } { if { $separate_inferior_pty } {
Index: gdb-7.4.50.20120602/gdb/objfiles.h Index: gdb-7.4.91.20120801/gdb/objfiles.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/objfiles.h 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.91.20120801.orig/gdb/objfiles.h 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/objfiles.h 2012-06-02 21:07:16.539246541 +0200 +++ gdb-7.4.91.20120801/gdb/objfiles.h 2012-08-01 18:37:44.601925656 +0200
@@ -432,6 +432,10 @@ struct objfile @@ -432,6 +432,10 @@ struct objfile
#define OBJF_MAINLINE (1 << 5) #define OBJF_MAINLINE (1 << 5)
@ -1035,3 +1037,41 @@ Index: gdb-7.4.50.20120602/gdb/objfiles.h
/* The object file that contains the runtime common minimal symbols /* The object file that contains the runtime common minimal symbols
for SunOS4. Note that this objfile has no associated BFD. */ for SunOS4. Note that this objfile has no associated BFD. */
Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.base/corefile.exp
===================================================================
--- gdb-7.4.91.20120801.orig/gdb/testsuite/gdb.base/corefile.exp 2012-06-21 22:46:21.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.base/corefile.exp 2012-08-01 18:37:44.602925650 +0200
@@ -256,3 +256,33 @@ if ![is_remote target] {
gdb_exit
}
+
+
+# Test auto-loading of binary files through build-id from the core file.
+set buildid [build_id_debug_filename_get $binfile]
+set wholetest "binfile found by build-id"
+if {$buildid == ""} {
+ untested "$wholetest (binary has no build-id)"
+} else {
+ gdb_exit
+ gdb_start
+
+ regsub {\.debug$} $buildid {} buildid
+ set debugdir ${objdir}/${subdir}/${testfile}-debugdir
+ file delete -force -- $debugdir
+ file mkdir $debugdir/[file dirname $buildid]
+ file copy $binfile $debugdir/$buildid
+
+ set test "show debug-file-directory"
+ gdb_test_multiple $test $test {
+ -re "The directory where separate debug symbols are searched for is \"(.*)\"\\.\r\n$gdb_prompt $" {
+ set debugdir_orig $expect_out(1,string)
+ pass $test
+ }
+ }
+ gdb_test_no_output "set debug-file-directory $debugdir:$debugdir_orig" "set debug-file-directory"
+ gdb_test "show build-id-core-loads" {Whether CORE-FILE loads the build-id associated files automatically is on\.}
+ gdb_test "core-file $corefile" "\r\nProgram terminated with .*" "core-file without executable"
+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
+ pass $wholetest
+}

View File

@ -1,8 +1,8 @@
Index: gdb-7.3.50.20110722/gdb/infrun.c Index: gdb-7.4.50.20120703/gdb/infrun.c
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/infrun.c 2011-07-22 19:12:56.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/infrun.c 2012-07-03 20:26:25.060940765 +0200
+++ gdb-7.3.50.20110722/gdb/infrun.c 2011-07-22 19:17:06.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/infrun.c 2012-07-03 20:26:32.808929860 +0200
@@ -1549,7 +1549,7 @@ static const char *scheduler_enums[] = { @@ -1591,7 +1591,7 @@ static const char *const scheduler_enums
schedlock_step, schedlock_step,
NULL NULL
}; };
@ -11,11 +11,11 @@ Index: gdb-7.3.50.20110722/gdb/infrun.c
static void static void
show_scheduler_mode (struct ui_file *file, int from_tty, show_scheduler_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-console.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi-console.exp 2011-01-01 16:33:47.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-console.exp 2012-07-03 20:26:25.060940765 +0200
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-console.exp 2011-07-22 19:17:06.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp 2012-07-03 20:26:32.809929858 +0200
@@ -47,6 +47,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ @@ -46,6 +46,9 @@ if { [gdb_compile "${srcdir}/${subdir}/
mi_run_to_main mi_run_to_main
@ -25,11 +25,11 @@ Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-console.exp
# Next over the hello() call which will produce lots of output # Next over the hello() call which will produce lots of output
mi_gdb_test "220-exec-next" \ mi_gdb_test "220-exec-next" \
"220\\^running(\r\n\\*running,thread-id=\"all\")?" \ "220\\^running(\r\n\\*running,thread-id=\"all\")?" \
Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-console.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi2-console.exp
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi2-console.exp 2011-06-23 11:40:50.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi2-console.exp 2012-07-03 20:26:25.060940765 +0200
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-console.exp 2011-07-22 19:17:27.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi2-console.exp 2012-07-03 20:26:32.809929858 +0200
@@ -47,6 +47,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ @@ -46,6 +46,9 @@ if { [gdb_compile "${srcdir}/${subdir}/
mi_run_to_main mi_run_to_main
@ -39,11 +39,11 @@ Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-console.exp
# Next over the hello() call which will produce lots of output # Next over the hello() call which will produce lots of output
mi_gdb_test "220-exec-next" "220\\^running(\r\n)?(\\*running,thread-id=\"all\")?" \ mi_gdb_test "220-exec-next" "220\\^running(\r\n)?(\\*running,thread-id=\"all\")?" \
"Started step over hello" "Started step over hello"
Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-cli.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-cli.exp
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2011-04-27 12:17:38.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2012-07-03 20:26:25.060940765 +0200
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-cli.exp 2011-07-22 19:17:06.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-cli.exp 2012-07-03 20:26:32.810929856 +0200
@@ -176,7 +176,7 @@ mi_execute_to "exec-continue" "breakpoin @@ -175,7 +175,7 @@ mi_execute_to "exec-continue" "breakpoin
# Test that the token is output even for CLI commands # Test that the token is output even for CLI commands
# Also test that *stopped includes frame information. # Also test that *stopped includes frame information.
mi_gdb_test "34 next" \ mi_gdb_test "34 next" \
@ -52,3 +52,25 @@ Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-cli.exp
"34 next: run" "34 next: run"
if {!$async} { if {!$async} {
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-logging.exp
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2012-06-29 00:11:23.000000000 +0200
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-logging.exp 2012-07-03 20:29:03.573717651 +0200
@@ -56,7 +56,7 @@ close $chan
set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
-if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
+if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
pass "Log file contents"
} else {
fail "Log file contents"
@@ -79,7 +79,7 @@ set chan [open $milogfile]
set logcontent [read $chan]
close $chan
-if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
+if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
pass "Redirect log file contents"
} else {
fail "Redirect log file contents"

View File

@ -21,10 +21,10 @@
Port to GDB-6.8pre. Port to GDB-6.8pre.
Index: gdb-7.4.50.20120602/gdb/inferior.h Index: gdb-7.4.50.20120714/gdb/inferior.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/inferior.h 2012-05-24 18:39:09.000000000 +0200 --- gdb-7.4.50.20120714.orig/gdb/inferior.h 2012-06-13 20:15:05.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/inferior.h 2012-06-02 18:24:12.875274179 +0200 +++ gdb-7.4.50.20120714/gdb/inferior.h 2012-07-14 23:21:01.795161794 +0200
@@ -159,7 +159,15 @@ extern void reopen_exec_file (void); @@ -159,7 +159,15 @@ extern void reopen_exec_file (void);
/* The `resume' routine should only be called in special circumstances. /* The `resume' routine should only be called in special circumstances.
Normally, use `proceed', which handles a lot of bookkeeping. */ Normally, use `proceed', which handles a lot of bookkeeping. */
@ -42,10 +42,10 @@ Index: gdb-7.4.50.20120602/gdb/inferior.h
extern ptid_t user_visible_resume_ptid (int step); extern ptid_t user_visible_resume_ptid (int step);
Index: gdb-7.4.50.20120602/gdb/infrun.c Index: gdb-7.4.50.20120714/gdb/infrun.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/infrun.c 2012-05-28 22:43:26.000000000 +0200 --- gdb-7.4.50.20120714.orig/gdb/infrun.c 2012-07-01 12:37:04.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/infrun.c 2012-06-02 18:23:59.339278268 +0200 +++ gdb-7.4.50.20120714/gdb/infrun.c 2012-07-14 23:21:01.800161767 +0200
@@ -79,7 +79,7 @@ static int follow_fork (void); @@ -79,7 +79,7 @@ static int follow_fork (void);
static void set_schedlock_func (char *args, int from_tty, static void set_schedlock_func (char *args, int from_tty,
struct cmd_list_element *c); struct cmd_list_element *c);
@ -55,7 +55,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
static int currently_stepping_or_nexting_callback (struct thread_info *tp, static int currently_stepping_or_nexting_callback (struct thread_info *tp,
void *data); void *data);
@@ -1687,7 +1687,8 @@ user_visible_resume_ptid (int step) @@ -1672,7 +1672,8 @@ user_visible_resume_ptid (int step)
} }
else if ((scheduler_mode == schedlock_on) else if ((scheduler_mode == schedlock_on)
|| (scheduler_mode == schedlock_step || (scheduler_mode == schedlock_step
@ -65,7 +65,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
{ {
/* User-settable 'scheduler' mode requires solo thread resume. */ /* User-settable 'scheduler' mode requires solo thread resume. */
resume_ptid = inferior_ptid; resume_ptid = inferior_ptid;
@@ -1705,7 +1706,7 @@ user_visible_resume_ptid (int step) @@ -1690,7 +1691,7 @@ user_visible_resume_ptid (int step)
STEP nonzero if we should step (zero to continue instead). STEP nonzero if we should step (zero to continue instead).
SIG is the signal to give the inferior (zero for none). */ SIG is the signal to give the inferior (zero for none). */
void void
@ -74,7 +74,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
{ {
int should_resume = 1; int should_resume = 1;
struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0); struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
@@ -1738,9 +1739,13 @@ resume (int step, enum gdb_signal sig) @@ -1723,9 +1724,13 @@ resume (int step, enum gdb_signal sig)
if (debug_infrun) if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
@ -90,7 +90,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
target_pid_to_str (inferior_ptid), target_pid_to_str (inferior_ptid),
paddress (gdbarch, pc)); paddress (gdbarch, pc));
@@ -2117,7 +2122,7 @@ proceed (CORE_ADDR addr, enum gdb_signal @@ -2102,7 +2107,7 @@ proceed (CORE_ADDR addr, enum gdb_signal
struct thread_info *tp; struct thread_info *tp;
CORE_ADDR pc; CORE_ADDR pc;
struct address_space *aspace; struct address_space *aspace;
@ -99,7 +99,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
/* If we're stopped at a fork/vfork, follow the branch set by the /* If we're stopped at a fork/vfork, follow the branch set by the
"set follow-fork-mode" command; otherwise, we'll just proceed "set follow-fork-mode" command; otherwise, we'll just proceed
@@ -2157,13 +2162,13 @@ proceed (CORE_ADDR addr, enum gdb_signal @@ -2142,13 +2147,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
actually be executing the breakpoint insn anyway. actually be executing the breakpoint insn anyway.
We'll be (un-)executing the previous instruction. */ We'll be (un-)executing the previous instruction. */
@ -115,7 +115,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
} }
else else
{ {
@@ -2194,13 +2199,13 @@ proceed (CORE_ADDR addr, enum gdb_signal @@ -2179,13 +2184,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
is required it returns TRUE and sets the current thread to is required it returns TRUE and sets the current thread to
the old thread. */ the old thread. */
if (prepare_to_proceed (step)) if (prepare_to_proceed (step))
@ -131,7 +131,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
{ {
tp->control.trap_expected = 1; tp->control.trap_expected = 1;
/* If displaced stepping is enabled, we can step over the /* If displaced stepping is enabled, we can step over the
@@ -2287,8 +2292,13 @@ proceed (CORE_ADDR addr, enum gdb_signal @@ -2272,8 +2277,13 @@ proceed (CORE_ADDR addr, enum gdb_signal
/* Reset to normal state. */ /* Reset to normal state. */
init_infwait_state (); init_infwait_state ();
@ -146,7 +146,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
/* Wait for it to stop (if not standalone) /* Wait for it to stop (if not standalone)
and in any case decode why it stopped, and act accordingly. */ and in any case decode why it stopped, and act accordingly. */
@@ -5249,13 +5259,18 @@ process_event_stop_test: @@ -5205,13 +5215,18 @@ process_event_stop_test:
/* Is thread TP in the middle of single-stepping? */ /* Is thread TP in the middle of single-stepping? */
@ -170,11 +170,11 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
} }
/* Returns true if any thread *but* the one passed in "data" is in the /* Returns true if any thread *but* the one passed in "data" is in the
Index: gdb-7.4.50.20120602/gdb/linux-nat.c Index: gdb-7.4.50.20120714/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.c 2012-05-24 18:51:34.000000000 +0200 --- gdb-7.4.50.20120714.orig/gdb/linux-nat.c 2012-07-07 14:13:56.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.c 2012-06-02 18:23:07.409293800 +0200 +++ gdb-7.4.50.20120714/gdb/linux-nat.c 2012-07-14 23:21:01.803161750 +0200
@@ -3051,7 +3051,11 @@ static int @@ -2982,7 +2982,11 @@ static int
select_singlestep_lwp_callback (struct lwp_info *lp, void *data) select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
{ {
if (lp->last_resume_kind == resume_step if (lp->last_resume_kind == resume_step
@ -187,10 +187,10 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
return 1; return 1;
else else
return 0; return 0;
Index: gdb-7.4.50.20120602/gdb/linux-nat.h Index: gdb-7.4.50.20120714/gdb/linux-nat.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.h 2012-03-21 14:43:54.000000000 +0100 --- gdb-7.4.50.20120714.orig/gdb/linux-nat.h 2012-07-06 18:52:20.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.h 2012-06-02 18:23:07.411293798 +0200 +++ gdb-7.4.50.20120714/gdb/linux-nat.h 2012-07-14 23:21:17.414075355 +0200
@@ -73,8 +73,8 @@ struct lwp_info @@ -73,8 +73,8 @@ struct lwp_info
/* If non-zero, a pending wait status. */ /* If non-zero, a pending wait status. */
int status; int status;
@ -200,5 +200,5 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.h
+ /* The kind of stepping of this LWP. */ + /* The kind of stepping of this LWP. */
+ enum resume_step step; + enum resume_step step;
/* Non-zero si_signo if this LWP stopped with a trap. si_addr may /* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data
be the address of a hardware watchpoint. */ watchpoint trap. */

View File

@ -1,8 +1,8 @@
Index: gdb-7.3.50.20110722/gdb/dwarf2read.c Index: gdb-7.4.50.20120703/gdb/gdb_bfd.c
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/dwarf2read.c 2011-07-22 19:37:15.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/gdb_bfd.c 2012-07-03 17:30:07.356754655 +0200
+++ gdb-7.3.50.20110722/gdb/dwarf2read.c 2011-07-22 19:44:42.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/gdb_bfd.c 2012-07-03 17:43:52.565762454 +0200
@@ -67,12 +67,14 @@ @@ -26,12 +26,14 @@
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
#include <zlib.h> #include <zlib.h>
#endif #endif
@ -15,37 +15,37 @@ Index: gdb-7.3.50.20110722/gdb/dwarf2read.c
#endif #endif
+#endif +#endif
typedef struct symbol *symbolp; /* An object of this type is stored in the section's user data when
DEF_VEC_P (symbolp); mapping a section. */
@@ -1618,6 +1620,7 @@ dwarf2_read_section (struct objfile *obj @@ -181,6 +183,7 @@ free_one_bfd_section (bfd *abfd, asectio
if (sect != NULL && sect->data != NULL)
{
+#ifndef __sparc__
#ifdef HAVE_MMAP
if (sect->map_addr != NULL)
{
@@ -191,6 +194,7 @@ free_one_bfd_section (bfd *abfd, asectio
}
else
#endif
+#endif
xfree (sect->data);
}
}
@@ -425,6 +429,7 @@ gdb_bfd_map_section (asection *sectp, bf
} }
} }
+#ifndef __sparc__ +#ifndef __sparc__
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
if (pagesize == 0) {
pagesize = getpagesize (); /* The page size, used when mmapping. */
@@ -1641,6 +1644,7 @@ dwarf2_read_section (struct objfile *obj @@ -458,6 +463,7 @@ gdb_bfd_map_section (asection *sectp, bf
} }
} }
#endif #endif /* HAVE_MMAP */
+#endif +#endif
/* If we get here, we are a normal, not-compressed section. */ /* If we get here, we are a normal, not-compressed section. */
info->buffer = buf
@@ -15983,6 +15987,7 @@ munmap_section_buffer (struct dwarf2_sec
{
if (info->map_addr != NULL)
{
+#ifndef __sparc__
#ifdef HAVE_MMAP
int res;
@@ -15992,6 +15997,7 @@ munmap_section_buffer (struct dwarf2_sec
/* Without HAVE_MMAP, we should never be here to begin with. */
gdb_assert_not_reached ("no mmap support");
#endif
+#endif
}
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1ab4776fcd213e101553e81c6b0ce033d624cbe1b5ad322203a61bdaab8a3e09
size 22315415

3
gdb-7.5.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:070b808d289fa8f0291738eeaccc0cd7700d476998781f572856155240d29d20
size 21349391

File diff suppressed because it is too large Load Diff

View File

@ -37,13 +37,13 @@ gdb/gdbserver/
(linux_create_inferior, linux_tracefork_child): Call it instead of (linux_create_inferior, linux_tracefork_child): Call it instead of
direct ptrace. direct ptrace.
Index: gdb-7.4.50.20120602/gdb/common/linux-ptrace.c Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/common/linux-ptrace.c 2012-03-13 16:02:23.000000000 +0100 --- gdb-7.5.0.20120926.orig/gdb/common/linux-ptrace.c 2012-09-17 20:28:14.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/common/linux-ptrace.c 2012-06-02 20:37:53.933828570 +0200 +++ gdb-7.5.0.20120926/gdb/common/linux-ptrace.c 2012-09-26 19:13:53.508780239 +0200
@@ -27,6 +27,10 @@ @@ -28,6 +28,10 @@
#include "linux-procfs.h"
#include "buffer.h" #include "buffer.h"
#include "gdb_assert.h"
+#ifdef HAVE_SELINUX_SELINUX_H +#ifdef HAVE_SELINUX_SELINUX_H
+# include <selinux/selinux.h> +# include <selinux/selinux.h>
@ -52,13 +52,19 @@ Index: gdb-7.4.50.20120602/gdb/common/linux-ptrace.c
/* Find all possible reasons we could fail to attach PID and append these /* Find all possible reasons we could fail to attach PID and append these
newline terminated reason strings to initialized BUFFER. '\0' termination newline terminated reason strings to initialized BUFFER. '\0' termination
of BUFFER must be done by the caller. */ of BUFFER must be done by the caller. */
@@ -46,4 +50,22 @@ linux_ptrace_attach_warnings (pid_t pid, @@ -47,6 +51,8 @@ linux_ptrace_attach_warnings (pid_t pid,
buffer_xml_printf (buffer, _("warning: process %d is a zombie " buffer_xml_printf (buffer, _("warning: process %d is a zombie "
"- the process has already terminated\n"), "- the process has already terminated\n"),
(int) pid); (int) pid);
+ +
+ linux_ptrace_create_warnings (buffer); + linux_ptrace_create_warnings (buffer);
+} }
#if defined __i386__ || defined __x86_64__
@@ -242,3 +248,19 @@ linux_ptrace_init_warnings (void)
linux_ptrace_test_ret_to_nx ();
}
+ +
+/* Print all possible reasons we could fail to create a traced process. */ +/* Print all possible reasons we could fail to create a traced process. */
+ +
@ -74,23 +80,23 @@ Index: gdb-7.4.50.20120602/gdb/common/linux-ptrace.c
+ "you can disable this process attach protection by: " + "you can disable this process attach protection by: "
+ "(gdb) shell sudo setsebool deny_ptrace=0")); + "(gdb) shell sudo setsebool deny_ptrace=0"));
+#endif /* HAVE_LIBSELINUX */ +#endif /* HAVE_LIBSELINUX */
} +}
Index: gdb-7.4.50.20120602/gdb/common/linux-ptrace.h Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/common/linux-ptrace.h 2012-03-13 16:02:23.000000000 +0100 --- gdb-7.5.0.20120926.orig/gdb/common/linux-ptrace.h 2012-07-07 14:13:56.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/common/linux-ptrace.h 2012-06-02 20:37:46.565831956 +0200 +++ gdb-7.5.0.20120926/gdb/common/linux-ptrace.h 2012-09-26 19:13:28.358765406 +0200
@@ -68,5 +68,6 @@ struct buffer; @@ -69,5 +69,6 @@ struct buffer;
#endif
extern void linux_ptrace_attach_warnings (pid_t pid, struct buffer *buffer); extern void linux_ptrace_attach_warnings (pid_t pid, struct buffer *buffer);
extern void linux_ptrace_init_warnings (void);
+extern void linux_ptrace_create_warnings (struct buffer *buffer); +extern void linux_ptrace_create_warnings (struct buffer *buffer);
#endif /* COMMON_LINUX_PTRACE_H */ #endif /* COMMON_LINUX_PTRACE_H */
Index: gdb-7.4.50.20120602/gdb/configure.ac Index: gdb-7.5.0.20120926/gdb/configure.ac
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/configure.ac 2012-06-02 20:05:08.000000000 +0200 --- gdb-7.5.0.20120926.orig/gdb/configure.ac 2012-09-26 19:13:24.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/configure.ac 2012-06-02 20:35:06.379798726 +0200 +++ gdb-7.5.0.20120926/gdb/configure.ac 2012-09-26 19:13:28.410765451 +0200
@@ -2002,6 +2002,10 @@ then @@ -2008,6 +2008,10 @@ then
[Define if you support the personality syscall.]) [Define if you support the personality syscall.])
fi fi
@ -101,10 +107,10 @@ Index: gdb-7.4.50.20120602/gdb/configure.ac
dnl Handle optional features that can be enabled. dnl Handle optional features that can be enabled.
# Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR,
Index: gdb-7.4.50.20120602/gdb/gdbserver/configure.ac Index: gdb-7.5.0.20120926/gdb/gdbserver/configure.ac
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/gdbserver/configure.ac 2012-04-19 21:34:51.000000000 +0200 --- gdb-7.5.0.20120926.orig/gdb/gdbserver/configure.ac 2012-04-19 21:34:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/gdbserver/configure.ac 2012-06-02 20:35:06.408797663 +0200 +++ gdb-7.5.0.20120926/gdb/gdbserver/configure.ac 2012-09-26 19:13:28.446765428 +0200
@@ -438,6 +438,10 @@ if $want_ipa ; then @@ -438,6 +438,10 @@ if $want_ipa ; then
fi fi
fi fi
@ -116,10 +122,10 @@ Index: gdb-7.4.50.20120602/gdb/gdbserver/configure.ac
AC_SUBST(GDBSERVER_DEPFILES) AC_SUBST(GDBSERVER_DEPFILES)
AC_SUBST(GDBSERVER_LIBS) AC_SUBST(GDBSERVER_LIBS)
AC_SUBST(USE_THREAD_DB) AC_SUBST(USE_THREAD_DB)
Index: gdb-7.4.50.20120602/gdb/gdbserver/linux-low.c Index: gdb-7.5.0.20120926/gdb/gdbserver/linux-low.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/gdbserver/linux-low.c 2012-05-30 21:51:38.000000000 +0200 --- gdb-7.5.0.20120926.orig/gdb/gdbserver/linux-low.c 2012-07-07 14:13:57.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/gdbserver/linux-low.c 2012-06-02 20:39:49.886785355 +0200 +++ gdb-7.5.0.20120926/gdb/gdbserver/linux-low.c 2012-09-26 19:13:28.453765471 +0200
@@ -601,6 +601,28 @@ add_lwp (ptid_t ptid) @@ -601,6 +601,28 @@ add_lwp (ptid_t ptid)
return lwp; return lwp;
} }
@ -158,7 +164,7 @@ Index: gdb-7.4.50.20120602/gdb/gdbserver/linux-low.c
#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */ #ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */
signal (__SIGRTMIN + 1, SIG_DFL); signal (__SIGRTMIN + 1, SIG_DFL);
@@ -4567,7 +4589,7 @@ linux_tracefork_grandchild (void *arg) @@ -4572,7 +4594,7 @@ linux_tracefork_grandchild (void *arg)
static int static int
linux_tracefork_child (void *arg) linux_tracefork_child (void *arg)
{ {
@ -167,10 +173,10 @@ Index: gdb-7.4.50.20120602/gdb/gdbserver/linux-low.c
kill (getpid (), SIGSTOP); kill (getpid (), SIGSTOP);
#if !(defined(__UCLIBC__) && defined(HAS_NOMMU)) #if !(defined(__UCLIBC__) && defined(HAS_NOMMU))
Index: gdb-7.4.50.20120602/gdb/inf-ptrace.c Index: gdb-7.5.0.20120926/gdb/inf-ptrace.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/inf-ptrace.c 2012-05-24 18:51:34.000000000 +0200 --- gdb-7.5.0.20120926.orig/gdb/inf-ptrace.c 2012-05-24 18:51:34.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/inf-ptrace.c 2012-06-02 20:35:06.428797311 +0200 +++ gdb-7.5.0.20120926/gdb/inf-ptrace.c 2012-09-26 19:13:28.458765461 +0200
@@ -105,7 +105,15 @@ static void @@ -105,7 +105,15 @@ static void
inf_ptrace_me (void) inf_ptrace_me (void)
{ {
@ -187,11 +193,11 @@ Index: gdb-7.4.50.20120602/gdb/inf-ptrace.c
} }
/* Start a new inferior Unix child process. EXEC_FILE is the file to /* Start a new inferior Unix child process. EXEC_FILE is the file to
Index: gdb-7.4.50.20120602/gdb/linux-nat.c Index: gdb-7.5.0.20120926/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.c 2012-06-02 20:01:38.000000000 +0200 --- gdb-7.5.0.20120926.orig/gdb/linux-nat.c 2012-09-26 19:13:22.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.c 2012-06-02 20:41:18.101751186 +0200 +++ gdb-7.5.0.20120926/gdb/linux-nat.c 2012-09-26 19:13:28.468765469 +0200
@@ -1572,6 +1572,7 @@ linux_nat_create_inferior (struct target @@ -1574,6 +1574,7 @@ linux_nat_create_inferior (struct target
#ifdef HAVE_PERSONALITY #ifdef HAVE_PERSONALITY
int personality_orig = 0, personality_set = 0; int personality_orig = 0, personality_set = 0;
#endif /* HAVE_PERSONALITY */ #endif /* HAVE_PERSONALITY */
@ -199,7 +205,7 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
/* The fork_child mechanism is synchronous and calls target_wait, so /* The fork_child mechanism is synchronous and calls target_wait, so
we have to mask the async mode. */ we have to mask the async mode. */
@@ -1596,7 +1597,10 @@ linux_nat_create_inferior (struct target @@ -1598,7 +1599,10 @@ linux_nat_create_inferior (struct target
/* Make sure we report all signals during startup. */ /* Make sure we report all signals during startup. */
linux_nat_pass_signals (0, NULL); linux_nat_pass_signals (0, NULL);
@ -211,7 +217,7 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
#ifdef HAVE_PERSONALITY #ifdef HAVE_PERSONALITY
if (personality_set) if (personality_set)
@@ -1608,6 +1612,24 @@ linux_nat_create_inferior (struct target @@ -1610,6 +1614,24 @@ linux_nat_create_inferior (struct target
safe_strerror (errno)); safe_strerror (errno));
} }
#endif /* HAVE_PERSONALITY */ #endif /* HAVE_PERSONALITY */

View File

@ -1,994 +0,0 @@
http://sourceware.org/ml/gdb-patches/2010-09/msg00360.html
Subject: [patch 3/4]#3 linux-nat: Do not respawn signals
Hi,
linux-nat.c is fixed to never respawn signals; possibly keeping SIGSTOP
pending, as is done in current in FSF gdbserver and as suggested by Pedro:
http://sourceware.org/ml/gdb-patches/2010-08/msg00544.html
The last linux-nat.c removed patch chunk comes from the initial implementation
by Mark Kettenis:
[PATCH] New Linux threads support
http://sourceware.org/ml/gdb-patches/2000-09/msg00020.html
92280a75e017683bf8e4f339f4f85640b0700509
It gets in part reimplemented into the new stop_wait_callback <if (lp->step)>
part and partially just not needed as currently GDB never drops the signals as
it does not PTRACE_CONT the thread; signal is kept for processing:
"RC: Not resuming sibling %s (has pending)\n"
In stop_wait_callback I believe breakpoints cancellation is not needed here,
it would be done later.
The testcase sigstep-threads.exp was written to catch a regression-like
appearance then the new <if (lp->step)> part of stop_wait_callback gets
removed. Still the tecase fails even with FSF HEAD:
32 var++; /* step-1 */
(gdb) step
Program received signal SIGUSR1, User defined signal 1.
Program received signal SIGUSR1, User defined signal 1.
31 { /* step-0 */
There is no reason why it shouldn't stop on line 33, between line 32 and line
33 no signal would occur. Stepping of the current thread should not be
affected by whatever happens in the other threads as select_event_lwp has:
/* Give preference to any LWP that is being single-stepped. */
There is a problem that with FSF HEAD GDB does PTRACE_SINGLESTEP for thread A,
PTRACE_CONT for thread B (because of set scheduler-locking off), thread B hits
SIGUSR1, so GDB tkills thread A with SIGSTOP and it can receive SIGSTOP for
thread A before the SIGTRAP for completed PTRACE_SINGLESTEP. At that moment
select_event_lwp. forgets it was stepping thread A because there is no pending
SIGTRAP event. currently_stepping still remembers thread A was stepping so it
will later stop but as thread A was PTRACE_CONT-ed in the meantime it is too
late.
There is the new <if (lp->step)> part of stop_wait_callback to always track
thread A is stepping. Due to different scheduling without this part the
changed GDB would very rarely stop in this testcase otherwise, making it look
as a regression.
I have some another patch I may post separately as if multiple signals happen
besides SIGTRAP GDB still may switch from thread A away (as not considering it
stepping) to thread B for SIGUSR and accidentally PTRACE_CONT thread A.
But I do not find this as a prerequisite for this patchset.
Thanks,
Jan
gdb/
2010-09-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-nat.c (stop_wait_callback): New gdb_assert. Remove signals
respawning; keep TP with SIGNALLED. New debugging message "SWC:
Delayed SIGSTOP caught for %s.". Catch next signal if SIGSTOP has
been caught and LP->STEP is set.
(linux_nat_wait_1) <lp && lp->signalled>: Remove.
gdb/testsuite/
2010-09-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.threads/siginfo-threads.exp: New file.
* gdb.threads/siginfo-threads.c: New file.
* gdb.threads/sigstep-threads.exp: New file.
* gdb.threads/sigstep-threads.c: New file.
Index: gdb-7.4.50.20120602/gdb/linux-nat.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.c 2012-06-02 21:34:51.999517510 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.c 2012-06-02 21:35:59.930491577 +0200
@@ -2856,6 +2856,8 @@ stop_wait_callback (struct lwp_info *lp,
{
int status;
+ gdb_assert (lp->resumed);
+
status = wait_lwp (lp);
if (status == 0)
return 0;
@@ -2881,110 +2883,61 @@ stop_wait_callback (struct lwp_info *lp,
if (WSTOPSIG (status) != SIGSTOP)
{
- if (linux_nat_status_is_event (status))
- {
- /* If a LWP other than the LWP that we're reporting an
- event for has hit a GDB breakpoint (as opposed to
- some random trap signal), then just arrange for it to
- hit it again later. We don't keep the SIGTRAP status
- and don't forward the SIGTRAP signal to the LWP. We
- will handle the current event, eventually we will
- resume all LWPs, and this one will get its breakpoint
- trap again.
-
- If we do not do this, then we run the risk that the
- user will delete or disable the breakpoint, but the
- thread will have already tripped on it. */
-
- /* Save the trap's siginfo in case we need it later. */
- save_siginfo (lp);
-
- save_sigtrap (lp);
-
- /* Now resume this LWP and get the SIGSTOP event. */
- errno = 0;
- ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
- if (debug_linux_nat)
- {
- fprintf_unfiltered (gdb_stdlog,
- "PTRACE_CONT %s, 0, 0 (%s)\n",
- target_pid_to_str (lp->ptid),
- errno ? safe_strerror (errno) : "OK");
-
- fprintf_unfiltered (gdb_stdlog,
- "SWC: Candidate SIGTRAP event in %s\n",
- target_pid_to_str (lp->ptid));
- }
- /* Hold this event/waitstatus while we check to see if
- there are any more (we still want to get that SIGSTOP). */
- stop_wait_callback (lp, NULL);
+ /* The thread was stopped with a signal other than SIGSTOP. */
- /* Hold the SIGTRAP for handling by linux_nat_wait. If
- there's another event, throw it back into the
- queue. */
- if (lp->status)
- {
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "SWC: kill %s, %s\n",
- target_pid_to_str (lp->ptid),
- status_to_str ((int) status));
- kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
- }
-
- /* Save the sigtrap event. */
- lp->status = status;
- return 0;
- }
- else
- {
- /* The thread was stopped with a signal other than
- SIGSTOP, and didn't accidentally trip a breakpoint. */
+ /* Save the trap's siginfo in case we need it later. */
+ save_siginfo (lp);
- if (debug_linux_nat)
- {
- fprintf_unfiltered (gdb_stdlog,
- "SWC: Pending event %s in %s\n",
- status_to_str ((int) status),
- target_pid_to_str (lp->ptid));
- }
- /* Now resume this LWP and get the SIGSTOP event. */
- errno = 0;
- ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "SWC: PTRACE_CONT %s, 0, 0 (%s)\n",
- target_pid_to_str (lp->ptid),
- errno ? safe_strerror (errno) : "OK");
+ save_sigtrap (lp);
- /* Hold this event/waitstatus while we check to see if
- there are any more (we still want to get that SIGSTOP). */
- stop_wait_callback (lp, NULL);
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "SWC: Pending event %s in %s\n",
+ status_to_str ((int) status),
+ target_pid_to_str (lp->ptid));
- /* If the lp->status field is still empty, use it to
- hold this event. If not, then this event must be
- returned to the event queue of the LWP. */
- if (lp->status)
- {
- if (debug_linux_nat)
- {
- fprintf_unfiltered (gdb_stdlog,
- "SWC: kill %s, %s\n",
- target_pid_to_str (lp->ptid),
- status_to_str ((int) status));
- }
- kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status));
- }
- else
- lp->status = status;
- return 0;
- }
+ /* Save the sigtrap event. */
+ lp->status = status;
+ gdb_assert (! lp->stopped);
+ gdb_assert (lp->signalled);
+ lp->stopped = 1;
}
else
{
/* We caught the SIGSTOP that we intended to catch, so
there's no SIGSTOP pending. */
- lp->stopped = 1;
+
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "SWC: Delayed SIGSTOP caught for %s.\n",
+ target_pid_to_str (lp->ptid));
+
+ if (lp->step)
+ {
+ /* LP->STATUS is 0 here. That means SIGTRAP from
+ PTRACE_SINGLESTEP still has to be delivered for this inferior
+ stop. Catching the SIGTRAP event is important to prevent
+ starvation in select_event_lwp. */
+
+ registers_changed ();
+ linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
+ 1, GDB_SIGNAL_0);
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "SWC: %s %s, 0, 0 (discard SIGSTOP)\n",
+ "PTRACE_SINGLESTEP",
+ target_pid_to_str (lp->ptid));
+
+ lp->stopped = 0;
+ gdb_assert (lp->resumed);
+ stop_wait_callback (lp, NULL);
+ gdb_assert (lp->stopped);
+ }
+ else
+ lp->stopped = 1;
+
+ /* Reset SIGNALLED only after the stop_wait_callback call above as
+ it does gdb_assert on SIGNALLED. */
lp->signalled = 0;
}
}
@@ -3616,54 +3569,6 @@ retry:
lp = NULL;
}
- if (lp && lp->signalled && lp->last_resume_kind != resume_stop)
- {
- /* A pending SIGSTOP may interfere with the normal stream of
- events. In a typical case where interference is a problem,
- we have a SIGSTOP signal pending for LWP A while
- single-stepping it, encounter an event in LWP B, and take the
- pending SIGSTOP while trying to stop LWP A. After processing
- the event in LWP B, LWP A is continued, and we'll never see
- the SIGTRAP associated with the last time we were
- single-stepping LWP A. */
-
- /* Resume the thread. It should halt immediately returning the
- pending SIGSTOP. */
- registers_changed ();
- if (linux_nat_prepare_to_resume != NULL)
- linux_nat_prepare_to_resume (lp);
- linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
- lp->step, GDB_SIGNAL_0);
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "LLW: %s %s, 0, 0 (expect SIGSTOP)\n",
- lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
- target_pid_to_str (lp->ptid));
- lp->stopped = 0;
- gdb_assert (lp->resumed);
-
- /* Catch the pending SIGSTOP. */
- status = lp->status;
- lp->status = 0;
-
- stop_wait_callback (lp, NULL);
-
- /* If the lp->status field isn't empty, we caught another signal
- while flushing the SIGSTOP. Return it back to the event
- queue of the LWP, as we already have an event to handle. */
- if (lp->status)
- {
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "LLW: kill %s, %s\n",
- target_pid_to_str (lp->ptid),
- status_to_str (lp->status));
- kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
- }
-
- lp->status = status;
- }
-
if (!target_can_async_p ())
{
/* Causes SIGINT to be passed on to the attached process. */
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/siginfo-threads.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/siginfo-threads.c 2012-06-02 21:35:40.268499060 +0200
@@ -0,0 +1,447 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <pthread.h>
+#include <stdio.h>
+#include <limits.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <unistd.h>
+#include <asm/unistd.h>
+
+#define gettid() syscall (__NR_gettid)
+#define tgkill(tgid, tid, sig) syscall (__NR_tgkill, tgid, tid, sig)
+
+/* Terminate always in the main task, it can lock up with SIGSTOPped GDB
+ otherwise. */
+#define TIMEOUT (gettid () == getpid() ? 10 : 15)
+
+static pid_t thread1_tid;
+static pthread_cond_t thread1_tid_cond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t thread1_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+static int thread1_sigusr1_hit;
+static int thread1_sigusr2_hit;
+
+static pid_t thread2_tid;
+static pthread_cond_t thread2_tid_cond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t thread2_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+static int thread2_sigusr1_hit;
+static int thread2_sigusr2_hit;
+
+static pthread_mutex_t terminate_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+
+/* Do not use alarm as it would create a ptrace event which would hang up us if
+ we are being traced by GDB which we stopped ourselves. */
+
+static void timed_mutex_lock (pthread_mutex_t *mutex)
+{
+ int i;
+ struct timespec start, now;
+
+ i = clock_gettime (CLOCK_MONOTONIC, &start);
+ assert (i == 0);
+
+ do
+ {
+ i = pthread_mutex_trylock (mutex);
+ if (i == 0)
+ return;
+ assert (i == EBUSY);
+
+ i = clock_gettime (CLOCK_MONOTONIC, &now);
+ assert (i == 0);
+ assert (now.tv_sec >= start.tv_sec);
+ }
+ while (now.tv_sec - start.tv_sec < TIMEOUT);
+
+ fprintf (stderr, "Timed out waiting for internal lock!\n");
+ exit (EXIT_FAILURE);
+}
+
+static void
+handler (int signo, siginfo_t *siginfo, void *exception)
+{
+ int *varp;
+
+ assert (siginfo->si_signo == signo);
+ assert (siginfo->si_code == SI_TKILL);
+ assert (siginfo->si_pid == getpid ());
+
+ if (gettid () == thread1_tid)
+ {
+ if (signo == SIGUSR1)
+ varp = &thread1_sigusr1_hit;
+ else if (signo == SIGUSR2)
+ varp = &thread1_sigusr2_hit;
+ else
+ assert (0);
+ }
+ else if (gettid () == thread2_tid)
+ {
+ if (signo == SIGUSR1)
+ varp = &thread2_sigusr1_hit;
+ else if (signo == SIGUSR2)
+ varp = &thread2_sigusr2_hit;
+ else
+ assert (0);
+ }
+ else
+ assert (0);
+
+ if (*varp)
+ {
+ fprintf (stderr, "Signal %d for TID %lu has been already hit!\n", signo,
+ (unsigned long) gettid ());
+ exit (EXIT_FAILURE);
+ }
+ *varp = 1;
+}
+
+static void *
+thread1_func (void *unused)
+{
+ int i;
+
+ timed_mutex_lock (&thread1_tid_mutex);
+
+ /* THREAD1_TID_MUTEX must be already locked to avoid race. */
+ thread1_tid = gettid ();
+
+ i = pthread_cond_signal (&thread1_tid_cond);
+ assert (i == 0);
+ i = pthread_mutex_unlock (&thread1_tid_mutex);
+ assert (i == 0);
+
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
+ timed_mutex_lock (&terminate_mutex);
+ i = pthread_mutex_unlock (&terminate_mutex);
+ assert (i == 0);
+
+ if (! thread1_sigusr1_hit)
+ {
+ fprintf (stderr, "Thread 1 signal SIGUSR1 not hit!\n");
+ exit (EXIT_FAILURE);
+ }
+ if (! thread1_sigusr2_hit)
+ {
+ fprintf (stderr, "Thread 1 signal SIGUSR2 not hit!\n");
+ exit (EXIT_FAILURE);
+ }
+
+ return NULL;
+}
+
+static void *
+thread2_func (void *unused)
+{
+ int i;
+
+ timed_mutex_lock (&thread2_tid_mutex);
+
+ /* THREAD2_TID_MUTEX must be already locked to avoid race. */
+ thread2_tid = gettid ();
+
+ i = pthread_cond_signal (&thread2_tid_cond);
+ assert (i == 0);
+ i = pthread_mutex_unlock (&thread2_tid_mutex);
+ assert (i == 0);
+
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
+ timed_mutex_lock (&terminate_mutex);
+ i = pthread_mutex_unlock (&terminate_mutex);
+ assert (i == 0);
+
+ if (! thread2_sigusr1_hit)
+ {
+ fprintf (stderr, "Thread 2 signal SIGUSR1 not hit!\n");
+ exit (EXIT_FAILURE);
+ }
+ if (! thread2_sigusr2_hit)
+ {
+ fprintf (stderr, "Thread 2 signal SIGUSR2 not hit!\n");
+ exit (EXIT_FAILURE);
+ }
+
+ return NULL;
+}
+
+static const char *
+proc_string (const char *filename, const char *line)
+{
+ FILE *f;
+ static char buf[LINE_MAX];
+ size_t line_len = strlen (line);
+
+ f = fopen (filename, "r");
+ if (f == NULL)
+ {
+ fprintf (stderr, "fopen (\"%s\") for \"%s\": %s\n", filename, line,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+ while (errno = 0, fgets (buf, sizeof (buf), f))
+ {
+ char *s;
+
+ s = strchr (buf, '\n');
+ assert (s != NULL);
+ *s = 0;
+
+ if (strncmp (buf, line, line_len) != 0)
+ continue;
+
+ if (fclose (f))
+ {
+ fprintf (stderr, "fclose (\"%s\") for \"%s\": %s\n", filename, line,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+
+ return &buf[line_len];
+ }
+ if (errno != 0)
+ {
+ fprintf (stderr, "fgets (\"%s\": %s\n", filename, strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+ fprintf (stderr, "\"%s\": No line \"%s\" found.\n", filename, line);
+ exit (EXIT_FAILURE);
+}
+
+static unsigned long
+proc_ulong (const char *filename, const char *line)
+{
+ const char *s = proc_string (filename, line);
+ long retval;
+ char *end;
+
+ errno = 0;
+ retval = strtol (s, &end, 10);
+ if (retval < 0 || retval >= LONG_MAX || (end && *end))
+ {
+ fprintf (stderr, "\"%s\":\"%s\": %ld, %s\n", filename, line, retval,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+ return retval;
+}
+
+static void
+state_wait (pid_t process, const char *wanted)
+{
+ char *filename;
+ int i;
+ struct timespec start, now;
+ const char *state;
+
+ i = asprintf (&filename, "/proc/%lu/status", (unsigned long) process);
+ assert (i > 0);
+
+ i = clock_gettime (CLOCK_MONOTONIC, &start);
+ assert (i == 0);
+
+ do
+ {
+ state = proc_string (filename, "State:\t");
+
+ /* torvalds/linux-2.6.git 464763cf1c6df632dccc8f2f4c7e50163154a2c0
+ has changed "T (tracing stop)" to "t (tracing stop)". Make the GDB
+ testcase backward compatible with older Linux kernels. */
+ if (strcmp (state, "T (tracing stop)") == 0)
+ state = "t (tracing stop)";
+
+ if (strcmp (state, wanted) == 0)
+ {
+ free (filename);
+ return;
+ }
+
+ if (sched_yield ())
+ {
+ perror ("sched_yield()");
+ exit (EXIT_FAILURE);
+ }
+
+ i = clock_gettime (CLOCK_MONOTONIC, &now);
+ assert (i == 0);
+ assert (now.tv_sec >= start.tv_sec);
+ }
+ while (now.tv_sec - start.tv_sec < TIMEOUT);
+
+ fprintf (stderr, "Timed out waiting for PID %lu \"%s\" (now it is \"%s\")!\n",
+ (unsigned long) process, wanted, state);
+ exit (EXIT_FAILURE);
+}
+
+static volatile pid_t tracer = 0;
+static pthread_t thread1, thread2;
+
+static void
+cleanup (void)
+{
+ printf ("Resuming GDB PID %lu.\n", (unsigned long) tracer);
+
+ if (tracer)
+ {
+ int i;
+ int tracer_save = tracer;
+
+ tracer = 0;
+
+ i = kill (tracer_save, SIGCONT);
+ assert (i == 0);
+ }
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ int standalone = 0;
+ struct sigaction act;
+
+ if (argc == 2 && strcmp (argv[1], "-s") == 0)
+ standalone = 1;
+ else
+ assert (argc == 1);
+
+ setbuf (stdout, NULL);
+
+ timed_mutex_lock (&thread1_tid_mutex);
+ timed_mutex_lock (&thread2_tid_mutex);
+
+ timed_mutex_lock (&terminate_mutex);
+
+ errno = 0;
+ memset (&act, 0, sizeof (act));
+ act.sa_sigaction = handler;
+ act.sa_flags = SA_RESTART | SA_SIGINFO;
+ i = sigemptyset (&act.sa_mask);
+ assert_perror (errno);
+ assert (i == 0);
+ i = sigaction (SIGUSR1, &act, NULL);
+ assert_perror (errno);
+ assert (i == 0);
+ i = sigaction (SIGUSR2, &act, NULL);
+ assert_perror (errno);
+ assert (i == 0);
+
+ i = pthread_create (&thread1, NULL, thread1_func, NULL);
+ assert (i == 0);
+
+ i = pthread_create (&thread2, NULL, thread2_func, NULL);
+ assert (i == 0);
+
+ if (!standalone)
+ {
+ tracer = proc_ulong ("/proc/self/status", "TracerPid:\t");
+ if (tracer == 0)
+ {
+ fprintf (stderr, "The testcase must be run by GDB!\n");
+ exit (EXIT_FAILURE);
+ }
+ if (tracer != getppid ())
+ {
+ fprintf (stderr, "The testcase parent must be our GDB tracer!\n");
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ /* SIGCONT our debugger in the case of our crash as we would deadlock
+ otherwise. */
+
+ atexit (cleanup);
+
+ printf ("Stopping GDB PID %lu.\n", (unsigned long) tracer);
+
+ if (tracer)
+ {
+ i = kill (tracer, SIGSTOP);
+ assert (i == 0);
+ state_wait (tracer, "T (stopped)");
+ }
+
+ /* Threads are now waiting at timed_mutex_lock (thread1_tid_mutex) and so
+ they could not trigger the signals before GDB gets unstopped later.
+ Threads get resumed at pthread_cond_wait below. Use `while' loops for
+ protection against spurious pthread_cond_wait wakeups. */
+
+ printf ("Waiting till the threads initialize their TIDs.\n");
+
+ while (thread1_tid == 0)
+ {
+ i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
+ assert (i == 0);
+ }
+
+ while (thread2_tid == 0)
+ {
+ i = pthread_cond_wait (&thread2_tid_cond, &thread2_tid_mutex);
+ assert (i == 0);
+ }
+
+ printf ("Thread 1 TID = %lu, thread 2 TID = %lu, PID = %lu.\n",
+ (unsigned long) thread1_tid, (unsigned long) thread2_tid,
+ (unsigned long) getpid ());
+
+ errno = 0;
+ i = tgkill (getpid (), thread1_tid, SIGUSR1);
+ assert_perror (errno);
+ assert (i == 0);
+ i = tgkill (getpid (), thread1_tid, SIGUSR2);
+ assert_perror (errno);
+ assert (i == 0);
+ i = tgkill (getpid (), thread2_tid, SIGUSR1);
+ assert_perror (errno);
+ assert (i == 0);
+ i = tgkill (getpid (), thread2_tid, SIGUSR2);
+ assert_perror (errno);
+ assert (i == 0);
+
+ printf ("Waiting till the threads get trapped by the signals.\n");
+
+ if (tracer)
+ {
+ /* s390x-unknown-linux-gnu will fail with "R (running)". */
+
+ state_wait (thread1_tid, "t (tracing stop)");
+
+ state_wait (thread2_tid, "t (tracing stop)");
+ }
+
+ cleanup ();
+
+ printf ("Joining the threads.\n");
+
+ i = pthread_mutex_unlock (&terminate_mutex);
+ assert (i == 0);
+
+ i = pthread_join (thread1, NULL);
+ assert (i == 0);
+
+ i = pthread_join (thread2, NULL);
+ assert (i == 0);
+
+ printf ("Exiting.\n"); /* break-at-exit */
+
+ return EXIT_SUCCESS;
+}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/siginfo-threads.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/siginfo-threads.exp 2012-06-02 21:35:40.296499050 +0200
@@ -0,0 +1,94 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile "siginfo-threads"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" ${binfile} executable [list debug additional_flags=-lrt]] != "" } {
+ return -1
+}
+
+clean_restart $testfile
+
+if ![runto_main] {
+ return -1
+}
+
+# `nostop noprint pass' could in some cases report false PASS due to the
+# (preempt 'handle') code path.
+
+gdb_test "handle SIGUSR1 stop print pass" "Signal\[ \t\]+Stop\[ \t\]+Print\[ \t\]+Pass to program\[ \t\]+Description\r\nSIGUSR1\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
+gdb_test "handle SIGUSR2 stop print pass" "Signal\[ \t\]+Stop\[ \t\]+Print\[ \t\]+Pass to program\[ \t\]+Description\r\nSIGUSR2\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
+
+gdb_breakpoint [gdb_get_line_number "break-at-exit"]
+
+set test "get pid"
+gdb_test_multiple "p getpid ()" $test {
+ -re " = (\[0-9\]+)\r\n$gdb_prompt $" {
+ set pid $expect_out(1,string)
+ pass $test
+ }
+}
+
+for {set sigcount 0} {$sigcount < 4} {incr sigcount} {
+ set test "catch signal $sigcount"
+ set sigusr ""
+ gdb_test_multiple "continue" $test {
+ -re "Program received signal SIGUSR(\[12\]), User defined signal \[12\]\\.\r\n.*\r\n$gdb_prompt $" {
+ set sigusr $expect_out(1,string)
+ pass $test
+ }
+ }
+ if {$sigusr == ""} {
+ return -1
+ }
+
+ set test "signal $sigcount si_signo"
+ if {$sigusr == 1} {
+ set signo 10
+ } else {
+ set signo 12
+ }
+ gdb_test_multiple {p $_siginfo.si_signo} $test {
+ -re " = $signo\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
+ unsupported $test
+ }
+ }
+
+ set test "signal $sigcount si_code is SI_TKILL"
+ gdb_test_multiple {p $_siginfo.si_code} $test {
+ -re " = -6\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
+ unsupported $test
+ }
+ }
+
+ set test "signal $sigcount si_pid"
+ gdb_test_multiple {p $_siginfo._sifields._kill.si_pid} $test {
+ -re " = $pid\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
+ unsupported $test
+ }
+ }
+}
+
+gdb_continue_to_breakpoint break-at-exit ".*break-at-exit.*"
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/sigstep-threads.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/sigstep-threads.c 2012-06-02 21:35:40.297499050 +0200
@@ -0,0 +1,54 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+#include <assert.h>
+#include <signal.h>
+
+#include <asm/unistd.h>
+#include <unistd.h>
+#define tgkill(tgid, tid, sig) syscall (__NR_tgkill, (tgid), (tid), (sig))
+#define gettid() syscall (__NR_gettid)
+
+static volatile int var;
+
+static void
+handler (int signo) /* step-0 */
+{ /* step-0 */
+ var++; /* step-1 */
+ tgkill (getpid (), gettid (), SIGUSR1); /* step-2 */
+}
+
+static void *
+start (void *arg)
+{
+ signal (SIGUSR1, handler);
+ tgkill (getpid (), gettid (), SIGUSR1);
+ assert (0);
+
+ return NULL;
+}
+
+int
+main (void)
+{
+ pthread_t thread;
+
+ pthread_create (&thread, NULL, start, NULL);
+ start (NULL); /* main-start */
+ return 0;
+}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/sigstep-threads.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/sigstep-threads.exp 2012-06-02 21:35:40.297499050 +0200
@@ -0,0 +1,74 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile sigstep-threads
+set srcfile ${testfile}.c
+set executable ${testfile}
+set binfile ${objdir}/${subdir}/${executable}
+
+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested ${testfile}.exp
+ return -1
+}
+
+clean_restart $executable
+
+if ![runto_main] {
+ return -1;
+}
+
+# `noprint' would not test the full logic of GDB.
+gdb_test "handle SIGUSR1 nostop print pass" "\r\nSIGUSR1\[ \t\]+No\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
+
+gdb_test_no_output "set scheduler-locking off"
+
+gdb_breakpoint [gdb_get_line_number "step-1"]
+gdb_test_no_output {set $step1=$bpnum}
+gdb_continue_to_breakpoint "step-1" ".* step-1 .*"
+gdb_test_no_output {disable $step1}
+
+# 1 as we are now stopped at the `step-1' label.
+set step_at 1
+for {set i 0} {$i < 100} {incr i} {
+ set test "step $i"
+ # Presume this step failed - as in the case of a timeout.
+ set failed 1
+ gdb_test_multiple "step" $test {
+ -re "\r\nProgram received signal SIGUSR1, User defined signal 1.\r\n" {
+ exp_continue -continue_timer
+ }
+ -re "step-(\[012\]).*\r\n$gdb_prompt $" {
+ set now $expect_out(1,string)
+ if {$step_at == 2 && $now == 1} {
+ set failed 0
+ } elseif {$step_at == 1 && $now == 2} {
+ set failed 0
+ # Continue over the re-signalling back to the handle entry.
+ gdb_test_no_output {enable $step1} ""
+ gdb_test "continue" " step-1 .*" ""
+ set now 1
+ gdb_test_no_output {disable $step1} ""
+ } else {
+ fail $test
+ }
+ set step_at $now
+ }
+ }
+ if $failed {
+ return
+ }
+}
+# We can never reliably say the racy problematic case has been tested.
+pass "step"

View File

@ -1,141 +0,0 @@
http://sourceware.org/ml/gdb-patches/2010-09/msg00361.html
Subject: [patch 4/4]#3 Remove redundant lp->siginfo
Hi,
this is a simplification which should not affect GDB behavior. As linux-nat
now stops on each received signal without any reordering of them then
PTRACE_GETSIGINFO is enough to access siginfo, without any need to copy it in
advance.
Thanks,
Jan
gdb/
2010-09-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-nat.c (resume_callback) <lp->stopped && lp->status == 0>
(linux_nat_resume): Remove LP->SIGINFO clearing.
(save_siginfo): Remove.
(stop_wait_callback) <WSTOPSIG (status) != SIGSTOP>
(linux_nat_filter_event) <linux_nat_status_is_event (status)>: Remove
the save_siginfo call.
(resume_stopped_resumed_lwps): Remove LP->SIGINFO clearing.
(linux_nat_set_siginfo_fixup): Use PTRACE_GETSIGINFO.
* linux-nat.h (struct lwp_info) <siginfo>: Remove.
Index: gdb-7.4.50.20120602/gdb/linux-nat.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.c 2012-06-02 21:36:21.067483466 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.c 2012-06-02 21:37:55.345447402 +0200
@@ -1929,7 +1929,6 @@ resume_lwp (struct lwp_info *lp, int ste
step, GDB_SIGNAL_0);
lp->stopped = 0;
lp->step = step;
- memset (&lp->siginfo, 0, sizeof (lp->siginfo));
lp->stopped_by_watchpoint = 0;
}
else
@@ -2071,7 +2070,6 @@ linux_nat_resume (struct target_ops *ops
if (linux_nat_prepare_to_resume != NULL)
linux_nat_prepare_to_resume (lp);
linux_ops->to_resume (linux_ops, ptid, step, signo);
- memset (&lp->siginfo, 0, sizeof (lp->siginfo));
lp->stopped_by_watchpoint = 0;
if (debug_linux_nat)
@@ -2625,22 +2623,6 @@ wait_lwp (struct lwp_info *lp)
return status;
}
-/* Save the most recent siginfo for LP. This is currently only called
- for SIGTRAP; some ports use the si_addr field for
- target_stopped_data_address. In the future, it may also be used to
- restore the siginfo of requeued signals. */
-
-static void
-save_siginfo (struct lwp_info *lp)
-{
- errno = 0;
- ptrace (PTRACE_GETSIGINFO, GET_LWP (lp->ptid),
- (PTRACE_TYPE_ARG3) 0, &lp->siginfo);
-
- if (errno != 0)
- memset (&lp->siginfo, 0, sizeof (lp->siginfo));
-}
-
/* Send a SIGSTOP to LP. */
static int
@@ -2885,9 +2867,6 @@ stop_wait_callback (struct lwp_info *lp,
{
/* The thread was stopped with a signal other than SIGSTOP. */
- /* Save the trap's siginfo in case we need it later. */
- save_siginfo (lp);
-
save_sigtrap (lp);
if (debug_linux_nat)
@@ -3291,12 +3270,7 @@ linux_nat_filter_event (int lwpid, int s
}
if (linux_nat_status_is_event (status))
- {
- /* Save the trap's siginfo in case we need it later. */
- save_siginfo (lp);
-
- save_sigtrap (lp);
- }
+ save_sigtrap (lp);
/* Check if the thread has exited. */
if ((WIFEXITED (status) || WIFSIGNALED (status))
@@ -3950,7 +3924,6 @@ resume_stopped_resumed_lwps (struct lwp_
linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
lp->step, GDB_SIGNAL_0);
lp->stopped = 0;
- memset (&lp->siginfo, 0, sizeof (lp->siginfo));
lp->stopped_by_watchpoint = 0;
}
@@ -5227,11 +5200,19 @@ linux_nat_set_prepare_to_resume (struct
siginfo_t *
linux_nat_get_siginfo (ptid_t ptid)
{
- struct lwp_info *lp = find_lwp_pid (ptid);
+ static siginfo_t siginfo;
+ int pid;
- gdb_assert (lp != NULL);
+ pid = GET_LWP (ptid);
+ if (pid == 0)
+ pid = GET_PID (ptid);
+
+ errno = 0;
+ ptrace (PTRACE_GETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, &siginfo);
+ if (errno != 0)
+ memset (&siginfo, 0, sizeof (siginfo));
- return &lp->siginfo;
+ return &siginfo;
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.4.50.20120602/gdb/linux-nat.h
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.h 2012-06-02 21:36:21.067483466 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.h 2012-06-02 21:36:27.140481144 +0200
@@ -76,10 +76,6 @@ struct lwp_info
/* The kind of stepping of this LWP. */
enum resume_step step;
- /* Non-zero si_signo if this LWP stopped with a trap. si_addr may
- be the address of a hardware watchpoint. */
- siginfo_t siginfo;
-
/* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data
watchpoint trap. */
int stopped_by_watchpoint;

1002
gdb-check-type.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +1,13 @@
http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
Hi, [ New patch variant. ]
GDB currently always prints on loading a core file: Index: gdb-7.4.50.20120703/gdb/solib-svr4.c
warning: Can't read pathname for load map: Input/output error.
The patch is not nice but it was WONTFIXed on the glibc side in:
http://sourceware.org/ml/libc-alpha/2009-10/msg00001.html
The same message in GDB PR 8882 and glibc PR 387 was for ld-linux.so.2 l_name
but that one is now ignored thanks to IGNORE_FIRST_LINK_MAP_ENTRY.
This fix is intended for Linux system vDSO l_name which is a second entry in
the DSO list.
Regression tested on {x86_86,x86_64-m32,i686}-fedora11-linux-gnu.
Thanks,
Jan
gdb/
2009-10-06 Jan Kratochvil <jan.kratochvil@redhat.com>
Do not print false warning on reading core file with vDSO on GNU/Linux.
* solib-svr4.c (svr4_current_sos): Suppress the warning if
MASTER_SO_LIST is still NULL.
* solib.c (update_solib_list): New variable saved_so_list_head.
Conditionally restart the function.
[ Context backport. ]
Index: gdb-7.4.50.20111218/gdb/solib-svr4.c
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/solib-svr4.c 2011-12-19 01:14:31.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/solib-svr4.c 2012-07-06 15:39:57.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/solib-svr4.c 2011-12-19 01:31:10.106752164 +0100 +++ gdb-7.4.50.20120703/gdb/solib-svr4.c 2012-07-06 15:40:01.124816148 +0200
@@ -1222,8 +1222,17 @@ svr4_read_so_list (CORE_ADDR lm, struct @@ -1221,8 +1221,17 @@ svr4_read_so_list (CORE_ADDR lm, struct
SO_NAME_MAX_PATH_SIZE - 1, &errcode); SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0) if (errcode != 0)
{ {
@ -57,28 +27,105 @@ Index: gdb-7.4.50.20111218/gdb/solib-svr4.c
do_cleanups (old_chain); do_cleanups (old_chain);
continue; continue;
} }
Index: gdb-7.4.50.20111218/gdb/solib.c Index: gdb-7.4.50.20120703/gdb/solib.c
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/solib.c 2011-09-12 21:00:22.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/solib.c 2012-07-06 15:38:39.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/solib.c 2011-12-19 01:29:04.815227898 +0100 +++ gdb-7.4.50.20120703/gdb/solib.c 2012-07-06 15:40:01.125816147 +0200
@@ -676,6 +676,7 @@ update_solib_list (int from_tty, struct @@ -672,7 +672,7 @@ solib_used (const struct so_list *const
processes we've just attached to, so that's okay. */
static void
-update_solib_list (int from_tty, struct target_ops *target)
+update_solib_list_1 (int from_tty, struct target_ops *target)
{
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch);
struct so_list *inferior = ops->current_sos(); struct so_list *inferior = ops->current_sos();
struct so_list *gdb, **gdb_link; @@ -843,6 +843,21 @@ Do you need \"set solib-search-path\" or
}
}
+/* Wrapper for Fedora: gdb-core-open-vdso-warning.patch */
+
+static void
+update_solib_list (int from_tty, struct target_ops *target)
+{
+ struct so_list *saved_so_list_head = so_list_head; + struct so_list *saved_so_list_head = so_list_head;
/* We can reach here due to changing solib-search-path or the
sysroot, before having any inferior. */
@@ -817,6 +818,12 @@ update_solib_list (int from_tty, struct
observer_notify_solib_loaded (i);
}
+ /* If this was the very first DSO list scan and we possibly read in ld.so
+ recheck all the formerly unreadable DSO names strings. */
+ +
+ if (saved_so_list_head == NULL && so_list_head != NULL) + update_solib_list_1 (from_tty, target);
+ return update_solib_list (from_tty, target);
+ +
/* If a library was not found, issue an appropriate warning + /* If this was the very first DSO list scan and we possibly read in ld.so
message. We have to use a single call to warning in case the + recheck all the formerly unreadable DSO names strings. */
front end does something special with warnings, e.g., pop up +
+ if (saved_so_list_head == NULL && so_list_head != NULL)
+ update_solib_list_1 (from_tty, target);
+}
/* Return non-zero if NAME is the libpthread shared library.
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/corefile.exp 2012-07-06 15:39:41.000000000 +0200
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp 2012-07-06 15:40:10.322805539 +0200
@@ -286,3 +286,19 @@ if {$buildid == ""} {
gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
pass $wholetest
}
+
+
+# Test Linux specific vDSO warning:
+# warning: Can't read pathname for load map: Input/output error.
+
+clean_restart ${testfile}
+
+set test "core-file vdso warning"
+gdb_test_multiple "core-file $corefile" $test {
+ -re "warning: Can't read pathname for load map: Input/output error\\.\r\n.*\r\n$gdb_prompt $" {
+ fail $test
+ }
+ -re "\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/solib-symbol.exp
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2012-07-06 15:38:39.000000000 +0200
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/solib-symbol.exp 2012-07-06 15:40:01.127816145 +0200
@@ -27,7 +27,8 @@ set lib_flags [list debug ldflags=-Wl,-B
# Binary file.
set testfile "solib-symbol-main"
set srcfile ${srcdir}/${subdir}/${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+set executable ${testfile}
+set binfile ${objdir}/${subdir}/${executable}
set bin_flags [list debug shlib=${binfile_lib}]
if [get_compiler_info] {
@@ -72,8 +73,26 @@ gdb_test "br foo2" \
"Breakpoint.*: foo2. .2 locations..*" \
"foo2 in mdlib"
-gdb_exit
+# Test GDB warns for shared libraris which have not been found.
-return 0
+gdb_test "info sharedlibrary" "/${libname}.*"
+clean_restart ${executable}
+gdb_breakpoint "main"
+gdb_run_cmd
+set test "no warning for missing libraries"
+gdb_test_multiple "" $test {
+ -re "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\n$gdb_prompt $" {
+ fail $test
+ }
+ -re "Breakpoint \[0-9\]+, main .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+clean_restart ${executable}
+gdb_test_no_output "set solib-absolute-prefix /doESnotEXIST"
+gdb_breakpoint "main"
+gdb_run_cmd
+gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \
+ "warning for missing libraries"

View File

@ -1,42 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00050.html
Subject: [patch] dejagnu compat. - missing find_go_linker [Re: [patch, doc RFA] Go language support]
On Wed, 25 Apr 2012 04:17:35 +0200, Doug Evans wrote:
> +if {[info procs find_go_linker] == ""} {
> + rename gdb_find_go find_go
> + rename gdb_find_go_linker find_go_linker
> + # No need to set use_gdb_compile.
> +}
Is there a reason for it? With recent Fedora 17 update
https://bugzilla.redhat.com/show_bug.cgi?id=635651
dejagnu has started to support 'find_gfortran'. But it still does not support
'find_go_linker'. This has resulted in regression failing to compile any
gdb.go/*.exp files.
Thanks,
Jan
gdb/testsuite/
2012-06-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/future.exp: Set $use_gdb_compile even if only find_go_linker is
missing.
diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
index 40456c0..bf47988 100644
--- a/gdb/testsuite/lib/future.exp
+++ b/gdb/testsuite/lib/future.exp
@@ -514,7 +514,7 @@ if {[info procs find_gfortran] == ""} {
if {[info procs find_go_linker] == ""} {
rename gdb_find_go find_go
rename gdb_find_go_linker find_go_linker
- # No need to set use_gdb_compile.
+ set use_gdb_compile 1
}
if {$use_gdb_compile} {

View File

@ -1,24 +0,0 @@
diff -dup -rup gdb-7.4.50.20120603-orig/gdb/configure gdb-7.4.50.20120603/gdb/configure
--- gdb-7.4.50.20120603-orig/gdb/configure 2012-06-06 19:08:32.824824699 +0200
+++ gdb-7.4.50.20120603/gdb/configure 2012-06-06 19:12:12.346992423 +0200
@@ -2706,7 +2706,7 @@ fi
# Provide more thorough testing by -lmcheck.
# Set it to 'true' for development snapshots, 'false' for releases or
# pre-releases.
-development=true
+development=false
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
diff -dup -rup gdb-7.4.50.20120603-orig/gdb/configure.ac gdb-7.4.50.20120603/gdb/configure.ac
--- gdb-7.4.50.20120603-orig/gdb/configure.ac 2012-06-06 19:08:32.817824693 +0200
+++ gdb-7.4.50.20120603/gdb/configure.ac 2012-06-06 19:12:05.545987227 +0200
@@ -26,7 +26,7 @@ AM_MAINTAINER_MODE
# Provide more thorough testing by -lmcheck.
# Set it to 'true' for development snapshots, 'false' for releases or
# pre-releases.
-development=true
+development=false
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS

View File

@ -0,0 +1,795 @@
http://sourceware.org/ml/gdb-cvs/2012-07/msg00123.html
### src/gdb/ChangeLog 2012/07/18 04:36:15 1.14473
### src/gdb/ChangeLog 2012/07/18 16:12:15 1.14474
## -1,3 +1,37 @@
+2012-07-18 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * elfread.c (elf_get_probe_argument_count): Remove `objfile' argument.
+ (elf_compile_to_ax): Likewise.
+ * infrun.c (insert_exception_resume_from_probe): Likewise.
+ (check_exception_resume): Remove `objfile' variable.
+ * probe.c (find_probe_by_pc): Remove `objfile' argument.
+ (struct probe_and_objfile, probe_and_objfile_s): Delete.
+ (collect_probes): Adjust return value to `VEC (probe_p) *'.
+ (compare_entries): Rename to...
+ (compare_probes): ...this. Adjust function to work with
+ `struct probe *'. Rename variables `ea' and `eb' to `pa' and `pb'
+ respectively.
+ (gen_ui_out_table_header_info): Adjust `probes' argument to be
+ `VEC (probe_p) *'.
+ (print_ui_out_info): Adjust argument to be `struct probe *'.
+ (info_probes_for_ops): Adjust internal computations to use
+ `VEC (probe_p) *'.
+ (probe_safe_evaluate_at_pc): Refactor to not pass `objfile' anymore.
+ * probe.h (struct probe_ops) <get_probe_argument_count, compile_to_ax,
+ gen_info_probes_table_values>: Remove `objfile' argument.
+ (struct probe) <objfile>: New field.
+ (find_probe_by_pc): Remove `objfile' argument.
+ * stap-probe.c (stap_parse_probe_arguments): Likewise.
+ (stap_get_probe_argument_count): Likewise.
+ (stap_get_arg): Likewise.
+ (stap_evaluate_probe_argument): Likewise.
+ (stap_compile_to_ax): Likewise.
+ (compile_probe_arg): Refactor not to pass `objfile' anymore.
+ (handle_stap_probe): Fill `objfile' field from `struct probe'.
+ (stap_gen_info_probes_table_header): Remove `objfile' argument.
+ * symfile.h (struct sym_probe_fns) <sym_evaluate_probe_argument,
+ sym_compile_to_ax>: Likewise.
+
2012-07-18 Terry Guo <terry.guo@arm.com>
PR 14329
--- src/gdb/elfread.c 2012/06/26 20:14:01 1.133
+++ src/gdb/elfread.c 2012/07/18 16:12:15 1.134
@@ -1635,33 +1635,29 @@
symfile.h. */
static unsigned
-elf_get_probe_argument_count (struct objfile *objfile,
- struct probe *probe)
+elf_get_probe_argument_count (struct probe *probe)
{
- return probe->pops->get_probe_argument_count (probe, objfile);
+ return probe->pops->get_probe_argument_count (probe);
}
/* Implementation of `sym_evaluate_probe_argument', as documented in
symfile.h. */
static struct value *
-elf_evaluate_probe_argument (struct objfile *objfile,
- struct probe *probe,
- unsigned n)
+elf_evaluate_probe_argument (struct probe *probe, unsigned n)
{
- return probe->pops->evaluate_probe_argument (probe, objfile, n);
+ return probe->pops->evaluate_probe_argument (probe, n);
}
/* Implementation of `sym_compile_to_ax', as documented in symfile.h. */
static void
-elf_compile_to_ax (struct objfile *objfile,
- struct probe *probe,
+elf_compile_to_ax (struct probe *probe,
struct agent_expr *expr,
struct axs_value *value,
unsigned n)
{
- probe->pops->compile_to_ax (probe, objfile, expr, value, n);
+ probe->pops->compile_to_ax (probe, expr, value, n);
}
/* Implementation of `sym_relocate_probe', as documented in symfile.h. */
--- src/gdb/infrun.c 2012/07/01 10:37:04 1.549
+++ src/gdb/infrun.c 2012/07/18 16:12:16 1.550
@@ -5518,7 +5518,6 @@
static void
insert_exception_resume_from_probe (struct thread_info *tp,
const struct probe *probe,
- struct objfile *objfile,
struct frame_info *frame)
{
struct value *arg_value;
@@ -5534,7 +5533,7 @@
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
"infrun: exception resume at %s\n",
- paddress (get_objfile_arch (objfile),
+ paddress (get_objfile_arch (probe->objfile),
handler));
bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame),
@@ -5552,7 +5551,6 @@
struct frame_info *frame)
{
volatile struct gdb_exception e;
- struct objfile *objfile;
const struct probe *probe;
struct symbol *func;
@@ -5560,11 +5558,10 @@
SystemTap probe point. If so, the probe has two arguments: the
CFA and the HANDLER. We ignore the CFA, extract the handler, and
set a breakpoint there. */
- probe = find_probe_by_pc (get_frame_pc (frame), &objfile);
+ probe = find_probe_by_pc (get_frame_pc (frame));
if (probe)
{
- insert_exception_resume_from_probe (ecs->event_thread, probe,
- objfile, frame);
+ insert_exception_resume_from_probe (ecs->event_thread, probe, frame);
return;
}
--- src/gdb/probe.c 2012/05/08 01:35:34 1.3
+++ src/gdb/probe.c 2012/07/18 16:12:17 1.4
@@ -204,7 +204,7 @@
/* See definition in probe.h. */
struct probe *
-find_probe_by_pc (CORE_ADDR pc, struct objfile **objfile_out)
+find_probe_by_pc (CORE_ADDR pc)
{
struct objfile *objfile;
@@ -221,10 +221,7 @@
probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++)
if (probe->address == pc)
- {
- *objfile_out = objfile;
- return probe;
- }
+ return probe;
}
return NULL;
@@ -232,21 +229,6 @@
-/* A utility structure. A VEC of these is built when handling "info
- probes". */
-
-struct probe_and_objfile
-{
- /* The probe. */
- struct probe *probe;
-
- /* The probe's objfile. */
- struct objfile *objfile;
-};
-
-typedef struct probe_and_objfile probe_and_objfile_s;
-DEF_VEC_O (probe_and_objfile_s);
-
/* A helper function for collect_probes that compiles a regexp and
throws an exception on error. This installs a cleanup to free the
resulting pattern on success. If RX is NULL, this does nothing. */
@@ -275,16 +257,16 @@
If POPS is not NULL, only probes of this certain probe_ops will match.
Each argument is a regexp, or NULL, which matches anything. */
-static VEC (probe_and_objfile_s) *
+static VEC (probe_p) *
collect_probes (char *objname, char *provider, char *probe_name,
const struct probe_ops *pops)
{
struct objfile *objfile;
- VEC (probe_and_objfile_s) *result = NULL;
+ VEC (probe_p) *result = NULL;
struct cleanup *cleanup, *cleanup_temps;
regex_t obj_pat, prov_pat, probe_pat;
- cleanup = make_cleanup (VEC_cleanup (probe_and_objfile_s), &result);
+ cleanup = make_cleanup (VEC_cleanup (probe_p), &result);
cleanup_temps = make_cleanup (null_cleanup, NULL);
compile_rx_or_error (&prov_pat, provider, _("Invalid provider regexp"));
@@ -310,8 +292,6 @@
for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++)
{
- probe_and_objfile_s entry;
-
if (pops != NULL && probe->pops != pops)
continue;
@@ -323,9 +303,7 @@
&& regexec (&probe_pat, probe->name, 0, NULL, 0) != 0)
continue;
- entry.probe = probe;
- entry.objfile = objfile;
- VEC_safe_push (probe_and_objfile_s, result, &entry);
+ VEC_safe_push (probe_p, result, probe);
}
}
@@ -334,36 +312,36 @@
return result;
}
-/* A qsort comparison function for probe_and_objfile_s objects. */
+/* A qsort comparison function for probe_p objects. */
static int
-compare_entries (const void *a, const void *b)
+compare_probes (const void *a, const void *b)
{
- const probe_and_objfile_s *ea = a;
- const probe_and_objfile_s *eb = b;
+ const struct probe *pa = *((const struct probe **) a);
+ const struct probe *pb = *((const struct probe **) b);
int v;
- v = strcmp (ea->probe->provider, eb->probe->provider);
+ v = strcmp (pa->provider, pb->provider);
if (v)
return v;
- v = strcmp (ea->probe->name, eb->probe->name);
+ v = strcmp (pa->name, pb->name);
if (v)
return v;
- if (ea->probe->address < eb->probe->address)
+ if (pa->address < pb->address)
return -1;
- if (ea->probe->address > eb->probe->address)
+ if (pa->address > pb->address)
return 1;
- return strcmp (ea->objfile->name, eb->objfile->name);
+ return strcmp (pa->objfile->name, pb->objfile->name);
}
/* Helper function that generate entries in the ui_out table being
crafted by `info_probes_for_ops'. */
static void
-gen_ui_out_table_header_info (VEC (probe_and_objfile_s) *probes,
+gen_ui_out_table_header_info (VEC (probe_p) *probes,
const struct probe_ops *p)
{
/* `headings' refers to the names of the columns when printing `info
@@ -392,11 +370,11 @@
VEC_iterate (info_probe_column_s, headings, ix, column);
++ix)
{
- probe_and_objfile_s *entry;
+ struct probe *probe;
int jx;
size_t size_max = strlen (column->print_name);
- for (jx = 0; VEC_iterate (probe_and_objfile_s, probes, jx, entry); ++jx)
+ for (jx = 0; VEC_iterate (probe_p, probes, jx, probe); ++jx)
{
/* `probe_fields' refers to the values of each new field that this
probe will display. */
@@ -405,12 +383,11 @@
const char *val;
int kx;
- if (entry->probe->pops != p)
+ if (probe->pops != p)
continue;
c2 = make_cleanup (VEC_cleanup (const_char_ptr), &probe_fields);
- p->gen_info_probes_table_values (entry->probe, entry->objfile,
- &probe_fields);
+ p->gen_info_probes_table_values (probe, &probe_fields);
gdb_assert (VEC_length (const_char_ptr, probe_fields)
== headings_size);
@@ -437,10 +414,10 @@
}
/* Helper function to print extra information about a probe and an objfile
- represented by ENTRY. */
+ represented by PROBE. */
static void
-print_ui_out_info (probe_and_objfile_s *entry)
+print_ui_out_info (struct probe *probe)
{
int ix;
int j = 0;
@@ -451,23 +428,21 @@
info_probe_column_s *column;
struct cleanup *c;
- gdb_assert (entry != NULL);
- gdb_assert (entry->probe != NULL);
- gdb_assert (entry->probe->pops != NULL);
+ gdb_assert (probe != NULL);
+ gdb_assert (probe->pops != NULL);
- if (entry->probe->pops->gen_info_probes_table_header == NULL
- && entry->probe->pops->gen_info_probes_table_values == NULL)
+ if (probe->pops->gen_info_probes_table_header == NULL
+ && probe->pops->gen_info_probes_table_values == NULL)
return;
- gdb_assert (entry->probe->pops->gen_info_probes_table_header != NULL
- && entry->probe->pops->gen_info_probes_table_values != NULL);
+ gdb_assert (probe->pops->gen_info_probes_table_header != NULL
+ && probe->pops->gen_info_probes_table_values != NULL);
c = make_cleanup (VEC_cleanup (info_probe_column_s), &headings);
make_cleanup (VEC_cleanup (const_char_ptr), &values);
- entry->probe->pops->gen_info_probes_table_header (&headings);
- entry->probe->pops->gen_info_probes_table_values (entry->probe,
- entry->objfile, &values);
+ probe->pops->gen_info_probes_table_header (&headings);
+ probe->pops->gen_info_probes_table_values (probe, &values);
gdb_assert (VEC_length (info_probe_column_s, headings)
== VEC_length (const_char_ptr, values));
@@ -515,16 +490,16 @@
void
info_probes_for_ops (char *arg, int from_tty, const struct probe_ops *pops)
{
- char *provider, *probe = NULL, *objname = NULL;
+ char *provider, *probe_name = NULL, *objname = NULL;
struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
- VEC (probe_and_objfile_s) *items;
+ VEC (probe_p) *probes;
int i, any_found;
int ui_out_extra_fields = 0;
size_t size_addr;
size_t size_name = strlen ("Name");
size_t size_objname = strlen ("Object");
size_t size_provider = strlen ("Provider");
- probe_and_objfile_s *entry;
+ struct probe *probe;
struct gdbarch *gdbarch = get_current_arch ();
/* Do we have a `provider:probe:objfile' style of linespec? */
@@ -533,10 +508,10 @@
{
make_cleanup (xfree, provider);
- probe = extract_arg (&arg);
- if (probe)
+ probe_name = extract_arg (&arg);
+ if (probe_name)
{
- make_cleanup (xfree, probe);
+ make_cleanup (xfree, probe_name);
objname = extract_arg (&arg);
if (objname)
@@ -564,28 +539,27 @@
else
ui_out_extra_fields = get_number_extra_fields (pops);
- items = collect_probes (objname, provider, probe, pops);
- make_cleanup (VEC_cleanup (probe_and_objfile_s), &items);
+ probes = collect_probes (objname, provider, probe_name, pops);
+ make_cleanup (VEC_cleanup (probe_p), &probes);
make_cleanup_ui_out_table_begin_end (current_uiout,
4 + ui_out_extra_fields,
- VEC_length (probe_and_objfile_s, items),
+ VEC_length (probe_p, probes),
"StaticProbes");
- if (!VEC_empty (probe_and_objfile_s, items))
- qsort (VEC_address (probe_and_objfile_s, items),
- VEC_length (probe_and_objfile_s, items),
- sizeof (probe_and_objfile_s), compare_entries);
+ if (!VEC_empty (probe_p, probes))
+ qsort (VEC_address (probe_p, probes), VEC_length (probe_p, probes),
+ sizeof (probe_p), compare_probes);
/* What's the size of an address in our architecture? */
size_addr = gdbarch_addr_bit (gdbarch) == 64 ? 18 : 10;
/* Determining the maximum size of each field (`provider', `name' and
`objname'). */
- for (i = 0; VEC_iterate (probe_and_objfile_s, items, i, entry); ++i)
+ for (i = 0; VEC_iterate (probe_p, probes, i, probe); ++i)
{
- size_name = max (strlen (entry->probe->name), size_name);
- size_provider = max (strlen (entry->probe->provider), size_provider);
- size_objname = max (strlen (entry->objfile->name), size_objname);
+ size_name = max (strlen (probe->name), size_name);
+ size_provider = max (strlen (probe->provider), size_provider);
+ size_objname = max (strlen (probe->objfile->name), size_objname);
}
ui_out_table_header (current_uiout, size_provider, ui_left, "provider",
@@ -601,26 +575,26 @@
/* We have to generate the table header for each new probe type that we
will print. */
for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po); ++ix)
- gen_ui_out_table_header_info (items, po);
+ gen_ui_out_table_header_info (probes, po);
}
else
- gen_ui_out_table_header_info (items, pops);
+ gen_ui_out_table_header_info (probes, pops);
ui_out_table_header (current_uiout, size_objname, ui_left, "object",
_("Object"));
ui_out_table_body (current_uiout);
- for (i = 0; VEC_iterate (probe_and_objfile_s, items, i, entry); ++i)
+ for (i = 0; VEC_iterate (probe_p, probes, i, probe); ++i)
{
struct cleanup *inner;
inner = make_cleanup_ui_out_tuple_begin_end (current_uiout, "probe");
- ui_out_field_string (current_uiout, "provider", entry->probe->provider);
- ui_out_field_string (current_uiout, "name", entry->probe->name);
+ ui_out_field_string (current_uiout, "provider", probe->provider);
+ ui_out_field_string (current_uiout, "name", probe->name);
ui_out_field_core_addr (current_uiout, "addr",
- get_objfile_arch (entry->objfile),
- entry->probe->address);
+ get_objfile_arch (probe->objfile),
+ probe->address);
if (pops == NULL)
{
@@ -629,19 +603,19 @@
for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po);
++ix)
- if (entry->probe->pops == po)
- print_ui_out_info (entry);
+ if (probe->pops == po)
+ print_ui_out_info (probe);
}
else
- print_ui_out_info (entry);
+ print_ui_out_info (probe);
- ui_out_field_string (current_uiout, "object", entry->objfile->name);
+ ui_out_field_string (current_uiout, "object", probe->objfile->name);
ui_out_text (current_uiout, "\n");
do_cleanups (inner);
}
- any_found = !VEC_empty (probe_and_objfile_s, items);
+ any_found = !VEC_empty (probe_p, probes);
do_cleanups (cleanup);
if (!any_found)
@@ -662,23 +636,24 @@
probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n)
{
struct probe *probe;
- struct objfile *objfile;
+ const struct sym_probe_fns *probe_fns;
unsigned n_probes;
- probe = find_probe_by_pc (get_frame_pc (frame), &objfile);
+ probe = find_probe_by_pc (get_frame_pc (frame));
if (!probe)
return NULL;
- gdb_assert (objfile->sf && objfile->sf->sym_probe_fns);
- n_probes
- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
- probe);
+ gdb_assert (probe->objfile != NULL);
+ gdb_assert (probe->objfile->sf != NULL);
+ gdb_assert (probe->objfile->sf->sym_probe_fns != NULL);
+
+ probe_fns = probe->objfile->sf->sym_probe_fns;
+ n_probes = probe_fns->sym_get_probe_argument_count (probe);
+
if (n >= n_probes)
return NULL;
- return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile,
- probe,
- n);
+ return probe_fns->sym_evaluate_probe_argument (probe, n);
}
/* See comment in probe.h. */
--- src/gdb/probe.h 2012/04/27 20:47:55 1.1
+++ src/gdb/probe.h 2012/07/18 16:12:17 1.2
@@ -66,21 +66,18 @@
/* Return the number of arguments of PROBE. */
- unsigned (*get_probe_argument_count) (struct probe *probe,
- struct objfile *objfile);
+ unsigned (*get_probe_argument_count) (struct probe *probe);
/* Evaluate the Nth argument from the PROBE, returning a value
corresponding to it. The argument number is represented N. */
struct value *(*evaluate_probe_argument) (struct probe *probe,
- struct objfile *objfile,
unsigned n);
/* Compile the Nth argument of the PROBE to an agent expression.
The argument number is represented by N. */
- void (*compile_to_ax) (struct probe *probe, struct objfile *objfile,
- struct agent_expr *aexpr,
+ void (*compile_to_ax) (struct probe *probe, struct agent_expr *aexpr,
struct axs_value *axs_value, unsigned n);
/* Set the semaphore associated with the PROBE. This function only makes
@@ -108,8 +105,8 @@
void (*gen_info_probes_table_header) (VEC (info_probe_column_s) **heads);
/* Function that will fill VALUES with the values of the extra fields
- to be printed for PROBE and OBJFILE. If the backend implements
- the `gen_ui_out_table_header' method, then it should implement
+ to be printed for PROBE. If the backend implements the
+ `gen_ui_out_table_header' method, then it should implement
this method as well. The backend should also guarantee that the
order and the number of values in the vector is exactly the same
as the order of the extra fields provided in the method
@@ -118,7 +115,6 @@
position in the vector. */
void (*gen_info_probes_table_values) (struct probe *probe,
- struct objfile *objfile,
VEC (const_char_ptr) **values);
};
@@ -157,6 +153,11 @@
/* The operations associated with this probe. */
const struct probe_ops *pops;
+ /* The objfile which contains this probe. Even if the probe is also
+ present in a separate debug objfile, this variable always points to
+ the non-separate debug objfile. */
+ struct objfile *objfile;
+
/* The name of the probe. */
const char *name;
@@ -181,11 +182,9 @@
extern void register_probe_ops (struct probe *probe);
/* Given a PC, find an associated probe with type PTYPE. If a probe is
- found, set *OBJFILE_OUT to the probe's objfile, and return the
- probe. If no probe is found, return NULL. */
+ found, return it. If no probe is found, return NULL. */
-extern struct probe *find_probe_by_pc (CORE_ADDR pc,
- struct objfile **objfile_out);
+extern struct probe *find_probe_by_pc (CORE_ADDR pc);
/* Search OBJFILE for a probe with the given PROVIDER, NAME and PTYPE.
Return a VEC of all probes that were found. If no matching probe
--- src/gdb/stap-probe.c 2012/05/08 01:35:35 1.4
+++ src/gdb/stap-probe.c 2012/07/18 16:12:17 1.5
@@ -903,10 +903,10 @@
this information. */
static void
-stap_parse_probe_arguments (struct stap_probe *probe, struct objfile *objfile)
+stap_parse_probe_arguments (struct stap_probe *probe)
{
const char *cur;
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ struct gdbarch *gdbarch = get_objfile_arch (probe->p.objfile);
gdb_assert (!probe->args_parsed);
cur = probe->args_u.text;
@@ -991,15 +991,14 @@
argument string. */
static unsigned
-stap_get_probe_argument_count (struct probe *probe_generic,
- struct objfile *objfile)
+stap_get_probe_argument_count (struct probe *probe_generic)
{
struct stap_probe *probe = (struct stap_probe *) probe_generic;
gdb_assert (probe_generic->pops == &stap_probe_ops);
if (!probe->args_parsed)
- stap_parse_probe_arguments (probe, objfile);
+ stap_parse_probe_arguments (probe);
gdb_assert (probe->args_parsed);
return VEC_length (stap_probe_arg_s, probe->args_u.vec);
@@ -1042,10 +1041,10 @@
}
static struct stap_probe_arg *
-stap_get_arg (struct stap_probe *probe, struct objfile *objfile, unsigned n)
+stap_get_arg (struct stap_probe *probe, unsigned n)
{
if (!probe->args_parsed)
- stap_parse_probe_arguments (probe, objfile);
+ stap_parse_probe_arguments (probe);
return VEC_index (stap_probe_arg_s, probe->args_u.vec, n);
}
@@ -1054,8 +1053,7 @@
corresponding to it. Assertion is thrown if N does not exist. */
static struct value *
-stap_evaluate_probe_argument (struct probe *probe_generic,
- struct objfile *objfile, unsigned n)
+stap_evaluate_probe_argument (struct probe *probe_generic, unsigned n)
{
struct stap_probe *stap_probe = (struct stap_probe *) probe_generic;
struct stap_probe_arg *arg;
@@ -1063,7 +1061,7 @@
gdb_assert (probe_generic->pops == &stap_probe_ops);
- arg = stap_get_arg (stap_probe, objfile, n);
+ arg = stap_get_arg (stap_probe, n);
return evaluate_subexp_standard (arg->atype, arg->aexpr, &pos, EVAL_NORMAL);
}
@@ -1071,9 +1069,8 @@
Assertion is thrown if N does not exist. */
static void
-stap_compile_to_ax (struct probe *probe_generic, struct objfile *objfile,
- struct agent_expr *expr, struct axs_value *value,
- unsigned n)
+stap_compile_to_ax (struct probe *probe_generic, struct agent_expr *expr,
+ struct axs_value *value, unsigned n)
{
struct stap_probe *stap_probe = (struct stap_probe *) probe_generic;
struct stap_probe_arg *arg;
@@ -1081,7 +1078,7 @@
gdb_assert (probe_generic->pops == &stap_probe_ops);
- arg = stap_get_arg (stap_probe, objfile, n);
+ arg = stap_get_arg (stap_probe, n);
pc = arg->aexpr->elts;
gen_expr (arg->aexpr, &pc, expr, value);
@@ -1124,20 +1121,24 @@
struct frame_info *frame = get_selected_frame (_("No frame selected"));
CORE_ADDR pc = get_frame_pc (frame);
int sel = (int) (uintptr_t) data;
- struct objfile *objfile;
struct probe *pc_probe;
+ const struct sym_probe_fns *pc_probe_fns;
unsigned n_args;
/* SEL == -1 means "_probe_argc". */
gdb_assert (sel >= -1);
- pc_probe = find_probe_by_pc (pc, &objfile);
+ pc_probe = find_probe_by_pc (pc);
if (pc_probe == NULL)
error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc));
- n_args
- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
- pc_probe);
+ gdb_assert (pc_probe->objfile != NULL);
+ gdb_assert (pc_probe->objfile->sf != NULL);
+ gdb_assert (pc_probe->objfile->sf->sym_probe_fns != NULL);
+
+ pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns;
+
+ n_args = pc_probe_fns->sym_get_probe_argument_count (pc_probe);
if (sel == -1)
return value_from_longest (builtin_type (arch)->builtin_int, n_args);
@@ -1145,9 +1146,7 @@
error (_("Invalid probe argument %d -- probe has %u arguments available"),
sel, n_args);
- return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile,
- pc_probe,
- sel);
+ return pc_probe_fns->sym_evaluate_probe_argument (pc_probe, sel);
}
/* This is called to compile one of the $_probe_arg* convenience
@@ -1159,20 +1158,25 @@
{
CORE_ADDR pc = expr->scope;
int sel = (int) (uintptr_t) data;
- struct objfile *objfile;
struct probe *pc_probe;
+ const struct sym_probe_fns *pc_probe_fns;
int n_probes;
/* SEL == -1 means "_probe_argc". */
gdb_assert (sel >= -1);
- pc_probe = find_probe_by_pc (pc, &objfile);
+ pc_probe = find_probe_by_pc (pc);
if (pc_probe == NULL)
error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc));
- n_probes
- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
- pc_probe);
+ gdb_assert (pc_probe->objfile != NULL);
+ gdb_assert (pc_probe->objfile->sf != NULL);
+ gdb_assert (pc_probe->objfile->sf->sym_probe_fns != NULL);
+
+ pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns;
+
+ n_probes = pc_probe_fns->sym_get_probe_argument_count (pc_probe);
+
if (sel == -1)
{
value->kind = axs_rvalue;
@@ -1186,8 +1190,7 @@
error (_("Invalid probe argument %d -- probe has %d arguments available"),
sel, n_probes);
- objfile->sf->sym_probe_fns->sym_compile_to_ax (objfile, pc_probe,
- expr, value, sel);
+ pc_probe_fns->sym_compile_to_ax (pc_probe, expr, value, sel);
}
@@ -1297,6 +1300,7 @@
ret = obstack_alloc (&objfile->objfile_obstack, sizeof (*ret));
ret->p.pops = &stap_probe_ops;
+ ret->p.objfile = objfile;
/* Provider and the name of the probe. */
ret->p.provider = &el->data[3 * size];
@@ -1481,15 +1485,16 @@
static void
stap_gen_info_probes_table_values (struct probe *probe_generic,
- struct objfile *objfile,
VEC (const_char_ptr) **ret)
{
struct stap_probe *probe = (struct stap_probe *) probe_generic;
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ struct gdbarch *gdbarch;
const char *val = NULL;
gdb_assert (probe_generic->pops == &stap_probe_ops);
+ gdbarch = get_objfile_arch (probe->p.objfile);
+
if (probe->sem_addr)
val = print_core_address (gdbarch, probe->sem_addr);
--- src/gdb/symfile.h 2012/05/24 22:14:35 1.109
+++ src/gdb/symfile.h 2012/07/18 16:12:17 1.110
@@ -320,8 +320,7 @@
have come from a call to this objfile's sym_get_probes method.
If you provide an implementation of sym_get_probes, you must
implement this method as well. */
- unsigned (*sym_get_probe_argument_count) (struct objfile *objfile,
- struct probe *probe);
+ unsigned (*sym_get_probe_argument_count) (struct probe *probe);
/* Evaluate the Nth argument available to PROBE. PROBE will have
come from a call to this objfile's sym_get_probes method. N will
@@ -330,8 +329,7 @@
PC will match the address of the probe. If you provide an
implementation of sym_get_probes, you must implement this method
as well. */
- struct value *(*sym_evaluate_probe_argument) (struct objfile *objfile,
- struct probe *probe,
+ struct value *(*sym_evaluate_probe_argument) (struct probe *probe,
unsigned n);
/* Compile the Nth probe argument to an agent expression. PROBE
@@ -339,8 +337,7 @@
method. N will be between 0 and the number of arguments
available to this probe. EXPR and VALUE are the agent expression
that is being updated. */
- void (*sym_compile_to_ax) (struct objfile *objfile,
- struct probe *probe,
+ void (*sym_compile_to_ax) (struct probe *probe,
struct agent_expr *expr,
struct axs_value *value,
unsigned n);

View File

@ -0,0 +1,74 @@
http://sourceware.org/ml/gdb-cvs/2012-07/msg00124.html
### src/gdb/ChangeLog 2012/07/18 16:12:15 1.14474
### src/gdb/ChangeLog 2012/07/18 16:20:36 1.14475
## -1,5 +1,10 @@
2012-07-18 Sergio Durigan Junior <sergiodj@redhat.com>
+ * probe.c (probe_safe_evaluate_at_pc): Rename variable `n_probes'.
+ * stap-probe.c (compile_probe_arg): Likewise.
+
+2012-07-18 Sergio Durigan Junior <sergiodj@redhat.com>
+
* elfread.c (elf_get_probe_argument_count): Remove `objfile' argument.
(elf_compile_to_ax): Likewise.
* infrun.c (insert_exception_resume_from_probe): Likewise.
--- src/gdb/probe.c 2012/07/18 16:12:17 1.4
+++ src/gdb/probe.c 2012/07/18 16:20:43 1.5
@@ -637,7 +637,7 @@
{
struct probe *probe;
const struct sym_probe_fns *probe_fns;
- unsigned n_probes;
+ unsigned n_args;
probe = find_probe_by_pc (get_frame_pc (frame));
if (!probe)
@@ -648,9 +648,9 @@
gdb_assert (probe->objfile->sf->sym_probe_fns != NULL);
probe_fns = probe->objfile->sf->sym_probe_fns;
- n_probes = probe_fns->sym_get_probe_argument_count (probe);
+ n_args = probe_fns->sym_get_probe_argument_count (probe);
- if (n >= n_probes)
+ if (n >= n_args)
return NULL;
return probe_fns->sym_evaluate_probe_argument (probe, n);
--- src/gdb/stap-probe.c 2012/07/18 16:12:17 1.5
+++ src/gdb/stap-probe.c 2012/07/18 16:20:43 1.6
@@ -1160,7 +1160,7 @@
int sel = (int) (uintptr_t) data;
struct probe *pc_probe;
const struct sym_probe_fns *pc_probe_fns;
- int n_probes;
+ int n_args;
/* SEL == -1 means "_probe_argc". */
gdb_assert (sel >= -1);
@@ -1175,20 +1175,20 @@
pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns;
- n_probes = pc_probe_fns->sym_get_probe_argument_count (pc_probe);
+ n_args = pc_probe_fns->sym_get_probe_argument_count (pc_probe);
if (sel == -1)
{
value->kind = axs_rvalue;
value->type = builtin_type (expr->gdbarch)->builtin_int;
- ax_const_l (expr, n_probes);
+ ax_const_l (expr, n_args);
return;
}
gdb_assert (sel >= 0);
- if (sel >= n_probes)
+ if (sel >= n_args)
error (_("Invalid probe argument %d -- probe has %d arguments available"),
- sel, n_probes);
+ sel, n_args);
pc_probe_fns->sym_compile_to_ax (pc_probe, expr, value, sel);
}

View File

@ -0,0 +1,98 @@
2012-07-19 Gary Benson <gbenson@redhat.com>
* probe.h (get_probe_argument_count): New declaration.
(evaluate_probe_argument): Likewise.
* probe.c (get_probe_argument_count): New function.
(evaluate_probe_argument): Likewise.
(probe_safe_evaluate_at_pc): Use the above new functions.
diff --git a/gdb/probe.h b/gdb/probe.h
index 8d44ca2..1d29b87 100644
--- a/gdb/probe.h
+++ b/gdb/probe.h
@@ -214,6 +214,16 @@ extern void info_probes_for_ops (char *arg, int from_tty,
extern struct cmd_list_element **info_probes_cmdlist_get (void);
+/* Return the argument count of the specified probe. */
+
+extern unsigned get_probe_argument_count (struct probe *probe);
+
+/* Evaluate argument N of the specified probe. N must be between 0
+ inclusive and get_probe_argument_count exclusive. */
+
+extern struct value *evaluate_probe_argument (struct probe *probe,
+ unsigned n);
+
/* A convenience function that finds a probe at the PC in FRAME and
evaluates argument N, with 0 <= N < number_of_args. If there is no
probe at that location, or if the probe does not have enough arguments,
diff --git a/gdb/probe.c b/gdb/probe.c
index 77f3b13..a61f4ea 100644
--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -632,28 +632,55 @@ info_probes_command (char *arg, int from_tty)
/* See comments in probe.h. */
+unsigned
+get_probe_argument_count (struct probe *probe)
+{
+ const struct sym_probe_fns *probe_fns;
+
+ gdb_assert (probe->objfile != NULL);
+ gdb_assert (probe->objfile->sf != NULL);
+
+ probe_fns = probe->objfile->sf->sym_probe_fns;
+
+ gdb_assert (probe_fns != NULL);
+
+ return probe_fns->sym_get_probe_argument_count (probe);
+}
+
+/* See comments in probe.h. */
+
+struct value *
+evaluate_probe_argument (struct probe *probe, unsigned n)
+{
+ const struct sym_probe_fns *probe_fns;
+
+ gdb_assert (probe->objfile != NULL);
+ gdb_assert (probe->objfile->sf != NULL);
+
+ probe_fns = probe->objfile->sf->sym_probe_fns;
+
+ gdb_assert (probe_fns != NULL);
+
+ return probe_fns->sym_evaluate_probe_argument (probe, n);
+}
+
+/* See comments in probe.h. */
+
struct value *
probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n)
{
struct probe *probe;
- const struct sym_probe_fns *probe_fns;
unsigned n_args;
probe = find_probe_by_pc (get_frame_pc (frame));
if (!probe)
return NULL;
- gdb_assert (probe->objfile != NULL);
- gdb_assert (probe->objfile->sf != NULL);
- gdb_assert (probe->objfile->sf->sym_probe_fns != NULL);
-
- probe_fns = probe->objfile->sf->sym_probe_fns;
- n_args = probe_fns->sym_get_probe_argument_count (probe);
-
+ n_args = get_probe_argument_count (probe);
if (n >= n_args)
return NULL;
- return probe_fns->sym_evaluate_probe_argument (probe, n);
+ return evaluate_probe_argument (probe, n);
}
/* See comment in probe.h. */

View File

@ -0,0 +1,131 @@
2012-07-19 Gary Benson <gbenson@redhat.com>
* solib-svr4.c (svr4_info): Move earlier.
(solib_svr4_pspace_data): Likewise.
(svr4_pspace_data_cleanup): Likewise.
(get_svr4_info): Likewise.
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 307e483..c88b9cb 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -106,6 +106,59 @@ static const char * const main_name_list[] =
NULL
};
+/* Per pspace SVR4 specific data. */
+
+struct svr4_info
+{
+ CORE_ADDR debug_base; /* Base of dynamic linker structures. */
+
+ /* Validity flag for debug_loader_offset. */
+ int debug_loader_offset_p;
+
+ /* Load address for the dynamic linker, inferred. */
+ CORE_ADDR debug_loader_offset;
+
+ /* Name of the dynamic linker, valid if debug_loader_offset_p. */
+ char *debug_loader_name;
+
+ /* Load map address for the main executable. */
+ CORE_ADDR main_lm_addr;
+
+ CORE_ADDR interp_text_sect_low;
+ CORE_ADDR interp_text_sect_high;
+ CORE_ADDR interp_plt_sect_low;
+ CORE_ADDR interp_plt_sect_high;
+};
+
+/* Per-program-space data key. */
+static const struct program_space_data *solib_svr4_pspace_data;
+
+static void
+svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
+{
+ struct svr4_info *info;
+
+ info = program_space_data (pspace, solib_svr4_pspace_data);
+ xfree (info);
+}
+
+/* Get the current svr4 data. If none is found yet, add it now. This
+ function always returns a valid object. */
+
+static struct svr4_info *
+get_svr4_info (void)
+{
+ struct svr4_info *info;
+
+ info = program_space_data (current_program_space, solib_svr4_pspace_data);
+ if (info != NULL)
+ return info;
+
+ info = XZALLOC (struct svr4_info);
+ set_program_space_data (current_program_space, solib_svr4_pspace_data, info);
+ return info;
+}
+
/* Return non-zero if GDB_SO_NAME and INFERIOR_SO_NAME represent
the same shared library. */
@@ -291,59 +344,6 @@ lm_addr_check (struct so_list *so, bfd *abfd)
return so->lm_info->l_addr;
}
-/* Per pspace SVR4 specific data. */
-
-struct svr4_info
-{
- CORE_ADDR debug_base; /* Base of dynamic linker structures. */
-
- /* Validity flag for debug_loader_offset. */
- int debug_loader_offset_p;
-
- /* Load address for the dynamic linker, inferred. */
- CORE_ADDR debug_loader_offset;
-
- /* Name of the dynamic linker, valid if debug_loader_offset_p. */
- char *debug_loader_name;
-
- /* Load map address for the main executable. */
- CORE_ADDR main_lm_addr;
-
- CORE_ADDR interp_text_sect_low;
- CORE_ADDR interp_text_sect_high;
- CORE_ADDR interp_plt_sect_low;
- CORE_ADDR interp_plt_sect_high;
-};
-
-/* Per-program-space data key. */
-static const struct program_space_data *solib_svr4_pspace_data;
-
-static void
-svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
-{
- struct svr4_info *info;
-
- info = program_space_data (pspace, solib_svr4_pspace_data);
- xfree (info);
-}
-
-/* Get the current svr4 data. If none is found yet, add it now. This
- function always returns a valid object. */
-
-static struct svr4_info *
-get_svr4_info (void)
-{
- struct svr4_info *info;
-
- info = program_space_data (current_program_space, solib_svr4_pspace_data);
- if (info != NULL)
- return info;
-
- info = XZALLOC (struct svr4_info);
- set_program_space_data (current_program_space, solib_svr4_pspace_data, info);
- return info;
-}
-
/* Local function prototypes */
static int match_main (const char *);

View File

@ -0,0 +1,17 @@
2012-07-19 Gary Benson <gbenson@redhat.com>
* solib-svr4.c (svr4_info): Made debug_loader_offset_p a bitfield.
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index c88b9cb..8e41f19 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -113,7 +113,7 @@ struct svr4_info
CORE_ADDR debug_base; /* Base of dynamic linker structures. */
/* Validity flag for debug_loader_offset. */
- int debug_loader_offset_p;
+ unsigned int debug_loader_offset_p : 1;
/* Load address for the dynamic linker, inferred. */
CORE_ADDR debug_loader_offset;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,147 @@
2012-07-30 Gary Benson <gbenson@redhat.com>
* objfiles.h (inhibit_section_map_updates): New function
declaration.
(resume_section_map_updates): Likewise.
(resume_section_map_updates_cleanup): Likewise.
* objfiles.c (objfile_pspace_info): New field "inhibit_updates".
(find_pc_section): Do not update the section map if
inhibit_updates is set.
(inhibit_section_map_updates): New function.
(resume_section_map_updates): Likewise.
(resume_section_map_updates_cleanup): Likewise.
* solib-svr4.c (svr4_handle_solib_event): Inhibit section map
updates for calls to evaluate_probe_argument.
Index: gdb-7.4.91.20120814/gdb/objfiles.h
===================================================================
--- gdb-7.4.91.20120814.orig/gdb/objfiles.h 2012-08-14 17:16:54.000000000 +0200
+++ gdb-7.4.91.20120814/gdb/objfiles.h 2012-08-14 17:20:55.913174609 +0200
@@ -526,6 +526,22 @@ extern void set_objfile_data (struct obj
extern void *objfile_data (struct objfile *objfile,
const struct objfile_data *data);
+/* In normal use, the section map will be rebuilt by FIND_PC_SECTION
+ if objfiles have been added, removed or relocated since it was last
+ called. Calling INHIBIT_SECTION_MAP_UPDATES will inhibit this
+ behavior until RESUME_SECTION_MAP_UPDATES is called. If you call
+ INHIBIT_SECTION_MAP_UPDATES you must ensure that every call to
+ FIND_PC_SECTION in the inhibited region relates to a section that
+ is already in the section map and has not since been removed or
+ relocated. */
+extern void inhibit_section_map_updates (void);
+
+/* Resume automatically rebuilding the section map as required. */
+extern void resume_section_map_updates (void);
+
+/* Version of the above suitable for use as a cleanup. */
+extern void resume_section_map_updates_cleanup (void *arg);
+
extern void default_iterate_over_objfiles_in_search_order
(struct gdbarch *gdbarch,
iterate_over_objfiles_in_search_order_cb_ftype *cb,
Index: gdb-7.4.91.20120814/gdb/objfiles.c
===================================================================
--- gdb-7.4.91.20120814.orig/gdb/objfiles.c 2012-08-14 17:16:55.000000000 +0200
+++ gdb-7.4.91.20120814/gdb/objfiles.c 2012-08-14 17:20:55.915174609 +0200
@@ -70,6 +70,9 @@ struct objfile_pspace_info
int objfiles_changed_p;
struct obj_section **sections;
int num_sections;
+
+ /* Nonzero if section map updates should be inhibited. */
+ int inhibit_updates;
};
/* Per-program-space data key. */
@@ -1295,7 +1298,7 @@ find_pc_section (CORE_ADDR pc)
return s;
pspace_info = get_objfile_pspace_data (current_program_space);
- if (pspace_info->objfiles_changed_p != 0)
+ if (pspace_info->objfiles_changed_p && !pspace_info->inhibit_updates)
{
update_section_map (current_program_space,
&pspace_info->sections,
@@ -1463,6 +1466,30 @@ objfiles_changed (void)
get_objfile_pspace_data (current_program_space)->objfiles_changed_p = 1;
}
+/* See comments in objfiles.h. */
+
+void
+inhibit_section_map_updates (void)
+{
+ get_objfile_pspace_data (current_program_space)->inhibit_updates = 1;
+}
+
+/* See comments in objfiles.h. */
+
+void
+resume_section_map_updates (void)
+{
+ get_objfile_pspace_data (current_program_space)->inhibit_updates = 0;
+}
+
+/* See comments in objfiles.h. */
+
+void
+resume_section_map_updates_cleanup (void *arg)
+{
+ resume_section_map_updates ();
+}
+
/* The default implementation for the "iterate_over_objfiles_in_search_order"
gdbarch method. It is equivalent to use the ALL_OBJFILES macro,
searching the objfiles in the order they are stored internally,
Index: gdb-7.4.91.20120814/gdb/solib-svr4.c
===================================================================
--- gdb-7.4.91.20120814.orig/gdb/solib-svr4.c 2012-08-14 17:20:42.000000000 +0200
+++ gdb-7.4.91.20120814/gdb/solib-svr4.c 2012-08-14 17:21:14.090169216 +0200
@@ -1847,6 +1847,7 @@ svr4_handle_solib_event (bpstat bs)
struct svr4_info *info = get_svr4_info ();
struct probe_and_info buf, *pi = &buf;
enum probe_action action;
+ struct cleanup *cleanups = NULL;
struct value *val;
LONGEST lmid;
CORE_ADDR debug_base, lm = 0;
@@ -1870,6 +1871,19 @@ svr4_handle_solib_event (bpstat bs)
if (action == NAMESPACE_NO_ACTION)
return;
+ /* EVALUATE_PROBE_ARGUMENT looks up symbols in the dynamic linker
+ using FIND_PC_SECTION. FIND_PC_SECTION is accelerated by a cache
+ called the section map. The section map is invalidated every
+ time a shared library is loaded or unloaded, and if the inferior
+ is generating a lot of shared library events then the section map
+ will be updated every time SVR4_HANDLE_SOLIB_EVENT is called.
+ We called FIND_PC_SECTION in SVR4_CREATE_SOLIB_EVENT_BREAKPOINTS,
+ so we can guarantee that the dynamic linker's sections are in the
+ section map. We can therefore inhibit section map updates across
+ these calls to EVALUATE_PROBE_ARGUMENT and save a lot of time. */
+ inhibit_section_map_updates ();
+ cleanups = make_cleanup (resume_section_map_updates_cleanup, NULL);
+
val = evaluate_probe_argument (pi->probe, 0);
if (val == NULL)
goto error;
@@ -1901,6 +1915,9 @@ svr4_handle_solib_event (bpstat bs)
action = NAMESPACE_RELOAD;
}
+ do_cleanups (cleanups);
+ cleanups = NULL;
+
if (action == NAMESPACE_UPDATE_OR_RELOAD)
{
if (namespace_update_incremental (info, lmid, lm, is_initial_ns))
@@ -1923,6 +1940,8 @@ svr4_handle_solib_event (bpstat bs)
warning (_("Probes-based dynamic linker interface failed.\n"
"Reverting to original interface.\n"));
+ if (cleanups != NULL)
+ do_cleanups (cleanups);
free_namespace_table (info);
free_probes (info);
info->using_probes = 0;

View File

@ -4,10 +4,10 @@ Date: Mon Aug 8 12:08:53 2011 +0200
+testcase +testcase
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c Index: gdb-7.4.50.20120714/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c 2012-06-02 20:03:42.711393776 +0200 +++ gdb-7.4.50.20120714/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c 2012-07-15 08:51:38.238701282 +0200
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -49,10 +49,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c
+ i = pthread_join (t, NULL); + i = pthread_join (t, NULL);
+ assert (i == 0); + assert (i == 0);
+} +}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.c Index: gdb-7.4.50.20120714/gdb/testsuite/gdb.threads/dlopen-libpthread.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.c 2012-06-02 20:03:42.712393775 +0200 +++ gdb-7.4.50.20120714/gdb/testsuite/gdb.threads/dlopen-libpthread.c 2012-07-15 08:51:38.239701277 +0200
@@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -100,10 +100,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.c
+ +
+ return 0; + return 0;
+} +}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.exp Index: gdb-7.4.50.20120714/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.exp 2012-06-02 20:03:42.724393771 +0200 +++ gdb-7.4.50.20120714/gdb/testsuite/gdb.threads/dlopen-libpthread.exp 2012-07-15 09:08:01.760258588 +0200
@@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
+# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc.
+# +#
@ -148,12 +148,12 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
+ return -1 + return -1
+} +}
+ +
+set test "print _dl_debug_notify" +set test "info probes all rtld rtld_map_complete"
+gdb_test_multiple $test $test { +gdb_test_multiple $test $test {
+ -re " 0x\[0-9a-f\]+ <_dl_debug_notify>\r\n$gdb_prompt $" { + -re "\[ \t\]rtld_map_complete\[ \t\]+0x\[0-9a-f\]+.*\r\n$gdb_prompt $" {
+ pass $test + pass $test
+ } + }
+ -re "No symbol \"_dl_debug_notify\" in current context\\.\r\n$gdb_prompt $" { + -re "No probes matched\\.\r\n$gdb_prompt $" {
+ xfail $test + xfail $test
+ untested ${testfile}.exp + untested ${testfile}.exp
+ return + return
@ -179,81 +179,80 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
+gdb_continue_to_breakpoint "notify" ".* notify-here .*" +gdb_continue_to_breakpoint "notify" ".* notify-here .*"
+ +
+gdb_test "info sharedlibrary" {/libpthread\.so.*} "libpthread.so found" +gdb_test "info sharedlibrary" {/libpthread\.so.*} "libpthread.so found"
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp Index: gdb-7.4.50.20120714/gdb/testsuite/lib/gdb.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/gdb.exp 2012-06-02 19:11:56.000000000 +0200 --- gdb-7.4.50.20120714.orig/gdb/testsuite/lib/gdb.exp 2012-07-15 08:51:36.803709222 +0200
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp 2012-06-02 20:03:42.727393770 +0200 +++ gdb-7.4.50.20120714/gdb/testsuite/lib/gdb.exp 2012-07-15 09:02:41.983028197 +0200
@@ -3693,30 +3693,49 @@ proc build_executable { testname executa @@ -3774,22 +3774,6 @@ proc build_executable_from_specs {testna
set sources ${executable}.c
} set binfile [standard_output_file $executable]
- set binfile ${objdir}/${subdir}/${executable}
-
- set objects {} - set objects {}
- for {set i 0} "\$i<[llength $sources]" {incr i} { - set i 0
- set s [lindex $sources $i] - foreach {s local_options} $args {
- if { [gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $options] != "" } { - if { [gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $local_options] != "" } {
- untested $testname - untested $testname
- return -1 - return -1
- } - }
- lappend objects "${binfile}${i}.o" - lappend objects "${binfile}${i}.o"
+ # get_compiler_info by gdb_compile_shlib and gdb_compile_shlib_pthreads. - incr i
+ set info_options "" - }
+ if { [lsearch -exact $options "c++"] >= 0 } {
+ set info_options "c++"
}
- -
- if { [gdb_compile $objects "${binfile}" executable $options] != "" } { - if { [gdb_compile $objects "${binfile}" executable $options] != "" } {
- untested $testname - untested $testname
+ if [get_compiler_info binfile_unused ${info_options}] { - return -1
- }
-
set info_options ""
if { [lsearch -exact $options "c++"] >= 0 } {
set info_options "c++"
@@ -3797,6 +3781,42 @@ proc build_executable_from_specs {testna
if [get_compiler_info ${info_options}] {
return -1 return -1
} }
+
- set info_options "" + set binfile [standard_output_file $executable]
- if { [lsearch -exact $options "c++"] >= 0 } {
- set info_options "c++"
+ set binfile ${objdir}/${subdir}/${executable}
+ +
+ set func gdb_compile + set func gdb_compile
+ set func_index [lsearch -regexp $options {^(pthreads|shlib|shlib_pthreads)$}] + set func_index [lsearch -regexp $options {^(pthreads|shlib|shlib_pthreads)$}]
+ if {$func_index != -1} { + if {$func_index != -1} {
+ set func "${func}_[lindex $options $func_index]" + set func "${func}_[lindex $options $func_index]"
} + }
- if [get_compiler_info ${binfile} ${info_options}] {
+ +
+ # gdb_compile_shlib and gdb_compile_shlib_pthreads do not use the 3rd + # gdb_compile_shlib and gdb_compile_shlib_pthreads do not use the 3rd
+ # parameter. They also requires $sources while gdb_compile and + # parameter. They also requires $sources while gdb_compile and
+ # gdb_compile_pthreads require $objects. + # gdb_compile_pthreads require $objects. Moreover they ignore any options.
+ if [string match gdb_compile_shlib* $func] { + if [string match gdb_compile_shlib* $func] {
+ set sources_path {} + set sources_path {}
+ foreach s $sources { + foreach {s local_options} $args {
+ lappend sources_path "${srcdir}/${subdir}/${s}" + lappend sources_path "${srcdir}/${subdir}/${s}"
+ } + }
+ set ret [$func $sources_path "${binfile}" $options] + set ret [$func $sources_path "${binfile}" $options]
+ } else { + } else {
+ set objects {} + set objects {}
+ for {set i 0} "\$i<[llength $sources]" {incr i} { + set i 0
+ set s [lindex $sources $i] + foreach {s local_options} $args {
+ if { [gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $options] != "" } { + if { [gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $local_options] != "" } {
+ untested $testname + untested $testname
+ return -1 + return -1
+ } + }
+ lappend objects "${binfile}${i}.o" + lappend objects "${binfile}${i}.o"
+ incr i
+ } + }
+ set ret [$func $objects "${binfile}" executable $options] + set ret [$func $objects "${binfile}" executable $options]
+ } + }
+ if { $ret != "" } { + if { $ret != "" } {
+ untested $testname + untested $testname
return -1 + return -1
} + }
+ +
return 0 return 0
} }
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/prelink-support.exp Index: gdb-7.4.50.20120714/gdb/testsuite/lib/prelink-support.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/prelink-support.exp 2012-01-04 09:27:56.000000000 +0100 --- gdb-7.4.50.20120714.orig/gdb/testsuite/lib/prelink-support.exp 2012-01-04 09:27:56.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/prelink-support.exp 2012-06-02 20:03:42.733393768 +0200 +++ gdb-7.4.50.20120714/gdb/testsuite/lib/prelink-support.exp 2012-07-15 08:51:38.243701254 +0200
@@ -95,8 +95,9 @@ proc file_copy {src dest} { @@ -95,8 +95,9 @@ proc file_copy {src dest} {
# Wrap function build_executable so that the resulting executable is fully # Wrap function build_executable so that the resulting executable is fully
# self-sufficient (without dependencies on system libraries). Parameter # self-sufficient (without dependencies on system libraries). Parameter
@ -306,104 +305,3 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/lib/prelink-support.exp
return $prelink_args return $prelink_args
} }
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/break-interp.exp
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/gdb.base/break-interp.exp 2012-02-24 15:09:08.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/break-interp.exp 2012-06-02 20:04:56.135369687 +0200
@@ -109,14 +109,21 @@ proc strip_debug {dest} {
}
}
+# Former symbol for solib changes notifications was _dl_debug_state, newer one
+# is dl_main (in fact _dl_debug_notify but it is inlined without any extra
+# debug info), the right one one traps by `set stop-on-solib-events 1'.
+
+set solib_bp {(_dl_debug_state|dl_main)}
+
# Implementation of reach.
proc reach_1 {func command displacement} {
- global gdb_prompt expect_out
+ global gdb_prompt expect_out solib_bp
- if {$func == "_dl_debug_state"} {
+ if {$func == $solib_bp} {
# Breakpoint on _dl_debug_state can have problems due to its overlap
# with the existing internal breakpoint from GDB.
+ # With also _dl_debug_notify we would need even two breakpoints.
gdb_test_no_output "set stop-on-solib-events 1"
} elseif {! [gdb_breakpoint $func allow-pending]} {
return
@@ -142,21 +149,21 @@ proc reach_1 {func command displacement}
exp_continue
}
-re "Breakpoint \[0-9\]+, \\.?(__GI_)?$func \\(.*\\) at .*:\[0-9\]+\r\n.*$gdb_prompt $" {
- if {$func == "_dl_debug_state"} {
+ if {$func == $solib_bp} {
fail $test
} else {
pass $test
}
}
-re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in \\.?(__GI_)?$func \\(\\).*\r\n$gdb_prompt $" {
- if {$func == "_dl_debug_state"} {
+ if {$func == $solib_bp} {
fail $test
} else {
pass $test
}
}
-re "Stopped due to (spurious )?shared library event.*\r\n$gdb_prompt $" {
- if {$func == "_dl_debug_state"} {
+ if {$func == $solib_bp} {
if {$debug_state_count == 0} {
# First stop does not yet relocate the _start function
# descriptor on ppc64.
@@ -175,7 +182,7 @@ proc reach_1 {func command displacement}
fail $test_displacement
}
- if {$func == "_dl_debug_state"} {
+ if {$func == $solib_bp} {
gdb_test_no_output "set stop-on-solib-events 0"
}
}
@@ -357,7 +364,7 @@ proc test_attach {file displacement {rel
}
proc test_ld {file ifmain trynosym displacement} {
- global srcdir subdir gdb_prompt expect_out inferior_exited_re
+ global srcdir subdir gdb_prompt expect_out inferior_exited_re solib_bp
# First test normal `file'-command loaded $FILE with symbols.
@@ -385,9 +392,9 @@ proc test_ld {file ifmain trynosym displ
gdb_test_no_output "set args ${objdir}/${subdir}/$binfile_test" "set args OBJDIR/${subdir}/$binfile_test"
}
- reach "_dl_debug_state" "run" $displacement
+ reach $solib_bp "run" $displacement
- gdb_test "bt" "#0 +\[^\r\n\]*\\m(__GI_)?_dl_debug_state\\M.*" "dl bt"
+ gdb_test "bt" "#0 +\[^\r\n\]*\\m(__GI_)?$solib_bp\\M.*" "dl bt"
if $ifmain {
reach "main" continue "NONE"
@@ -399,7 +406,7 @@ proc test_ld {file ifmain trynosym displ
# Try re-run if the new PIE displacement takes effect.
gdb_test "kill" "" "kill" {Kill the program being debugged\? \(y or n\) } "y"
- reach "_dl_debug_state" "run" $displacement
+ reach $solib_bp "run" $displacement
if $ifmain {
test_core $file $displacement
@@ -431,7 +438,7 @@ proc test_ld {file ifmain trynosym displ
gdb_test "exec-file $file" "exec-file $escapedfile" "load"
if $ifmain {
- reach "_dl_debug_state" run $displacement
+ reach $solib_bp run $displacement
# Use two separate gdb_test_multiple statements to avoid timeouts due
# to slow processing of wildcard capturing long output

View File

@ -0,0 +1,69 @@
http://sourceware.org/ml/gdb-patches/2012-08/msg00500.html
Subject: [patch] testsuite: Make solib-corrupted.exp untested for probes [Re: [RFA 0/4 take 2] Improved linker-debugger interface]
On Fri, 17 Aug 2012 22:53:53 +0200, Jan Kratochvil wrote:
> It regresses with glibc-debuginfo installed:
>
> info sharedlibrary^M
> From To Syms Read Shared Object Library^M
> 0x00007ffff7ddcb20 0x00007ffff7df63d9 Yes /lib64/ld-linux-x86-64.so.2^M
> 0x00007ffff7ae05b0 0x00007ffff7b4ad78 Yes /lib64/libm.so.6^M
> 0x00007ffff77431a0 0x00007ffff7883cf0 Yes /lib64/libc.so.6^M
> (gdb) FAIL: gdb.base/solib-corrupted.exp: corrupted list
>
> But I guess there is no longer a way to test it with probes so it should just
> run some 'info probes' and make this test UNTESTED if rtld probes are
> available.
I had to implement it for Fedora already anyway.
Regards,
Jan
gdb/testsuite/
2012-08-18 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/solib-corrupted.exp: New variable probes.
(info probes): New test.
diff --git a/gdb/testsuite/gdb.base/solib-corrupted.exp b/gdb/testsuite/gdb.base/solib-corrupted.exp
index 84b3b0c..c9f55d6 100644
--- a/gdb/testsuite/gdb.base/solib-corrupted.exp
+++ b/gdb/testsuite/gdb.base/solib-corrupted.exp
@@ -36,6 +36,33 @@ if ![runto_main] {
return
}
+# With probes interface GDB no longer scans the inferior library list so its
+# corruption cannot be tested. There is no way to disable the probes
+# interface.
+
+set probes { init_start init_complete map_start reloc_complete unmap_start
+ unmap_complete }
+set test "info probes"
+gdb_test_multiple $test $test {
+ -re "^rtld\[ \t\]+(?:rtld_)?(\[a-z_\]+)\[ \t\]" {
+ set idx [lsearch -exact $probes $expect_out(1,string)]
+ if { $idx >= 0 } {
+ set probes [lreplace $probes $idx $idx]
+ }
+ exp_continue
+ }
+ -re "^\[^\r\n\]*\r\n" {
+ exp_continue
+ }
+ -re "^$gdb_prompt $" {
+ }
+}
+if { [llength $probes] == 0 } {
+ xfail $test
+ untested "GDB is using probes"
+ return
+}
+
gdb_test "info sharedlibrary" "From * To .*" "normal list"
# GDB checks there for matching L_PREV.

View File

@ -1,358 +0,0 @@
From: Gary Benson <gbenson@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Message-ID: <20110810133605.GB7294@redhat.com>
Index: gdb-7.4.50.20120602/gdb/infrun.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/infrun.c 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/infrun.c 2012-06-02 21:38:13.450440507 +0200
@@ -361,6 +361,13 @@ static struct symbol *step_start_functio
/* Nonzero if we want to give control to the user when we're notified
of shared library events by the dynamic linker. */
int stop_on_solib_events;
+
+static void
+set_stop_on_solib_events (char *args, int from_tty, struct cmd_list_element *c)
+{
+ update_solib_breakpoints ();
+}
+
static void
show_stop_on_solib_events (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -7267,7 +7274,7 @@ Show stopping for shared library events.
If nonzero, gdb will give control to the user when the dynamic linker\n\
notifies gdb of shared library events. The most common event of interest\n\
to the user would be loading/unloading of a new library."),
- NULL,
+ set_stop_on_solib_events,
show_stop_on_solib_events,
&setlist, &showlist);
Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solib-svr4.c 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/solib-svr4.c 2012-06-02 21:44:23.973298737 +0200
@@ -47,6 +47,8 @@
#include "auxv.h"
#include "exceptions.h"
+#include "probe.h"
+
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
static void svr4_relocate_main_executable (void);
@@ -92,6 +94,32 @@ static const char * const solib_break_na
NULL
};
+/* A list of SystemTap probes which, if present in the dynamic linker,
+ allow more fine-grained breakpoints to be placed on shared library
+ events. */
+
+struct probe_info
+ {
+ /* The name of the probe. */
+ const char *name;
+
+ /* Nonzero if this probe must be stopped at even when
+ stop-on-solib-events is off. */
+ int mandatory;
+ };
+
+static const struct probe_info probe_info[] =
+{
+ {"rtld_init_start", 0},
+ {"rtld_init_complete", 1},
+ {"rtld_map_start", 0},
+ {"rtld_reloc_complete", 1},
+ {"rtld_unmap_start", 0},
+ {"rtld_unmap_complete", 1},
+};
+
+#define NUM_PROBES (sizeof(probe_info) / sizeof(probe_info[0]))
+
static const char * const bkpt_names[] =
{
"_start",
@@ -313,6 +341,12 @@ struct svr4_info
CORE_ADDR interp_text_sect_high;
CORE_ADDR interp_plt_sect_low;
CORE_ADDR interp_plt_sect_high;
+
+ /* SystemTap probes. */
+ VEC (probe_p) *probes[NUM_PROBES];
+
+ /* Nonzero if we are using the SystemTap interface. */
+ int using_probes;
};
/* Per-program-space data key. */
@@ -322,8 +356,15 @@ static void
svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
{
struct svr4_info *info;
+ int i;
info = program_space_data (pspace, solib_svr4_pspace_data);
+ if (info == NULL)
+ return;
+
+ for (i = 0; i < NUM_PROBES; i++)
+ VEC_free (probe_p, info->probes[i]);
+
xfree (info);
}
@@ -1449,6 +1490,126 @@ exec_entry_point (struct bfd *abfd, stru
targ);
}
+/* Helper function for svr4_update_solib_event_breakpoints. */
+
+static int
+svr4_update_solib_event_breakpoint (struct breakpoint *b, void *arg)
+{
+ struct svr4_info *info = get_svr4_info ();
+ struct bp_location *loc;
+
+ if (b->type != bp_shlib_event)
+ return 0;
+
+ for (loc = b->loc; loc; loc = loc->next)
+ {
+ int i;
+
+ for (i = 0; i < NUM_PROBES; i++)
+ {
+ if (!probe_info[i].mandatory)
+ {
+ struct probe *probe;
+ int ix;
+
+ for (ix = 0;
+ VEC_iterate (probe_p, info->probes[i], ix, probe);
+ ++ix)
+ {
+ if (loc->pspace == current_program_space
+ && loc->address == probe->address)
+ {
+ b->enable_state =
+ stop_on_solib_events ? bp_enabled : bp_disabled;
+ return 0;
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* Enable or disable optional solib event breakpoints as appropriate.
+ Called whenever stop_on_solib_events is changed. */
+
+static void
+svr4_update_solib_event_breakpoints (void)
+{
+ struct svr4_info *info = get_svr4_info ();
+
+ if (info->using_probes)
+ iterate_over_breakpoints (svr4_update_solib_event_breakpoint, NULL);
+}
+
+/* Both the SunOS and the SVR4 dynamic linkers call a marker function
+ before and after mapping and unmapping shared libraries. The sole
+ purpose of this method is to allow debuggers to set a breakpoint so
+ they can track these changes.
+
+ Some versions of the glibc dynamic linker contain SystemTap probes
+ to allow more fine grained stopping. Given the address of the
+ original marker function, this function attempts to find these
+ probes, and if found, sets breakpoints on those instead. If the
+ probes aren't found, a single breakpoint is set on the original
+ SVR4 marker function. */
+
+static void
+svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch, CORE_ADDR address)
+{
+ struct svr4_info *info = get_svr4_info ();
+ struct obj_section *os;
+
+ os = find_pc_section (address);
+ if (os != NULL)
+ {
+ int all_probes_found = 1;
+ int i;
+
+ for (i = 0; i < NUM_PROBES; i++)
+ {
+ info->probes[i] = find_probes_in_objfile (os->objfile, "rtld",
+ probe_info[i].name);
+
+ if (!VEC_length(probe_p, info->probes[i]))
+ {
+ int j;
+
+ for (j = i - 1; j >= 0; j--)
+ {
+ VEC_free (probe_p, info->probes[j]);
+ info->probes[j] = NULL;
+ }
+
+ all_probes_found = 0;
+ break;
+ }
+ }
+
+ if (all_probes_found)
+ {
+ info->using_probes = 1;
+
+ for (i = 0; i < NUM_PROBES; i++)
+ {
+ struct probe *probe;
+ int ix;
+
+ for (ix = 0;
+ VEC_iterate (probe_p, info->probes[i], ix, probe);
+ ++ix)
+ create_solib_event_breakpoint (gdbarch, probe->address);
+ }
+
+ svr4_update_solib_event_breakpoints ();
+ return;
+ }
+ }
+
+ create_solib_event_breakpoint (gdbarch, address);
+}
+
/* Helper function for gdb_bfd_lookup_symbol. */
static int
@@ -1497,10 +1658,18 @@ enable_break (struct svr4_info *info, in
asection *interp_sect;
gdb_byte *interp_name;
CORE_ADDR sym_addr;
+ int i;
info->interp_text_sect_low = info->interp_text_sect_high = 0;
info->interp_plt_sect_low = info->interp_plt_sect_high = 0;
+ for (i = 0; i < NUM_PROBES; i++)
+ {
+ VEC_free (probe_p, info->probes[i]);
+ info->probes[i] = NULL;
+ }
+ info->using_probes = 0;
+
/* If we already have a shared library list in the target, and
r_debug contains r_brk, set the breakpoint there - this should
mean r_brk has already been relocated. Assume the dynamic linker
@@ -1532,7 +1701,7 @@ enable_break (struct svr4_info *info, in
That knowledge is encoded in the address, if it's Thumb the low bit
is 1. However, we've stripped that info above and it's not clear
what all the consequences are of passing a non-addr_bits_remove'd
- address to create_solib_event_breakpoint. The call to
+ address to svr4_create_solib_event_breakpoints. The call to
find_pc_section verifies we know about the address and have some
hope of computing the right kind of breakpoint to use (via
symbol info). It does mean that GDB needs to be pointed at a
@@ -1570,7 +1739,7 @@ enable_break (struct svr4_info *info, in
+ bfd_section_size (tmp_bfd, interp_sect);
}
- create_solib_event_breakpoint (target_gdbarch, sym_addr);
+ svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr);
return 1;
}
}
@@ -1725,7 +1894,8 @@ enable_break (struct svr4_info *info, in
if (sym_addr != 0)
{
- create_solib_event_breakpoint (target_gdbarch, load_addr + sym_addr);
+ svr4_create_solib_event_breakpoints (target_gdbarch,
+ load_addr + sym_addr);
xfree (interp_name);
return 1;
}
@@ -1751,7 +1921,7 @@ enable_break (struct svr4_info *info, in
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
sym_addr,
&current_target);
- create_solib_event_breakpoint (target_gdbarch, sym_addr);
+ svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr);
return 1;
}
}
@@ -1767,7 +1937,7 @@ enable_break (struct svr4_info *info, in
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
sym_addr,
&current_target);
- create_solib_event_breakpoint (target_gdbarch, sym_addr);
+ svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr);
return 1;
}
}
@@ -2543,4 +2713,5 @@ _initialize_svr4_solib (void)
svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol;
svr4_so_ops.same = svr4_same;
svr4_so_ops.keep_data_in_core = svr4_keep_data_in_core;
+ svr4_so_ops.update_breakpoints = svr4_update_solib_event_breakpoints;
}
Index: gdb-7.4.50.20120602/gdb/solib.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solib.c 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/solib.c 2012-06-02 21:38:13.455440507 +0200
@@ -1216,6 +1216,18 @@ no_shared_libraries (char *ignored, int
objfile_purge_solibs ();
}
+/* Enable or disable optional solib event breakpoints as appropriate. */
+
+void
+update_solib_breakpoints (void)
+{
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
+
+ if (ops->update_breakpoints != NULL)
+ ops->update_breakpoints ();
+}
+
+
/* Reload shared libraries, but avoid reloading the same symbol file
we already have loaded. */
Index: gdb-7.4.50.20120602/gdb/solib.h
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solib.h 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/solib.h 2012-06-02 21:38:13.464440503 +0200
@@ -91,4 +91,8 @@ extern CORE_ADDR gdb_bfd_lookup_symbol_f
void *),
void *data);
+/* Enable or disable optional solib event breakpoints as appropriate. */
+
+extern void update_solib_breakpoints (void);
+
#endif /* SOLIB_H */
Index: gdb-7.4.50.20120602/gdb/solist.h
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solist.h 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/solist.h 2012-06-02 21:38:13.465440503 +0200
@@ -149,6 +149,13 @@ struct target_so_ops
core file (in particular, for readonly sections). */
int (*keep_data_in_core) (CORE_ADDR vaddr,
unsigned long size);
+
+ /* Enable or disable optional solib event breakpoints as
+ appropriate. This should be called whenever
+ stop_on_solib_events is changed. This pointer can be
+ NULL, in which case no enabling or disabling is necessary
+ for this target. */
+ void (*update_breakpoints) (void);
};
/* Free the memory associated with a (so_list *). */

888
gdb-entryval-inlined.patch Normal file
View File

@ -0,0 +1,888 @@
http://sourceware.org/ml/gdb-patches/2012-10/msg00095.html
Subject: [patch] entry values: Fix resolving in inlined frames
Hi,
Breakpoint 1, fn2 (y=<optimized out>, x=6) at gdb.arch/amd64-entry-value-inline.c:32
32 y = -2 + x; /* break-here */
(gdb) info addr y
(gdb) bt
#0 fn2 (y=<optimized out>, x=6) at gdb.arch/amd64-entry-value-inline.c:32
#1 fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42
#2 0x00000000004004af in main () at gdb.arch/amd64-entry-value-inline.c:48
(gdb) info frame
Stack level 0, frame at 0x7fffffffdb68:
rip = 0x4005bc in fn2 (gdb.arch/amd64-entry-value-inline.c:32); saved rip 0x4004af
inlined into frame 1
[...]
(gdb) set debug entry-values 1
(gdb) p y
DW_OP_GNU_entry_value resolving expects callee fn1 at 0x4005a0 but the called frame is for fn3 at 0x4005b0
FAIL:
-----
$1 = <optimized out>
PASS:
-----
$1 = 25
(gdb) p/x $pc
$2 = 0x4005bc
(gdb) up
#1 fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42
(gdb) p/x $pc
$3 = 0x4005bc
The problem is that DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value binding
exists between DW_TAG_subprogram, nor DW_TAG_inlined_subroutine as described
by Jakub Jelinek. This makes sense, when we look at DW_TAG_GNU_call_site and
we just unwind the current inlined frame we get the same PC - this is no new
information.
TAILCALL_FRAME is a different case, while also an artificial frame the
sequence cannot be determined at compile time and the binding
DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value exists also for
TAILCALL_FRAMEs.
I will check it in.
No regressions on {x86_64,x86_64-m32,i686}-fedora18-linux-gnu.
Thanks,
Jan
gdb/
2012-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix entry values resolving in inlined frames.
* dwarf2loc.c (dwarf_expr_reg_to_entry_parameter): Move func_addr,
gdbarch and caller_frame initialization later. Skip INLINE_FRAME
entries of FRAME.
gdb/testsuite/
2012-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix entry values resolving in inlined frames.
* gdb.arch/amd64-entry-value-inline.S: New file.
* gdb.arch/amd64-entry-value-inline.c: New file.
* gdb.arch/amd64-entry-value-inline.exp: New file.
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index e8d39fe..0bdc042 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -980,16 +980,27 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
union call_site_parameter_u kind_u,
struct dwarf2_per_cu_data **per_cu_return)
{
- CORE_ADDR func_addr = get_frame_func (frame);
- CORE_ADDR caller_pc;
- struct gdbarch *gdbarch = get_frame_arch (frame);
- struct frame_info *caller_frame = get_prev_frame (frame);
+ CORE_ADDR func_addr, caller_pc;
+ struct gdbarch *gdbarch;
+ struct frame_info *caller_frame;
struct call_site *call_site;
int iparams;
/* Initialize it just to avoid a GCC false warning. */
struct call_site_parameter *parameter = NULL;
CORE_ADDR target_addr;
+ /* Skip any inlined frames, entry value call sites work between real
+ functions. They do not make sense between inline functions as even PC
+ does not change there. */
+ while (get_frame_type (frame) == INLINE_FRAME)
+ {
+ frame = get_prev_frame (frame);
+ gdb_assert (frame != NULL);
+ }
+
+ func_addr = get_frame_func (frame);
+ gdbarch = get_frame_arch (frame);
+ caller_frame = get_prev_frame (frame);
if (gdbarch != frame_unwind_arch (frame))
{
struct minimal_symbol *msym = lookup_minimal_symbol_by_pc (func_addr);
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S
new file mode 100644
index 0000000..5f353f5
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S
@@ -0,0 +1,672 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This file is compiled from gdb.arch/amd64-entry-value-inline.c
+ using -g -dA -S -O2. */
+
+ .file "amd64-entry-value-inline.c"
+ .text
+.Ltext0:
+ .p2align 4,,15
+ .type fn1, @function
+fn1:
+.LFB0:
+ .file 1 "gdb.arch/amd64-entry-value-inline.c"
+ # gdb.arch/amd64-entry-value-inline.c:22
+ .loc 1 22 0
+ .cfi_startproc
+.LVL0:
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (FALLTHRU)
+ # gdb.arch/amd64-entry-value-inline.c:23
+ .loc 1 23 0
+ movl v(%rip), %eax
+ addl $1, %eax
+ movl %eax, v(%rip)
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE0:
+ .size fn1, .-fn1
+ .p2align 4,,15
+ .globl fn3
+ .type fn3, @function
+fn3:
+.LFB2:
+ # gdb.arch/amd64-entry-value-inline.c:41
+ .loc 1 41 0
+ .cfi_startproc
+.LVL1:
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (FALLTHRU)
+.LBB4:
+.LBB5:
+ # gdb.arch/amd64-entry-value-inline.c:29
+ .loc 1 29 0
+ testl %esi, %esi
+.LBE5:
+.LBE4:
+ # gdb.arch/amd64-entry-value-inline.c:41
+ .loc 1 41 0
+ pushq %rbx
+ .cfi_def_cfa_offset 16
+ .cfi_offset 3, -16
+ # gdb.arch/amd64-entry-value-inline.c:41
+ .loc 1 41 0
+ movl %edi, %ebx
+.LBB7:
+.LBB6:
+# SUCC: 3 [39.0%] (FALLTHRU,CAN_FALLTHRU) 4 [61.0%] (CAN_FALLTHRU)
+ # gdb.arch/amd64-entry-value-inline.c:29
+ .loc 1 29 0
+ je .L3
+# BLOCK 3 freq:3898 seq:1
+# PRED: 2 [39.0%] (FALLTHRU,CAN_FALLTHRU)
+ # gdb.arch/amd64-entry-value-inline.c:31
+ .loc 1 31 0
+ call fn1
+.LVL2:
+ # gdb.arch/amd64-entry-value-inline.c:32
+ .loc 1 32 0
+ leal -2(%rbx), %eax
+.LVL3:
+ # gdb.arch/amd64-entry-value-inline.c:33
+ .loc 1 33 0
+ movl %eax, %edi
+ imull %eax, %edi
+ addl $1, %edi
+.LVL4:
+ imull %edi, %eax
+.LVL5:
+ # gdb.arch/amd64-entry-value-inline.c:34
+ .loc 1 34 0
+ leal (%rbx,%rax), %edi
+ call fn1
+.LVL6:
+# SUCC: 4 [100.0%] (FALLTHRU,CAN_FALLTHRU)
+# BLOCK 4 freq:10000 seq:2
+# PRED: 2 [61.0%] (CAN_FALLTHRU) 3 [100.0%] (FALLTHRU,CAN_FALLTHRU)
+.L3:
+.LBE6:
+.LBE7:
+ # gdb.arch/amd64-entry-value-inline.c:43
+ .loc 1 43 0
+ movl %ebx, %eax
+ popq %rbx
+ .cfi_def_cfa_offset 8
+.LVL7:
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE2:
+ .size fn3, .-fn3
+ .section .text.startup,"ax",@progbits
+ .p2align 4,,15
+ .globl main
+ .type main, @function
+main:
+.LFB3:
+ # gdb.arch/amd64-entry-value-inline.c:47
+ .loc 1 47 0
+ .cfi_startproc
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (FALLTHRU)
+ # gdb.arch/amd64-entry-value-inline.c:48
+ .loc 1 48 0
+ movl $25, %esi
+ movl $6, %edi
+ call fn3
+.LVL8:
+ # gdb.arch/amd64-entry-value-inline.c:50
+ .loc 1 50 0
+ xorl %eax, %eax
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE3:
+ .size main, .-main
+ .local v
+ .comm v,4,4
+ .text
+.Letext0:
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .long 0x164 # Length of Compilation Unit Info
+ .value 0x4 # DWARF version number
+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
+ .byte 0x8 # Pointer Size (in bytes)
+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
+ .long .LASF0 # DW_AT_producer: "GNU C 4.8.0 20121005 (experimental) -mtune=generic -march=x86-64 -g -O2"
+ .byte 0x1 # DW_AT_language
+ .long .LASF1 # DW_AT_name: "gdb.arch/amd64-entry-value-inline.c"
+ .long .LASF2 # DW_AT_comp_dir: ""
+ .long .Ldebug_ranges0+0x30 # DW_AT_ranges
+ .quad 0 # DW_AT_low_pc
+ .long .Ldebug_line0 # DW_AT_stmt_list
+ .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram)
+ .ascii "fn1\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x15 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .quad .LFB0 # DW_AT_low_pc
+ .quad .LFE0-.LFB0 # DW_AT_high_pc
+ .uleb128 0x1 # DW_AT_frame_base
+ .byte 0x9c # DW_OP_call_frame_cfa
+ # DW_AT_GNU_all_call_sites
+ .long 0x52 # DW_AT_sibling
+ .uleb128 0x3 # (DIE (0x46) DW_TAG_formal_parameter)
+ .ascii "x\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x15 # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x55 # DW_OP_reg5
+ .byte 0 # end of children of DIE 0x29
+ .uleb128 0x4 # (DIE (0x52) DW_TAG_base_type)
+ .byte 0x4 # DW_AT_byte_size
+ .byte 0x5 # DW_AT_encoding
+ .ascii "int\0" # DW_AT_name
+ .uleb128 0x5 # (DIE (0x59) DW_TAG_subprogram)
+ .ascii "fn2\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x1b # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 0x52 # DW_AT_type
+ .byte 0x1 # DW_AT_inline
+ .long 0x7c # DW_AT_sibling
+ .uleb128 0x6 # (DIE (0x69) DW_TAG_formal_parameter)
+ .ascii "x\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x1b # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .uleb128 0x6 # (DIE (0x72) DW_TAG_formal_parameter)
+ .ascii "y\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x1b # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .byte 0 # end of children of DIE 0x59
+ .uleb128 0x7 # (DIE (0x7c) DW_TAG_subprogram)
+ # DW_AT_external
+ .ascii "fn3\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x28 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 0x52 # DW_AT_type
+ .quad .LFB2 # DW_AT_low_pc
+ .quad .LFE2-.LFB2 # DW_AT_high_pc
+ .uleb128 0x1 # DW_AT_frame_base
+ .byte 0x9c # DW_OP_call_frame_cfa
+ # DW_AT_GNU_all_call_sites
+ .long 0x115 # DW_AT_sibling
+ .uleb128 0x8 # (DIE (0x9d) DW_TAG_formal_parameter)
+ .ascii "x\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x28 # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .long .LLST0 # DW_AT_location
+ .uleb128 0x8 # (DIE (0xaa) DW_TAG_formal_parameter)
+ .ascii "y\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x28 # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .long .LLST1 # DW_AT_location
+ .uleb128 0x9 # (DIE (0xb7) DW_TAG_inlined_subroutine)
+ .long 0x59 # DW_AT_abstract_origin
+ .quad .LBB4 # DW_AT_entry_pc
+ .long .Ldebug_ranges0+0 # DW_AT_ranges
+ .byte 0x1 # DW_AT_call_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x2a # DW_AT_call_line
+ .uleb128 0xa # (DIE (0xca) DW_TAG_formal_parameter)
+ .long 0x72 # DW_AT_abstract_origin
+ .long .LLST2 # DW_AT_location
+ .uleb128 0xa # (DIE (0xd3) DW_TAG_formal_parameter)
+ .long 0x69 # DW_AT_abstract_origin
+ .long .LLST0 # DW_AT_location
+ .uleb128 0xb # (DIE (0xdc) DW_TAG_GNU_call_site)
+ .quad .LVL2 # DW_AT_low_pc
+ .long 0x29 # DW_AT_abstract_origin
+ .long 0xf4 # DW_AT_sibling
+ .uleb128 0xc # (DIE (0xed) DW_TAG_GNU_call_site_parameter)
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x55 # DW_OP_reg5
+ .uleb128 0x2 # DW_AT_GNU_call_site_value
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 0
+ .byte 0 # end of children of DIE 0xdc
+ .uleb128 0xd # (DIE (0xf4) DW_TAG_GNU_call_site)
+ .quad .LVL6 # DW_AT_low_pc
+ .long 0x29 # DW_AT_abstract_origin
+ .uleb128 0xc # (DIE (0x101) DW_TAG_GNU_call_site_parameter)
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x55 # DW_OP_reg5
+ .uleb128 0xd # DW_AT_GNU_call_site_value
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x1e # DW_OP_mul
+ .byte 0x23 # DW_OP_plus_uconst
+ .uleb128 0x1
+ .byte 0x1e # DW_OP_mul
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 0
+ .byte 0x22 # DW_OP_plus
+ .byte 0 # end of children of DIE 0xf4
+ .byte 0 # end of children of DIE 0xb7
+ .byte 0 # end of children of DIE 0x7c
+ .uleb128 0xe # (DIE (0x115) DW_TAG_subprogram)
+ # DW_AT_external
+ .long .LASF3 # DW_AT_name: "main"
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x2e # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .quad .LFB3 # DW_AT_low_pc
+ .quad .LFE3-.LFB3 # DW_AT_high_pc
+ .uleb128 0x1 # DW_AT_frame_base
+ .byte 0x9c # DW_OP_call_frame_cfa
+ # DW_AT_GNU_all_call_sites
+ .long 0x14f # DW_AT_sibling
+ .uleb128 0xd # (DIE (0x136) DW_TAG_GNU_call_site)
+ .quad .LVL8 # DW_AT_low_pc
+ .long 0x7c # DW_AT_abstract_origin
+ .uleb128 0xc # (DIE (0x143) DW_TAG_GNU_call_site_parameter)
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x55 # DW_OP_reg5
+ .uleb128 0x1 # DW_AT_GNU_call_site_value
+ .byte 0x36 # DW_OP_lit6
+ .uleb128 0xc # (DIE (0x148) DW_TAG_GNU_call_site_parameter)
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x54 # DW_OP_reg4
+ .uleb128 0x1 # DW_AT_GNU_call_site_value
+ .byte 0x49 # DW_OP_lit25
+ .byte 0 # end of children of DIE 0x136
+ .byte 0 # end of children of DIE 0x115
+ .uleb128 0xf # (DIE (0x14f) DW_TAG_variable)
+ .ascii "v\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x12 # DW_AT_decl_line
+ .long 0x162 # DW_AT_type
+ .uleb128 0x9 # DW_AT_location
+ .byte 0x3 # DW_OP_addr
+ .quad v
+ .uleb128 0x10 # (DIE (0x162) DW_TAG_volatile_type)
+ .long 0x52 # DW_AT_type
+ .byte 0 # end of children of DIE 0xb
+ .section .debug_abbrev,"",@progbits
+.Ldebug_abbrev0:
+ .uleb128 0x1 # (abbrev code)
+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x25 # (DW_AT_producer)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x13 # (DW_AT_language)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x1b # (DW_AT_comp_dir)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x55 # (DW_AT_ranges)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x10 # (DW_AT_stmt_list)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .byte 0
+ .byte 0
+ .uleb128 0x2 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x7 # (DW_FORM_data8)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x3 # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .byte 0
+ .byte 0
+ .uleb128 0x4 # (abbrev code)
+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
+ .byte 0 # DW_children_no
+ .uleb128 0xb # (DW_AT_byte_size)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3e # (DW_AT_encoding)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .byte 0
+ .byte 0
+ .uleb128 0x5 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x20 # (DW_AT_inline)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x6 # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x7 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3f # (DW_AT_external)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x7 # (DW_FORM_data8)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x8 # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .byte 0
+ .byte 0
+ .uleb128 0x9 # (abbrev code)
+ .uleb128 0x1d # (TAG: DW_TAG_inlined_subroutine)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x52 # (DW_AT_entry_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x55 # (DW_AT_ranges)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .uleb128 0x58 # (DW_AT_call_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x59 # (DW_AT_call_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .byte 0
+ .byte 0
+ .uleb128 0xa # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .byte 0
+ .byte 0
+ .uleb128 0xb # (abbrev code)
+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0xc # (abbrev code)
+ .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .uleb128 0x2111 # (DW_AT_GNU_call_site_value)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .byte 0
+ .byte 0
+ .uleb128 0xd # (abbrev code)
+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0xe # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3f # (DW_AT_external)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x7 # (DW_FORM_data8)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0xf # (abbrev code)
+ .uleb128 0x34 # (TAG: DW_TAG_variable)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .byte 0
+ .byte 0
+ .uleb128 0x10 # (abbrev code)
+ .uleb128 0x35 # (TAG: DW_TAG_volatile_type)
+ .byte 0 # DW_children_no
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .byte 0
+ .section .debug_loc,"",@progbits
+.Ldebug_loc0:
+.LLST0:
+ .quad .LVL1 # Location list begin address (*.LLST0)
+ .quad .LVL2-1 # Location list end address (*.LLST0)
+ .value 0x1 # Location expression size
+ .byte 0x55 # DW_OP_reg5
+ .quad .LVL2-1 # Location list begin address (*.LLST0)
+ .quad .LVL7 # Location list end address (*.LLST0)
+ .value 0x1 # Location expression size
+ .byte 0x53 # DW_OP_reg3
+ .quad .LVL7 # Location list begin address (*.LLST0)
+ .quad .LFE2 # Location list end address (*.LLST0)
+ .value 0x1 # Location expression size
+ .byte 0x50 # DW_OP_reg0
+ .quad 0 # Location list terminator begin (*.LLST0)
+ .quad 0 # Location list terminator end (*.LLST0)
+.LLST1:
+ .quad .LVL1 # Location list begin address (*.LLST1)
+ .quad .LVL2-1 # Location list end address (*.LLST1)
+ .value 0x1 # Location expression size
+ .byte 0x54 # DW_OP_reg4
+ .quad .LVL2-1 # Location list begin address (*.LLST1)
+ .quad .LFE2 # Location list end address (*.LLST1)
+ .value 0x4 # Location expression size
+ .byte 0xf3 # DW_OP_GNU_entry_value
+ .uleb128 0x1
+ .byte 0x54 # DW_OP_reg4
+ .byte 0x9f # DW_OP_stack_value
+ .quad 0 # Location list terminator begin (*.LLST1)
+ .quad 0 # Location list terminator end (*.LLST1)
+.LLST2:
+ .quad .LVL1 # Location list begin address (*.LLST2)
+ .quad .LVL2-1 # Location list end address (*.LLST2)
+ .value 0x1 # Location expression size
+ .byte 0x54 # DW_OP_reg4
+ .quad .LVL2-1 # Location list begin address (*.LLST2)
+ .quad .LVL3 # Location list end address (*.LLST2)
+ .value 0x4 # Location expression size
+ .byte 0xf3 # DW_OP_GNU_entry_value
+ .uleb128 0x1
+ .byte 0x54 # DW_OP_reg4
+ .byte 0x9f # DW_OP_stack_value
+ .quad .LVL3 # Location list begin address (*.LLST2)
+ .quad .LVL4 # Location list end address (*.LLST2)
+ .value 0x1 # Location expression size
+ .byte 0x50 # DW_OP_reg0
+ .quad .LVL4 # Location list begin address (*.LLST2)
+ .quad .LVL5 # Location list end address (*.LLST2)
+ .value 0x6 # Location expression size
+ .byte 0x70 # DW_OP_breg0
+ .sleb128 0
+ .byte 0x75 # DW_OP_breg5
+ .sleb128 0
+ .byte 0x1e # DW_OP_mul
+ .byte 0x9f # DW_OP_stack_value
+ .quad .LVL5 # Location list begin address (*.LLST2)
+ .quad .LVL6-1 # Location list end address (*.LLST2)
+ .value 0x1 # Location expression size
+ .byte 0x50 # DW_OP_reg0
+ .quad .LVL6-1 # Location list begin address (*.LLST2)
+ .quad .LVL6 # Location list end address (*.LLST2)
+ .value 0xb # Location expression size
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x1e # DW_OP_mul
+ .byte 0x23 # DW_OP_plus_uconst
+ .uleb128 0x1
+ .byte 0x1e # DW_OP_mul
+ .byte 0x9f # DW_OP_stack_value
+ .quad 0 # Location list terminator begin (*.LLST2)
+ .quad 0 # Location list terminator end (*.LLST2)
+ .section .debug_aranges,"",@progbits
+ .long 0x3c # Length of Address Ranges Info
+ .value 0x2 # DWARF Version
+ .long .Ldebug_info0 # Offset of Compilation Unit Info
+ .byte 0x8 # Size of Address
+ .byte 0 # Size of Segment Descriptor
+ .value 0 # Pad to 16 byte boundary
+ .value 0
+ .quad .Ltext0 # Address
+ .quad .Letext0-.Ltext0 # Length
+ .quad .LFB3 # Address
+ .quad .LFE3-.LFB3 # Length
+ .quad 0
+ .quad 0
+ .section .debug_ranges,"",@progbits
+.Ldebug_ranges0:
+ .quad .LBB4 # Offset 0
+ .quad .LBE4
+ .quad .LBB7
+ .quad .LBE7
+ .quad 0
+ .quad 0
+ .quad .Ltext0 # Offset 0x30
+ .quad .Letext0
+ .quad .LFB3 # Offset 0x40
+ .quad .LFE3
+ .quad 0
+ .quad 0
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .section .debug_str,"MS",@progbits,1
+.LASF0:
+ .string "GNU C 4.8.0 20121005+patches (experimental) -mtune=generic -march=x86-64 -g -O2"
+.LASF1:
+ .string "gdb.arch/amd64-entry-value-inline.c"
+.LASF2:
+ .string ""
+.LASF3:
+ .string "main"
+ .ident "GCC: (GNU) 4.8.0 20121005 (experimental)"
+ .section .note.GNU-stack,"",@progbits
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c
new file mode 100644
index 0000000..f7fefb8
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c
@@ -0,0 +1,50 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+static volatile int v;
+
+static __attribute__((noinline, noclone)) void
+fn1 (int x)
+{
+ v++;
+}
+
+static int
+fn2 (int x, int y)
+{
+ if (y)
+ {
+ fn1 (x);
+ y = -2 + x; /* break-here */
+ y = y * y * y + y;
+ fn1 (x + y);
+ }
+ return x;
+}
+
+__attribute__((noinline, noclone)) int
+fn3 (int x, int y)
+{
+ return fn2 (x, y);
+}
+
+int
+main ()
+{
+ fn3 (6, 25);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp
new file mode 100644
index 0000000..6aa92c1
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp
@@ -0,0 +1,40 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set opts {}
+standard_testfile .S
+
+if [info exists COMPILE] {
+ # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-inline.exp COMPILE=1"
+ standard_testfile
+ lappend opts debug optimize=-O2
+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
+ verbose "Skipping ${testfile}."
+ return
+}
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } {
+ return -1
+}
+
+if ![runto_main] {
+ return -1
+}
+
+set srcfile $testfile.c
+gdb_breakpoint [gdb_get_line_number "break-here"]
+
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+gdb_test "p y" " = 25"

View File

@ -1,8 +1,8 @@
Index: gdb-7.4.50.20120602/gdb/dwarf2read.c Index: gdb-7.4.91.20120801/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/dwarf2read.c 2012-06-02 21:32:41.746567299 +0200 --- gdb-7.4.91.20120801.orig/gdb/dwarf2read.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/dwarf2read.c 2012-06-02 21:32:54.304562500 +0200 +++ gdb-7.4.91.20120801/gdb/dwarf2read.c 2012-08-01 18:38:54.201540500 +0200
@@ -9736,12 +9736,14 @@ read_set_type (struct die_info *die, str @@ -11073,12 +11073,14 @@ read_set_type (struct die_info *die, str
return set_die_type (die, set_type, cu); return set_die_type (die, set_type, cu);
} }
@ -19,7 +19,7 @@ Index: gdb-7.4.50.20120602/gdb/dwarf2read.c
struct attribute *attr; struct attribute *attr;
struct symbol *sym; struct symbol *sym;
CORE_ADDR base = (CORE_ADDR) 0; CORE_ADDR base = (CORE_ADDR) 0;
@@ -9766,20 +9768,67 @@ read_common_block (struct die_info *die, @@ -11103,20 +11105,67 @@ read_common_block (struct die_info *die,
} }
if (die->child != NULL) if (die->child != NULL)
{ {
@ -87,7 +87,7 @@ Index: gdb-7.4.50.20120602/gdb/dwarf2read.c
} }
} }
@@ -13661,6 +13710,13 @@ new_symbol_full (struct die_info *die, s @@ -15155,6 +15204,13 @@ new_symbol_full (struct die_info *die, s
{ {
var_decode_location (attr, sym, cu); var_decode_location (attr, sym, cu);
attr2 = dwarf2_attr (die, DW_AT_external, cu); attr2 = dwarf2_attr (die, DW_AT_external, cu);
@ -101,7 +101,7 @@ Index: gdb-7.4.50.20120602/gdb/dwarf2read.c
if (SYMBOL_CLASS (sym) == LOC_STATIC if (SYMBOL_CLASS (sym) == LOC_STATIC
&& SYMBOL_VALUE_ADDRESS (sym) == 0 && SYMBOL_VALUE_ADDRESS (sym) == 0
&& !dwarf2_per_objfile->has_section_at_zero) && !dwarf2_per_objfile->has_section_at_zero)
@@ -13825,6 +13881,11 @@ new_symbol_full (struct die_info *die, s @@ -15319,6 +15375,11 @@ new_symbol_full (struct die_info *die, s
SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_CLASS (sym) = LOC_TYPEDEF;
list_to_add = &global_symbols; list_to_add = &global_symbols;
break; break;
@ -113,10 +113,10 @@ Index: gdb-7.4.50.20120602/gdb/dwarf2read.c
default: default:
/* Not a tag we recognize. Hopefully we aren't processing /* Not a tag we recognize. Hopefully we aren't processing
trash data, but since we must specifically ignore things trash data, but since we must specifically ignore things
Index: gdb-7.4.50.20120602/gdb/f-lang.c Index: gdb-7.4.91.20120801/gdb/f-lang.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/f-lang.c 2012-06-02 21:32:41.746567299 +0200 --- gdb-7.4.91.20120801.orig/gdb/f-lang.c 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/f-lang.c 2012-06-02 21:32:54.305562499 +0200 +++ gdb-7.4.91.20120801/gdb/f-lang.c 2012-08-01 18:38:54.202540495 +0200
@@ -370,27 +370,3 @@ _initialize_f_language (void) @@ -370,27 +370,3 @@ _initialize_f_language (void)
add_language (&f_language_defn); add_language (&f_language_defn);
@ -145,10 +145,10 @@ Index: gdb-7.4.50.20120602/gdb/f-lang.c
- } - }
- return (NULL); - return (NULL);
-} -}
Index: gdb-7.4.50.20120602/gdb/f-lang.h Index: gdb-7.4.91.20120801/gdb/f-lang.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/f-lang.h 2012-06-02 21:32:41.746567299 +0200 --- gdb-7.4.91.20120801.orig/gdb/f-lang.h 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/f-lang.h 2012-06-02 21:32:54.322562493 +0200 +++ gdb-7.4.91.20120801/gdb/f-lang.h 2012-08-01 18:38:54.203540489 +0200
@@ -52,37 +52,8 @@ enum f90_range_type @@ -52,37 +52,8 @@ enum f90_range_type
NONE_BOUND_DEFAULT /* "(low:high)" */ NONE_BOUND_DEFAULT /* "(low:high)" */
}; };
@ -187,10 +187,10 @@ Index: gdb-7.4.50.20120602/gdb/f-lang.h
/* When reasonable array bounds cannot be fetched, such as when /* When reasonable array bounds cannot be fetched, such as when
you ask to 'mt print symbols' and there is no stack frame and you ask to 'mt print symbols' and there is no stack frame and
Index: gdb-7.4.50.20120602/gdb/f-valprint.c Index: gdb-7.4.91.20120801/gdb/f-valprint.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/f-valprint.c 2012-06-02 21:32:41.746567299 +0200 --- gdb-7.4.91.20120801.orig/gdb/f-valprint.c 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/f-valprint.c 2012-06-02 21:33:50.514541286 +0200 +++ gdb-7.4.91.20120801/gdb/f-valprint.c 2012-08-01 18:41:26.411698186 +0200
@@ -34,10 +34,11 @@ @@ -34,10 +34,11 @@
#include "gdbcore.h" #include "gdbcore.h"
#include "command.h" #include "command.h"
@ -204,15 +204,14 @@ Index: gdb-7.4.50.20120602/gdb/f-valprint.c
static void f77_create_arrayprint_offset_tbl (struct type *, static void f77_create_arrayprint_offset_tbl (struct type *,
struct ui_file *); struct ui_file *);
static void f77_get_dynamic_length_of_aggregate (struct type *); static void f77_get_dynamic_length_of_aggregate (struct type *);
@@ -420,22 +421,54 @@ f_val_print (struct type *type, const gd @@ -420,22 +421,53 @@ f_val_print (struct type *type, const gd
gdb_flush (stream); gdb_flush (stream);
} }
-static void -static void
-list_all_visible_commons (const char *funname) -list_all_visible_commons (const char *funname)
+static int +static int
+info_common_command_for_block (struct block *block, struct frame_info *frame, +info_common_command_for_block (struct block *block, const char *comname)
+ const char *comname)
{ {
- SAVED_F77_COMMON_PTR tmp; - SAVED_F77_COMMON_PTR tmp;
- -
@ -258,21 +257,21 @@ Index: gdb-7.4.50.20120602/gdb/f-valprint.c
+ } + }
- printf_filtered (_("All COMMON blocks visible at this level:\n\n")); - printf_filtered (_("All COMMON blocks visible at this level:\n\n"));
+ putchar_filtered ('\n'); -
+ }
- while (tmp != NULL) - while (tmp != NULL)
- { - {
- if (strcmp (tmp->owning_function, funname) == 0) - if (strcmp (tmp->owning_function, funname) == 0)
- printf_filtered ("%s\n", tmp->name); - printf_filtered ("%s\n", tmp->name);
- + putchar_filtered ('\n');
+ }
- tmp = tmp->next; - tmp = tmp->next;
- } - }
+ return values_printed; + return values_printed;
} }
/* This function is used to print out the values in a given COMMON /* This function is used to print out the values in a given COMMON
@@ -445,11 +478,9 @@ list_all_visible_commons (const char *fu @@ -445,11 +477,9 @@ list_all_visible_commons (const char *fu
static void static void
info_common_command (char *comname, int from_tty) info_common_command (char *comname, int from_tty)
{ {
@ -286,7 +285,7 @@ Index: gdb-7.4.50.20120602/gdb/f-valprint.c
/* We have been told to display the contents of F77 COMMON /* We have been told to display the contents of F77 COMMON
block supposedly visible in this function. Let us block supposedly visible in this function. Let us
@@ -461,74 +492,31 @@ info_common_command (char *comname, int @@ -461,87 +491,31 @@ info_common_command (char *comname, int
/* The following is generally ripped off from stack.c's routine /* The following is generally ripped off from stack.c's routine
print_frame_info(). */ print_frame_info(). */
@ -340,7 +339,7 @@ Index: gdb-7.4.50.20120602/gdb/f-valprint.c
{ {
- list_all_visible_commons (funname); - list_all_visible_commons (funname);
- return; - return;
+ if (info_common_command_for_block (block, fi, comname)) + if (info_common_command_for_block (block, comname))
+ values_printed = 1; + values_printed = 1;
+ /* After handling the function's top-level block, stop. Don't + /* After handling the function's top-level block, stop. Don't
+ continue to its superblock, the block of per-file symbols. */ + continue to its superblock, the block of per-file symbols. */
@ -354,6 +353,8 @@ Index: gdb-7.4.50.20120602/gdb/f-valprint.c
- if (the_common) - if (the_common)
+ if (!values_printed) + if (!values_printed)
{ {
- struct frame_id frame_id = get_frame_id (fi);
-
- if (strcmp (comname, BLANK_COMMON_NAME_LOCAL) == 0) - if (strcmp (comname, BLANK_COMMON_NAME_LOCAL) == 0)
- printf_filtered (_("Contents of blank COMMON block:\n")); - printf_filtered (_("Contents of blank COMMON block:\n"));
+ if (comname) + if (comname)
@ -366,7 +367,18 @@ Index: gdb-7.4.50.20120602/gdb/f-valprint.c
- -
- while (entry != NULL) - while (entry != NULL)
- { - {
- fi = frame_find_by_id (frame_id);
- if (fi == NULL)
- {
- warning (_("Unable to restore previously selected frame."));
- break;
- }
-
- print_variable_and_value (NULL, entry->symbol, fi, gdb_stdout, 0); - print_variable_and_value (NULL, entry->symbol, fi, gdb_stdout, 0);
-
- /* print_variable_and_value invalidates FI. */
- fi = NULL;
-
- entry = entry->next; - entry = entry->next;
- } - }
+ printf_filtered (_("No common blocks.\n")); + printf_filtered (_("No common blocks.\n"));
@ -377,11 +389,11 @@ Index: gdb-7.4.50.20120602/gdb/f-valprint.c
} }
void void
Index: gdb-7.4.50.20120602/gdb/stack.c Index: gdb-7.4.91.20120801/gdb/stack.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/stack.c 2012-06-02 21:32:41.746567299 +0200 --- gdb-7.4.91.20120801.orig/gdb/stack.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/stack.c 2012-06-02 21:32:54.335562488 +0200 +++ gdb-7.4.91.20120801/gdb/stack.c 2012-08-01 18:38:54.206540471 +0200
@@ -1838,6 +1838,8 @@ iterate_over_block_locals (struct block @@ -1851,6 +1851,8 @@ iterate_over_block_locals (struct block
case LOC_COMPUTED: case LOC_COMPUTED:
if (SYMBOL_IS_ARGUMENT (sym)) if (SYMBOL_IS_ARGUMENT (sym))
break; break;
@ -390,11 +402,11 @@ Index: gdb-7.4.50.20120602/gdb/stack.c
(*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data); (*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data);
break; break;
Index: gdb-7.4.50.20120602/gdb/symtab.h Index: gdb-7.4.91.20120801/gdb/symtab.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/symtab.h 2012-06-02 21:32:41.746567299 +0200 --- gdb-7.4.91.20120801.orig/gdb/symtab.h 2012-06-30 00:46:46.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/symtab.h 2012-06-02 21:32:54.342562486 +0200 +++ gdb-7.4.91.20120801/gdb/symtab.h 2012-08-01 18:38:54.206540471 +0200
@@ -389,7 +389,10 @@ typedef enum domain_enum_tag @@ -394,7 +394,10 @@ typedef enum domain_enum_tag
/* LABEL_DOMAIN may be used for names of labels (for gotos). */ /* LABEL_DOMAIN may be used for names of labels (for gotos). */
@ -406,10 +418,10 @@ Index: gdb-7.4.50.20120602/gdb/symtab.h
} domain_enum; } domain_enum;
/* Searching domains, used for `search_symbols'. Element numbers are /* Searching domains, used for `search_symbols'. Element numbers are
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.fortran/common-block.exp Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.fortran/common-block.exp 2012-06-02 21:32:54.344562484 +0200 +++ gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.exp 2012-08-01 18:38:54.207540465 +0200
@@ -0,0 +1,101 @@ @@ -0,0 +1,101 @@
+# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008 Free Software Foundation, Inc.
+ +
@ -512,10 +524,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.fortran/common-block.exp
+gdb_test "p ix_x" " = 1 *" "p ix_x in" +gdb_test "p ix_x" " = 1 *" "p ix_x in"
+gdb_test "p iy_y" " = 2 *" "p iy_y in" +gdb_test "p iy_y" " = 2 *" "p iy_y in"
+gdb_test "p iz_z2" " = 3 *" "p iz_z2 in" +gdb_test "p iz_z2" " = 3 *" "p iz_z2 in"
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.fortran/common-block.f90 Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.f90
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.fortran/common-block.f90 2012-06-02 21:32:54.345562483 +0200 +++ gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.f90 2012-08-01 18:38:54.207540465 +0200
@@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
+! Copyright 2008 Free Software Foundation, Inc. +! Copyright 2008 Free Software Foundation, Inc.
+! +!

View File

@ -1,60 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00109.html
Subject: [RFA] Fix inconsistency in blockvector addrmap vs non-addrmap handling
Hi.
I was seeing the assert in dw2_find_pc_sect_psymtab trigger
and traced it to the fact that when pending_addrmap_interesting gets
set blockvector.map is used instead of blockvector.block.
The difference is that blockvector.block contains entries for the global
and static blocks whereas pending_addrmap doesn't.
This patch fixes this by making them consistent.
I suspect more work is necessary (e.g. can symtabs "overlap" even though
the individual pieces do not?).
But I first want to fix the regression introduced by the change
to dw2_find_pc_sect_psymtab: There is more code in a symtab than is
documented by function and lexical block pc ranges (e.g. C++ method thunks).
Regression tested on amd64-linux, and by verifying the assert no longer
triggers in the testcase I was using.
Ok to commit?
Note that this obviates the need for the patch in:
http://sourceware.org/ml/gdb-patches/2012-05/msg00958.html
Also note that this accompanies this patch:
http://sourceware.org/ml/gdb-patches/2012-06/msg00105.html
2012-06-04 Doug Evans <dje@google.com>
* buildsym.c (end_symtab): Add the range of the static block to
the pending addrmap.
Index: buildsym.c
===================================================================
RCS file: /cvs/src/src/gdb/buildsym.c,v
retrieving revision 1.97
diff -u -p -r1.97 buildsym.c
--- ./gdb/buildsym.c 29 May 2012 20:23:17 -0000 1.97
+++ ./gdb/buildsym.c 5 Jun 2012 00:26:01 -0000
@@ -1024,8 +1027,15 @@ end_symtab (CORE_ADDR end_addr, struct o
{
/* Define the STATIC_BLOCK & GLOBAL_BLOCK, and build the
blockvector. */
- finish_block (0, &file_symbols, 0, last_source_start_addr,
- end_addr, objfile);
+ struct block *static_block;
+
+ static_block = finish_block (0, &file_symbols, 0,
+ last_source_start_addr, end_addr,
+ objfile);
+ /* Mark the range of the static block so that if we end up using
+ blockvector.map then find_block_in_blockvector behaves identically
+ regardless of whether the addrmap is present. */
+ record_block_range (static_block, last_source_start_addr, end_addr - 1);
finish_block_internal (0, &global_symbols, 0, last_source_start_addr,
end_addr, objfile, 1);
blockvector = make_blockvector (objfile);

1056
gdb-minidebuginfo.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,215 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-05/msg01105.html
Subject: [RFA/commit 1/3] Revert "Search global symbols from the expression's block objfile first."
The search order used in this patch breaks global symbol lookups
for certain symbols when copy-relocation is used. A slightly different
search order will be implemented later.
gdb/ChangeLog:
Revert the following patch:
* findvar.c (default_read_var_value): For LOC_UNRESOLVED symbols,
try locating the symbol in the symbol's own objfile first, before
extending the search to all objfiles.
* symtab.c (lookup_symbol_aux_objfile): New function, extracted
out of lookup_symbol_aux_symtabs.
(lookup_symbol_aux_symtabs): Add new parameter "exclude_objfile".
Replace extracted-out code by call to lookup_symbol_aux_objfile.
Do not search EXCLUDE_OBJFILE.
(lookup_static_symbol_aux): Update call to lookup_symbol_aux_symtabs.
(lookup_symbol_global): Search for matches in the block's objfile
first, before searching all other objfiles.
Will commit if patches #2 & #3 are OK.
---
gdb/findvar.c | 10 +-----
gdb/symtab.c | 108 +++++++++++++++++----------------------------------------
2 files changed, 33 insertions(+), 85 deletions(-)
diff --git a/gdb/findvar.c b/gdb/findvar.c
index ed7903c..9009e6f 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -562,15 +562,7 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
struct minimal_symbol *msym;
struct obj_section *obj_section;
- /* First, try locating the associated minimal symbol within
- the same objfile. This prevents us from selecting another
- symbol with the same name but located in a different objfile. */
- msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL,
- SYMBOL_SYMTAB (var)->objfile);
- /* If the lookup failed, try expanding the search to all
- objfiles. */
- if (msym == NULL)
- msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
+ msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
if (msym == NULL)
error (_("No global symbol \"%s\"."), SYMBOL_LINKAGE_NAME (var));
if (overlay_debugging)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 85ddd1d..39d8c6f 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -95,8 +95,7 @@ struct symbol *lookup_symbol_aux_local (const char *name,
static
struct symbol *lookup_symbol_aux_symtabs (int block_index,
const char *name,
- const domain_enum domain,
- struct objfile *exclude_objfile);
+ const domain_enum domain);
static
struct symbol *lookup_symbol_aux_quick (struct objfile *objfile,
@@ -1360,7 +1359,7 @@ lookup_static_symbol_aux (const char *name, const domain_enum domain)
struct objfile *objfile;
struct symbol *sym;
- sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, domain, NULL);
+ sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, domain);
if (sym != NULL)
return sym;
@@ -1499,61 +1498,40 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile,
return NULL;
}
-/* Check to see if the symbol is defined in one of the OBJFILE's
- symtabs. BLOCK_INDEX should be either GLOBAL_BLOCK or STATIC_BLOCK,
+/* Check to see if the symbol is defined in one of the symtabs.
+ BLOCK_INDEX should be either GLOBAL_BLOCK or STATIC_BLOCK,
depending on whether or not we want to search global symbols or
static symbols. */
static struct symbol *
-lookup_symbol_aux_objfile (struct objfile *objfile, int block_index,
- const char *name, const domain_enum domain)
-{
- struct symbol *sym = NULL;
- struct blockvector *bv;
- const struct block *block;
- struct symtab *s;
-
- if (objfile->sf)
- objfile->sf->qf->pre_expand_symtabs_matching (objfile, block_index,
- name, domain);
-
- ALL_OBJFILE_SYMTABS (objfile, s)
- if (s->primary)
- {
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, domain);
- if (sym)
- {
- block_found = block;
- return fixup_symbol_section (sym, objfile);
- }
- }
-
- return NULL;
-}
-
-/* Same as lookup_symbol_aux_objfile, except that it searches all
- objfiles except for EXCLUDE_OBJFILE. Return the first match found.
-
- If EXCLUDE_OBJFILE is NULL, then all objfiles are searched. */
-
-static struct symbol *
lookup_symbol_aux_symtabs (int block_index, const char *name,
- const domain_enum domain,
- struct objfile *exclude_objfile)
+ const domain_enum domain)
{
struct symbol *sym;
struct objfile *objfile;
+ struct blockvector *bv;
+ const struct block *block;
+ struct symtab *s;
ALL_OBJFILES (objfile)
{
- if (objfile != exclude_objfile)
- {
- sym = lookup_symbol_aux_objfile (objfile, block_index, name, domain);
- if (sym)
- return sym;
- }
+ if (objfile->sf)
+ objfile->sf->qf->pre_expand_symtabs_matching (objfile,
+ block_index,
+ name, domain);
+
+ ALL_OBJFILE_SYMTABS (objfile, s)
+ if (s->primary)
+ {
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, block_index);
+ sym = lookup_block_symbol (block, name, domain);
+ if (sym)
+ {
+ block_found = block;
+ return fixup_symbol_section (sym, objfile);
+ }
+ }
}
return NULL;
@@ -1679,46 +1657,24 @@ lookup_symbol_global (const char *name,
const domain_enum domain)
{
struct symbol *sym = NULL;
- struct objfile *block_objfile = NULL;
struct objfile *objfile = NULL;
/* Call library-specific lookup procedure. */
- block_objfile = lookup_objfile_from_block (block);
- if (block_objfile != NULL)
- sym = solib_global_lookup (block_objfile, name, domain);
+ objfile = lookup_objfile_from_block (block);
+ if (objfile != NULL)
+ sym = solib_global_lookup (objfile, name, domain);
if (sym != NULL)
return sym;
- /* If BLOCK_OBJFILE is not NULL, then search this objfile first.
- In case the global symbol is defined in multiple objfiles,
- we have a better chance of finding the most relevant symbol. */
-
- if (block_objfile != NULL)
- {
- sym = lookup_symbol_aux_objfile (block_objfile, GLOBAL_BLOCK,
- name, domain);
- if (sym == NULL)
- sym = lookup_symbol_aux_quick (block_objfile, GLOBAL_BLOCK,
- name, domain);
- if (sym != NULL)
- return sym;
- }
-
- /* Symbol not found in the BLOCK_OBJFILE, so try all the other
- objfiles, starting with symtabs first, and then partial symtabs. */
-
- sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, domain, block_objfile);
+ sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, domain);
if (sym != NULL)
return sym;
ALL_OBJFILES (objfile)
{
- if (objfile != block_objfile)
- {
- sym = lookup_symbol_aux_quick (objfile, GLOBAL_BLOCK, name, domain);
- if (sym)
- return sym;
- }
+ sym = lookup_symbol_aux_quick (objfile, GLOBAL_BLOCK, name, domain);
+ if (sym)
+ return sym;
}
return NULL;
--
1.7.1

110
gdb-print-class.patch Normal file
View File

@ -0,0 +1,110 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00169.html
### src/gdb/ChangeLog 2012/09/27 12:53:57 1.14718
### src/gdb/ChangeLog 2012/09/27 16:04:18 1.14719
## -1,3 +1,8 @@
+2012-09-27 Tom Tromey <tromey@redhat.com>
+
+ Fix https://bugzilla.redhat.com/show_bug.cgi?id=849357
+ * cp-valprint.c (cp_print_value_fields): Use get_vptr_fieldno.
+
2012-09-27 Joel Brobecker <brobecker@adacore.com>
* sol-thread.c (sol_thread_fetch_registers)
--- src/gdb/cp-valprint.c 2012/07/06 05:36:07 1.85
+++ src/gdb/cp-valprint.c 2012/09/27 16:04:22 1.86
@@ -210,7 +210,9 @@
{
int statmem_obstack_initial_size = 0;
int stat_array_obstack_initial_size = 0;
-
+ struct type *vptr_basetype = NULL;
+ int vptr_fieldno;
+
if (dont_print_statmem == 0)
{
statmem_obstack_initial_size =
@@ -225,6 +227,7 @@
}
}
+ vptr_fieldno = get_vptr_fieldno (type, &vptr_basetype);
for (i = n_baseclasses; i < len; i++)
{
/* If requested, skip printing of static fields. */
@@ -358,7 +361,7 @@
v, stream, recurse + 1,
options);
}
- else if (i == TYPE_VPTR_FIELDNO (type))
+ else if (i == vptr_fieldno && type == vptr_basetype)
{
int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
struct type *i_type = TYPE_FIELD_TYPE (type, i);
### src/gdb/testsuite/ChangeLog 2012/09/26 19:50:12 1.3396
### src/gdb/testsuite/ChangeLog 2012/09/27 16:04:22 1.3397
## -1,3 +1,10 @@
+2012-09-27 Tom Tromey <tromey@redhat.com>
+
+ * gdb.cp/derivation.exp: Add regression test.
+ * gdb.cp/derivation.cc (class V_base, class V_inter, class
+ V_derived): New.
+ (vderived): New global.
+
2012-09-26 Tom Tromey <tromey@redhat.com>
* gdb.dwarf2/dw2-common-block.S: New file.
--- src/gdb/testsuite/gdb.cp/derivation.cc 2011/12/13 17:22:08 1.2
+++ src/gdb/testsuite/gdb.cp/derivation.cc 2012/09/27 16:04:23 1.3
@@ -118,8 +118,37 @@
};
+class V_base
+{
+public:
+ virtual void m();
+ int base;
+};
+void
+V_base::m()
+{
+}
+
+class V_inter : public virtual V_base
+{
+public:
+ virtual void f();
+ int inter;
+};
+
+void
+V_inter::f()
+{
+}
+
+class V_derived : public V_inter
+{
+public:
+ double x;
+};
+V_derived vderived;
int A::afoo() {
return 1;
--- src/gdb/testsuite/gdb.cp/derivation.exp 2012/07/10 15:18:18 1.19
+++ src/gdb/testsuite/gdb.cp/derivation.exp 2012/09/27 16:04:23 1.20
@@ -176,3 +176,11 @@
gdb_test "print g_instance.bfoo()" "\\$\[0-9\]+ = 2" "print value of g_instance.bfoo()"
gdb_test "print g_instance.cfoo()" "\\$\[0-9\]+ = 3" "print value of g_instance.cfoo()"
+
+# This is a regression test for a bug that caused a crash when trying
+# to print the vtbl pointer. We don't care about the output so much
+# here (it is tested elsewhere), just that gdb doesn't crash. We test
+# "ptype" first because, before the gdb fix, that was the only code
+# path calling get_vptr_fieldno.
+gdb_test "ptype vderived" "type = .*"
+gdb_test "print vderived" " = {.* inter = 0.*x = 0}"

View File

@ -0,0 +1,75 @@
Index: gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c
===================================================================
--- /dev/null
+++ gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char *argv[])
+{
+ printf ("Hello, World.\n");
+ abort ();
+}
Index: gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp
===================================================================
--- /dev/null
+++ gdb-7.0.1/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp
@@ -0,0 +1,39 @@
+# Copyright 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile "set-solib-absolute-prefix"
+set srcfile ${testfile}.c
+
+# It is necessary to verify if the binary is 32-bit, so that the system
+# call `__kernel_vsyscall' originates from vDSO.
+
+if { ![is_ilp32_target] } {
+ return -1
+}
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+if { ![runto_main] } {
+ return -1
+}
+
+gdb_test "continue" "Program received signal SIGABRT, Aborted.*" \
+ "continue until abort"
+gdb_test "set solib-absolute-prefix /BOGUS_DIRECT" \
+ ".*warning: Unable to find dynamic linker breakpoint function.*" \
+ "set solib-absolute-prefix"
+gdb_test "bt" "__kernel_vsyscall.*" "backtrace with __kernel_vsyscall"

View File

@ -0,0 +1,23 @@
http://sourceware.org/ml/gdb-cvs/2012-07/msg00173.html
### src/gdb/ChangeLog 2012/07/20 17:54:05 1.14507
### src/gdb/ChangeLog 2012/07/22 16:52:39 1.14508
## -1,3 +1,7 @@
+2012-07-22 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sh-tdep.c (sh_treat_as_flt_p): Remove unused variable LEN.
+
2012-07-20 Jeff Kenton <jkenton@tilera.com>
* tilegx-linux-tdep.c (tilegx_linux_sigframe_init): Fix
--- src/gdb/sh-tdep.c 2012/06/08 14:24:57 1.245
+++ src/gdb/sh-tdep.c 2012/07/22 16:52:41 1.246
@@ -1032,8 +1032,6 @@
static int
sh_treat_as_flt_p (struct type *type)
{
- int len = TYPE_LENGTH (type);
-
/* Ordinary float types are obviously treated as float. */
if (TYPE_CODE (type) == TYPE_CODE_FLT)
return 1;

View File

@ -0,0 +1,64 @@
http://sourceware.org/ml/gdb-cvs/2012-07/msg00182.html
### src/gdb/ChangeLog 2012/07/23 15:25:11 1.14514
### src/gdb/ChangeLog 2012/07/23 18:08:27 1.14515
## -1,3 +1,9 @@
+2012-07-23 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * p-valprint.c (pascal_object_print_value): Replace potentially
+ unsafe alloca with xmalloc/xfree.
+ * valops.c (search_struct_method): Likewise.
+
2012-07-23 Tom Tromey <tromey@redhat.com>
* solib-svr4.c (enable_break): Update.
--- src/gdb/p-valprint.c 2012/05/18 21:02:49 1.100
+++ src/gdb/p-valprint.c 2012/07/23 18:08:29 1.101
@@ -797,8 +797,11 @@
if (boffset < 0 || boffset >= TYPE_LENGTH (type))
{
- /* FIXME (alloc): not safe is baseclass is really really big. */
- gdb_byte *buf = alloca (TYPE_LENGTH (baseclass));
+ gdb_byte *buf;
+ struct cleanup *back_to;
+
+ buf = xmalloc (TYPE_LENGTH (baseclass));
+ back_to = make_cleanup (xfree, buf);
base_valaddr = buf;
if (target_read_memory (address + boffset, buf,
@@ -807,6 +810,7 @@
address = address + boffset;
thisoffset = 0;
boffset = 0;
+ do_cleanups (back_to);
}
else
base_valaddr = valaddr;
--- src/gdb/valops.c 2012/06/24 07:28:10 1.297
+++ src/gdb/valops.c 2012/07/23 18:08:29 1.298
@@ -2281,8 +2281,13 @@
if (offset < 0 || offset >= TYPE_LENGTH (type))
{
- gdb_byte *tmp = alloca (TYPE_LENGTH (baseclass));
- CORE_ADDR address = value_address (*arg1p);
+ gdb_byte *tmp;
+ struct cleanup *back_to;
+ CORE_ADDR address;
+
+ tmp = xmalloc (TYPE_LENGTH (baseclass));
+ back_to = make_cleanup (xfree, tmp);
+ address = value_address (*arg1p);
if (target_read_memory (address + offset,
tmp, TYPE_LENGTH (baseclass)) != 0)
@@ -2293,6 +2298,7 @@
address + offset);
base_valaddr = value_contents_for_printing (base_val);
this_offset = 0;
+ do_cleanups (back_to);
}
else
{

View File

@ -0,0 +1,139 @@
http://sourceware.org/ml/gdb-cvs/2012-07/msg00213.html
### src/gdb/ChangeLog 2012/07/25 20:14:17 1.14531
### src/gdb/ChangeLog 2012/07/26 02:03:14 1.14532
## -1,3 +1,17 @@
+2012-07-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Expand parameter
+ SIZE to size_t.
+ (dwarf2_evaluate_loc_desc): Likewise.
+ (dwarf2_loc_desc_needs_frame): Likewise.
+ (locexpr_describe_location_1): Likewise.
+ * dwarf2loc.h (struct dwarf2_locexpr_baton): Make SIZE as
+ size_t.
+ (struct dwarf2_loclist_baton): Likewise.
+ * dwarf2read.c (struct dwarf_block): Likewise.
+ (dump_die_shallow): Use pulongest to print dwarf_block.size.
+ (decode_locdesc): Expand SIZE and I to size_t.
+
2012-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* contrib/cc-with-tweaks.sh: Put into comment path gdb/contrib/.
--- src/gdb/dwarf2loc.c 2012/07/13 20:15:50 1.152
+++ src/gdb/dwarf2loc.c 2012/07/26 02:03:16 1.153
@@ -54,8 +54,8 @@
static struct value *dwarf2_evaluate_loc_desc_full (struct type *type,
struct frame_info *frame,
const gdb_byte *data,
- unsigned short size,
- struct dwarf2_per_cu_data *per_cu,
+ size_t size,
+ struct dwarf2_per_cu_data *per_cu,
LONGEST byte_offset);
/* Until these have formal names, we define these here.
@@ -2111,7 +2111,7 @@
static struct value *
dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
- const gdb_byte *data, unsigned short size,
+ const gdb_byte *data, size_t size,
struct dwarf2_per_cu_data *per_cu,
LONGEST byte_offset)
{
@@ -2312,7 +2312,7 @@
struct value *
dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
- const gdb_byte *data, unsigned short size,
+ const gdb_byte *data, size_t size,
struct dwarf2_per_cu_data *per_cu)
{
return dwarf2_evaluate_loc_desc_full (type, frame, data, size, per_cu, 0);
@@ -2433,7 +2433,7 @@
requires a frame to evaluate. */
static int
-dwarf2_loc_desc_needs_frame (const gdb_byte *data, unsigned short size,
+dwarf2_loc_desc_needs_frame (const gdb_byte *data, size_t size,
struct dwarf2_per_cu_data *per_cu)
{
struct needs_frame_baton baton;
@@ -3827,7 +3827,7 @@
static void
locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
struct ui_file *stream,
- const gdb_byte *data, int size,
+ const gdb_byte *data, size_t size,
struct objfile *objfile, unsigned int addr_size,
int offset_size, struct dwarf2_per_cu_data *per_cu)
{
--- src/gdb/dwarf2loc.h 2012/05/22 18:45:22 1.33
+++ src/gdb/dwarf2loc.h 2012/07/26 02:03:16 1.34
@@ -77,7 +77,7 @@
struct value *dwarf2_evaluate_loc_desc (struct type *type,
struct frame_info *frame,
const gdb_byte *data,
- unsigned short size,
+ size_t size,
struct dwarf2_per_cu_data *per_cu);
CORE_ADDR dwarf2_read_addr_index (struct dwarf2_per_cu_data *per_cu,
@@ -97,7 +97,7 @@
/* Length of the location expression. For optimized out expressions it is
zero. */
- unsigned long size;
+ size_t size;
/* The compilation unit containing the symbol whose location
we're computing. */
@@ -114,7 +114,7 @@
const gdb_byte *data;
/* Length of the location list. */
- unsigned long size;
+ size_t size;
/* The compilation unit containing the symbol whose location
we're computing. */
--- src/gdb/dwarf2read.c 2012/07/20 17:38:04 1.697
+++ src/gdb/dwarf2read.c 2012/07/26 02:03:16 1.698
@@ -990,7 +990,7 @@
/* Blocks are a bunch of untyped bytes. */
struct dwarf_block
{
- unsigned int size;
+ size_t size;
/* Valid only if SIZE is not zero. */
gdb_byte *data;
@@ -16197,12 +16197,12 @@
case DW_FORM_block4:
case DW_FORM_block:
case DW_FORM_block1:
- fprintf_unfiltered (f, "block: size %d",
- DW_BLOCK (&die->attrs[i])->size);
+ fprintf_unfiltered (f, "block: size %s",
+ pulongest (DW_BLOCK (&die->attrs[i])->size));
break;
case DW_FORM_exprloc:
- fprintf_unfiltered (f, "expression: size %u",
- DW_BLOCK (&die->attrs[i])->size);
+ fprintf_unfiltered (f, "expression: size %s",
+ pulongest (DW_BLOCK (&die->attrs[i])->size));
break;
case DW_FORM_ref_addr:
fprintf_unfiltered (f, "ref address: ");
@@ -16746,8 +16746,8 @@
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
{
struct objfile *objfile = cu->objfile;
- int i;
- int size = blk->size;
+ size_t i;
+ size_t size = blk->size;
gdb_byte *data = blk->data;
CORE_ADDR stack[64];
int stacki;

View File

@ -0,0 +1,34 @@
http://sourceware.org/ml/gdb-cvs/2012-08/msg00085.html
### src/gdb/ChangeLog 2012/08/10 05:03:07 1.14574
### src/gdb/ChangeLog 2012/08/10 18:55:16 1.14575
## -1,3 +1,9 @@
+2012-08-10 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * python/py-type.c (convert_field): Use gdb_py_long_from_longest
+ for TYPE_FIELD_BITPOS.
+ (typy_get_sizeof): Likewise for TYPE_LENGTH.
+
2012-08-10 Mike Frysinger <vapier@gentoo.org>
PR cli/10436:
--- src/gdb/python/py-type.c 2012/05/18 21:02:52 1.39
+++ src/gdb/python/py-type.c 2012/08/10 18:55:18 1.40
@@ -176,7 +176,7 @@
}
else
{
- arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field));
+ arg = gdb_py_long_from_longest (TYPE_FIELD_BITPOS (type, field));
attrstring = "bitpos";
}
@@ -683,7 +683,7 @@
}
/* Ignore exceptions. */
- return PyLong_FromLong (TYPE_LENGTH (type));
+ return gdb_py_long_from_longest (TYPE_LENGTH (type));
}
static struct type *

View File

@ -0,0 +1,119 @@
http://sourceware.org/ml/gdb-cvs/2012-08/msg00187.html
### src/gdb/ChangeLog 2012/08/24 03:17:12 1.14628
### src/gdb/ChangeLog 2012/08/24 03:57:22 1.14629
## -1,3 +1,11 @@
+2012-08-24 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * h8300-tdep.c (h8300_push_dummy_call): Replace unsafe alloca
+ with xmalloc/cleanup.
+ * mt-tdep.c (mt_push_dummy_call): Likewise.
+ * tilegx-tdep.c (tilegx_push_dummy_call): Likewise.
+ * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise.
+
2012-08-24 Yao Qi <yao@codesourcery.com>
* jv-exp.y (push_expression_name): Add "." at the end of error
--- src/gdb/h8300-tdep.c 2012/05/18 21:02:47 1.133
+++ src/gdb/h8300-tdep.c 2012/08/24 03:57:22 1.134
@@ -666,13 +666,15 @@
for (argument = 0; argument < nargs; argument++)
{
+ struct cleanup *back_to;
struct type *type = value_type (args[argument]);
int len = TYPE_LENGTH (type);
char *contents = (char *) value_contents (args[argument]);
/* Pad the argument appropriately. */
int padded_len = align_up (len, wordsize);
- gdb_byte *padded = alloca (padded_len);
+ gdb_byte *padded = xmalloc (padded_len);
+ back_to = make_cleanup (xfree, padded);
memset (padded, 0, padded_len);
memcpy (len < wordsize ? padded + padded_len - len : padded,
@@ -720,6 +722,8 @@
subsequent arguments go on the stack. */
reg = E_ARGLAST_REGNUM + 1;
}
+
+ do_cleanups (back_to);
}
/* Store return address. */
--- src/gdb/mt-tdep.c 2012/05/16 14:35:06 1.40
+++ src/gdb/mt-tdep.c 2012/08/24 03:57:22 1.41
@@ -845,16 +845,20 @@
for (j = nargs - 1; j >= i; j--)
{
gdb_byte *val;
+ struct cleanup *back_to;
+ const gdb_byte *contents = value_contents (args[j]);
/* Right-justify the value in an aligned-length buffer. */
typelen = TYPE_LENGTH (value_type (args[j]));
slacklen = (wordsize - (typelen % wordsize)) % wordsize;
- val = alloca (typelen + slacklen);
- memcpy (val, value_contents (args[j]), typelen);
+ val = xmalloc (typelen + slacklen);
+ back_to = make_cleanup (xfree, val);
+ memcpy (val, contents, typelen);
memset (val + typelen, 0, slacklen);
/* Now write this data to the stack. */
stack_dest -= typelen + slacklen;
write_memory (stack_dest, val, typelen + slacklen);
+ do_cleanups (back_to);
}
/* Finally, if a param needs to be split between registers and stack,
--- src/gdb/tilegx-tdep.c 2012/05/30 19:31:44 1.1
+++ src/gdb/tilegx-tdep.c 2012/08/24 03:57:22 1.2
@@ -343,16 +343,20 @@
for (j = nargs - 1; j >= i; j--)
{
gdb_byte *val;
+ struct cleanup *back_to;
+ const gdb_byte *contents = value_contents (args[j]);
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
slacklen = ((typelen + 3) & (~3)) - typelen;
- val = alloca (typelen + slacklen);
- memcpy (val, value_contents (args[j]), typelen);
+ val = xmalloc (typelen + slacklen);
+ back_to = make_cleanup (xfree, val);
+ memcpy (val, contents, typelen);
memset (val + typelen, 0, slacklen);
/* Now write data to the stack. The stack grows downwards. */
stack_dest -= typelen + slacklen;
write_memory (stack_dest, val, typelen + slacklen);
+ do_cleanups (back_to);
}
/* Add 2 words for linkage space to the stack. */
--- src/gdb/xstormy16-tdep.c 2012/05/16 14:35:08 1.118
+++ src/gdb/xstormy16-tdep.c 2012/08/24 03:57:22 1.119
@@ -279,16 +279,20 @@
for (j = nargs - 1; j >= i; j--)
{
char *val;
+ struct cleanup *back_to;
+ const gdb_byte *bytes = value_contents (args[j]);
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
slacklen = typelen & 1;
- val = alloca (typelen + slacklen);
- memcpy (val, value_contents (args[j]), typelen);
+ val = xmalloc (typelen + slacklen);
+ back_to = make_cleanup (xfree, val);
+ memcpy (val, bytes, typelen);
memset (val + typelen, 0, slacklen);
/* Now write this data to the stack. The stack grows upwards. */
write_memory (stack_dest, val, typelen + slacklen);
stack_dest += typelen + slacklen;
+ do_cleanups (back_to);
}
store_unsigned_integer (buf, xstormy16_pc_size, byte_order, bp_addr);

View File

@ -0,0 +1,34 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00065.html
### src/gdb/ChangeLog 2012/09/14 00:54:57 1.14656
### src/gdb/ChangeLog 2012/09/14 07:00:37 1.14657
## -1,3 +1,8 @@
+2012-09-14 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * printcmd.c (ui_printf): Eliminate single-use variable
+ PARAM_LEN.
+
2012-09-14 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
--- src/gdb/printcmd.c 2012/09/11 21:26:16 1.211
+++ src/gdb/printcmd.c 2012/09/14 07:00:42 1.212
@@ -2267,7 +2267,6 @@
/* Parameter data. */
struct type *param_type = value_type (val_args[i]);
- unsigned int param_len = TYPE_LENGTH (param_type);
struct gdbarch *gdbarch = get_type_arch (param_type);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -2329,8 +2328,8 @@
/* Conversion between different DFP types. */
if (TYPE_CODE (param_type) == TYPE_CODE_DECFLOAT)
- decimal_convert (param_ptr, param_len, byte_order,
- dec, dfp_len, byte_order);
+ decimal_convert (param_ptr, TYPE_LENGTH (param_type),
+ byte_order, dec, dfp_len, byte_order);
else
/* If this is a non-trivial conversion, just output 0.
A correct converted value can be displayed by explicitly

View File

@ -0,0 +1,66 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00068.html
### src/gdb/ChangeLog 2012/09/14 12:10:21 1.14659
### src/gdb/ChangeLog 2012/09/14 12:46:55 1.14660
## -1,3 +1,8 @@
+2012-09-14 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * valarith.c (value_concat): Replace unsafe ALLOCA with
+ XMALLOC/XFREE.
+
2012-09-14 Pedro Alves <palves@redhat.com>
* gdb.1 (SEE ALSO): Expand pointer to GDB's Texinfo manual.
Index: gdb-7.5.0.20120926/gdb/valarith.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/valarith.c 2012-11-07 22:00:41.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/valarith.c 2012-11-07 22:02:18.661767281 +0100
@@ -716,9 +716,12 @@ value_concat (struct value *arg1, struct
if (TYPE_CODE (type2) == TYPE_CODE_STRING
|| TYPE_CODE (type2) == TYPE_CODE_CHAR)
{
+ struct cleanup *back_to;
+
count = longest_to_int (value_as_long (inval1));
inval2len = TYPE_LENGTH (type2);
- ptr = (char *) alloca (count * inval2len);
+ ptr = (char *) xmalloc (count * inval2len);
+ back_to = make_cleanup (xfree, ptr);
if (TYPE_CODE (type2) == TYPE_CODE_CHAR)
{
char_type = type2;
@@ -741,6 +744,7 @@ value_concat (struct value *arg1, struct
}
}
outval = value_string (ptr, count * inval2len, char_type);
+ do_cleanups (back_to);
}
else if (TYPE_CODE (type2) == TYPE_CODE_BITSTRING
|| TYPE_CODE (type2) == TYPE_CODE_BOOL)
@@ -755,6 +759,8 @@ value_concat (struct value *arg1, struct
else if (TYPE_CODE (type1) == TYPE_CODE_STRING
|| TYPE_CODE (type1) == TYPE_CODE_CHAR)
{
+ struct cleanup *back_to;
+
/* We have two character strings to concatenate. */
if (TYPE_CODE (type2) != TYPE_CODE_STRING
&& TYPE_CODE (type2) != TYPE_CODE_CHAR)
@@ -763,7 +769,8 @@ value_concat (struct value *arg1, struct
}
inval1len = TYPE_LENGTH (type1);
inval2len = TYPE_LENGTH (type2);
- ptr = (char *) alloca (inval1len + inval2len);
+ ptr = (char *) xmalloc (inval1len + inval2len);
+ back_to = make_cleanup (xfree, ptr);
if (TYPE_CODE (type1) == TYPE_CODE_CHAR)
{
char_type = type1;
@@ -786,6 +793,7 @@ value_concat (struct value *arg1, struct
memcpy (ptr + inval1len, value_contents (inval2), inval2len);
}
outval = value_string (ptr, inval1len + inval2len, char_type);
+ do_cleanups (back_to);
}
else if (TYPE_CODE (type1) == TYPE_CODE_BITSTRING
|| TYPE_CODE (type1) == TYPE_CODE_BOOL)

View File

@ -0,0 +1,28 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00082.html
### src/gdb/ChangeLog 2012/09/17 07:15:47 1.14664
### src/gdb/ChangeLog 2012/09/17 07:26:54 1.14665
## -1,3 +1,8 @@
+2012-09-17 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * infrun.c (restore_infcall_suspend_state): Eliminate single-use
+ variable LEN.
+
2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
PR 14119
--- src/gdb/infrun.c 2012/09/17 07:09:34 1.558
+++ src/gdb/infrun.c 2012/09/17 07:26:55 1.559
@@ -6777,11 +6777,10 @@
if (inf_state->siginfo_gdbarch == gdbarch)
{
struct type *type = gdbarch_get_siginfo_type (gdbarch);
- size_t len = TYPE_LENGTH (type);
/* Errors ignored. */
target_write (&current_target, TARGET_OBJECT_SIGNAL_INFO, NULL,
- inf_state->siginfo_data, 0, len);
+ inf_state->siginfo_data, 0, TYPE_LENGTH (type));
}
/* The inferior can be gone if the user types "print exit(0)"

View File

@ -0,0 +1,209 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00084.html
### src/gdb/ChangeLog 2012/09/17 08:42:07 1.14666
### src/gdb/ChangeLog 2012/09/17 08:52:17 1.14667
## -1,3 +1,23 @@
+2012-09-17 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * m2-valprint.c (m2_print_array_contents): Eliminate variable
+ ELTLEN and use TYPE_LENGTH directly.
+ (m2_val_print): Likewise.
+ * m68k-tdep.c (m68k_svr4_extract_return_value): Eliminate
+ variable LEN and use TYPE_LENGTH directly.
+ (m68k_svr4_store_return_value): Likewise.
+ * mips-tdep.c (mips_o32_push_dummy_call): Eliminate variable
+ ARGLEN and use TYPE_LENGTH directly.
+ (mips_o64_push_dummy_call): Likewise.
+ * s390-tdep (s390_function_arg_pass_by_reference): Eliminate
+ variable LENGTH and use TYPE_LENGTH directly.
+ (s390_function_arg_float): Likewise.
+ (s390_function_arg_integer): Likewise.
+ (s390_push_dummy_call): Likewise.
+ (s390_return_value_convention): Likewise.
+ * spu-tdep.c (spu_push_dummy_call): Eliminate LEN and use
+ TYPE_LENGTH directly.
+
2012-09-17 Yao Qi <yao@codesourcery.com>
* cli/cli-decode.c (add_setshow_zuinteger_unlimited_cmd): New.
--- src/gdb/m2-valprint.c 2012/08/16 07:36:20 1.45
+++ src/gdb/m2-valprint.c 2012/09/17 08:52:18 1.46
@@ -269,16 +269,14 @@
const struct value_print_options *options,
int len)
{
- int eltlen;
CHECK_TYPEDEF (type);
if (TYPE_LENGTH (type) > 0)
{
- eltlen = TYPE_LENGTH (type);
if (options->prettyprint_arrays)
print_spaces_filtered (2 + 2 * recurse, stream);
/* For an array of chars, print with string syntax. */
- if (eltlen == 1 &&
+ if (TYPE_LENGTH (type) == 1 &&
((TYPE_CODE (type) == TYPE_CODE_INT)
|| ((current_language->la_language == language_m2)
&& (TYPE_CODE (type) == TYPE_CODE_CHAR)))
@@ -320,7 +318,6 @@
unsigned int i = 0; /* Number of characters printed. */
unsigned len;
struct type *elttype;
- unsigned eltlen;
CORE_ADDR addr;
CHECK_TYPEDEF (type);
@@ -330,12 +327,11 @@
if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
{
elttype = check_typedef (TYPE_TARGET_TYPE (type));
- eltlen = TYPE_LENGTH (elttype);
- len = TYPE_LENGTH (type) / eltlen;
+ len = TYPE_LENGTH (type) / TYPE_LENGTH (elttype);
if (options->prettyprint_arrays)
print_spaces_filtered (2 + 2 * recurse, stream);
/* For an array of chars, print with string syntax. */
- if (eltlen == 1 &&
+ if (TYPE_LENGTH (elttype) == 1 &&
((TYPE_CODE (elttype) == TYPE_CODE_INT)
|| ((current_language->la_language == language_m2)
&& (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
--- src/gdb/m68k-tdep.c 2012/07/24 16:37:24 1.159
+++ src/gdb/m68k-tdep.c 2012/09/17 08:52:18 1.160
@@ -315,7 +315,6 @@
m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache,
gdb_byte *valbuf)
{
- int len = TYPE_LENGTH (type);
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -326,7 +325,7 @@
regcache_raw_read (regcache, M68K_FP0_REGNUM, buf);
convert_typed_floating (buf, fpreg_type, valbuf, type);
}
- else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4)
+ else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf);
else
m68k_extract_return_value (type, regcache, valbuf);
@@ -357,7 +356,6 @@
m68k_svr4_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
- int len = TYPE_LENGTH (type);
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -368,7 +366,7 @@
convert_typed_floating (valbuf, type, buf, fpreg_type);
regcache_raw_write (regcache, M68K_FP0_REGNUM, buf);
}
- else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4)
+ else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
{
regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf);
regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf);
--- src/gdb/mips-tdep.c 2012/08/19 22:22:49 1.561
+++ src/gdb/mips-tdep.c 2012/09/17 08:52:18 1.562
@@ -5174,13 +5174,12 @@
for (argnum = 0; argnum < nargs; argnum++)
{
struct type *arg_type = check_typedef (value_type (args[argnum]));
- int arglen = TYPE_LENGTH (arg_type);
/* Align to double-word if necessary. */
if (mips_type_needs_double_align (arg_type))
len = align_up (len, MIPS32_REGSIZE * 2);
/* Allocate space on the stack. */
- len += align_up (arglen, MIPS32_REGSIZE);
+ len += align_up (TYPE_LENGTH (arg_type), MIPS32_REGSIZE);
}
sp -= align_up (len, 16);
@@ -5703,10 +5702,9 @@
for (argnum = 0; argnum < nargs; argnum++)
{
struct type *arg_type = check_typedef (value_type (args[argnum]));
- int arglen = TYPE_LENGTH (arg_type);
/* Allocate space on the stack. */
- len += align_up (arglen, MIPS64_REGSIZE);
+ len += align_up (TYPE_LENGTH (arg_type), MIPS64_REGSIZE);
}
sp -= align_up (len, 16);
--- src/gdb/s390-tdep.c 2012/05/18 21:02:50 1.206
+++ src/gdb/s390-tdep.c 2012/09/17 08:52:18 1.207
@@ -2489,8 +2489,7 @@
static int
s390_function_arg_pass_by_reference (struct type *type)
{
- unsigned length = TYPE_LENGTH (type);
- if (length > 8)
+ if (TYPE_LENGTH (type) > 8)
return 1;
return (is_struct_like (type) && !is_power_of_two (TYPE_LENGTH (type)))
@@ -2503,8 +2502,7 @@
static int
s390_function_arg_float (struct type *type)
{
- unsigned length = TYPE_LENGTH (type);
- if (length > 8)
+ if (TYPE_LENGTH (type) > 8)
return 0;
return is_float_like (type);
@@ -2515,13 +2513,12 @@
static int
s390_function_arg_integer (struct type *type)
{
- unsigned length = TYPE_LENGTH (type);
- if (length > 8)
+ if (TYPE_LENGTH (type) > 8)
return 0;
return is_integer_like (type)
|| is_pointer_like (type)
- || (is_struct_like (type) && is_power_of_two (length));
+ || (is_struct_like (type) && is_power_of_two (TYPE_LENGTH (type)));
}
/* Return ARG, a `SIMPLE_ARG', sign-extended or zero-extended to a full
@@ -2616,11 +2613,10 @@
{
struct value *arg = args[i];
struct type *type = check_typedef (value_type (arg));
- unsigned length = TYPE_LENGTH (type);
if (s390_function_arg_pass_by_reference (type))
{
- sp -= length;
+ sp -= TYPE_LENGTH (type);
sp = align_down (sp, alignment_of (type));
copy_addr[i] = sp;
}
@@ -2799,8 +2795,7 @@
static enum return_value_convention
s390_return_value_convention (struct gdbarch *gdbarch, struct type *type)
{
- int length = TYPE_LENGTH (type);
- if (length > 8)
+ if (TYPE_LENGTH (type) > 8)
return RETURN_VALUE_STRUCT_CONVENTION;
switch (TYPE_CODE (type))
--- src/gdb/spu-tdep.c 2012/05/18 21:02:50 1.81
+++ src/gdb/spu-tdep.c 2012/09/17 08:52:18 1.82
@@ -1373,8 +1373,7 @@
struct value *arg = args[i];
struct type *type = check_typedef (value_type (arg));
const gdb_byte *contents = value_contents (arg);
- int len = TYPE_LENGTH (type);
- int n_regs = align_up (len, 16) / 16;
+ int n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
/* If the argument doesn't wholly fit into registers, it and
all subsequent arguments go to the stack. */

View File

@ -0,0 +1,36 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00132.html
### src/gdb/ChangeLog 2012/09/22 13:04:54 1.14691
### src/gdb/ChangeLog 2012/09/24 10:25:07 1.14692
## -1,3 +1,8 @@
+2012-09-24 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * m2-typeprint.c (m2_enum): Expand LASTVAL to LONGEST.
+ * p-valprint.c (pascal_type_print_base): Likewise.
+
2012-09-22 Yao Qi <yao@codesourcery.com>
* remote.c (remote_get_trace_status): Remove setting default
--- src/gdb/m2-typeprint.c 2012/04/18 06:46:46 1.30
+++ src/gdb/m2-typeprint.c 2012/09/24 10:25:09 1.31
@@ -587,7 +587,8 @@
void
m2_enum (struct type *type, struct ui_file *stream, int show, int level)
{
- int lastval, i, len;
+ LONGEST lastval;
+ int i, len;
if (show < 0)
{
--- src/gdb/p-typeprint.c 2012/08/16 07:36:20 1.47
+++ src/gdb/p-typeprint.c 2012/09/24 10:25:09 1.48
@@ -440,7 +440,7 @@
{
int i;
int len;
- int lastval;
+ LONGEST lastval;
enum
{
s_none, s_public, s_private, s_protected

View File

@ -0,0 +1,27 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00138.html
### src/gdb/ChangeLog 2012/09/24 10:25:07 1.14692
### src/gdb/ChangeLog 2012/09/25 12:20:35 1.14693
## -1,3 +1,8 @@
+2012-09-25 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * c-typeprint.c (c_type_print_varspec_suffix): Remove cast and
+ use plongest to print the array size.
+
2012-09-24 Siddhesh Poyarekar <siddhesh@redhat.com>
* m2-typeprint.c (m2_enum): Expand LASTVAL to LONGEST.
Index: gdb-7.5.0.20120926/gdb/c-typeprint.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/c-typeprint.c 2012-11-07 22:00:40.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/c-typeprint.c 2012-11-07 22:03:39.269650157 +0100
@@ -631,7 +631,8 @@ c_type_print_varspec_suffix (struct type
fprintf_filtered (stream, "variable");
}
else if (get_array_bounds (type, &low_bound, &high_bound))
- fprintf_filtered (stream, "%d", (int) (high_bound - low_bound + 1));
+ fprintf_filtered (stream, "%s",
+ plongest (high_bound - low_bound + 1));
fprintf_filtered (stream, "]");
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream,

View File

@ -0,0 +1,729 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00142.html
### src/gdb/ChangeLog 2012/09/25 12:38:55 1.14696
### src/gdb/ChangeLog 2012/09/25 12:48:52 1.14697
## -1,3 +1,36 @@
+2012-09-25 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * ada-valprint.c (ada_val_print_1): Eliminate single-use
+ variable LEN.
+ * alpha-tdep.c (alpha_extract_return_value): Use TYPE_LENGTH
+ directly.
+ (alpha_store_return_value): Likewise.
+ * amd64-tdep.c (amd64_classify_aggregate): Likewise.
+ (amd64_push_arguments): Likewise.
+ * ax-gdb.c (gen_trace_static_fields): Likewise.
+ (gen_traced_pop): Likewise.
+ * bfin-tdep.c (bfin_push_dummy_call): Likewise.
+ * breakpoint.c (update_watchpoint): Likewise.
+ * findcmd.c (parse_find_args): Use local variable for type
+ instead of length.
+ * findvar.c (default_read_var_value): Use TYPE_LENGTH directly.
+ * h8300-tdep.c (h8300h_extract_return_value): Likewise.
+ (h8300_store_return_value): Likewise.
+ * i386-darwin-tdep.c (i386_darwin_push_dummy_call): Likewise.
+ Use i386_darwin_arg_type_alignment directly.
+ * infcall.c (call_function_by_hand): Use TYPE_LENGTH directly.
+ * lm32-tdep.c (lm32_push_dummy_call): Likewise.
+ * m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise.
+ (m68hc11_extract_return_value): Likewise.
+ * mep-tdep.c (mep_push_dummy_call): Likewise.
+ * printcmd.c (float_type_from_length): Likewise.
+ * s390-tdep.c (s390_value_from_register): Likewise.
+ * stack.c (read_frame_arg): Likewise.
+ * tracepoint.c (encode_actions_1): Likewise.
+ * valops.c (value_fetch_lazy): Use local variable for type
+ instead of length. Use TYPE_LENGTH directly.
+ * value.c (value_contents_equal): Use TYPE_LENGTH directly.
+
2012-09-25 Joel Brobecker <brobecker@adacore.com>
* symtab.c (skip_prologue_sal): Fix typo in comment.
Index: gdb-7.5.0.20120926/gdb/ada-valprint.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/ada-valprint.c 2012-04-18 08:46:46.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/ada-valprint.c 2012-11-07 22:03:57.600623522 +0100
@@ -730,9 +730,8 @@ ada_val_print_1 (struct type *type, cons
if (ada_is_fixed_point_type (type))
{
LONGEST v = unpack_long (type, valaddr + offset_aligned);
- int len = TYPE_LENGTH (type);
- fprintf_filtered (stream, len < 4 ? "%.11g" : "%.17g",
+ fprintf_filtered (stream, TYPE_LENGTH (type) < 4 ? "%.11g" : "%.17g",
(double) ada_fixed_to_float (type, v));
return;
}
Index: gdb-7.5.0.20120926/gdb/alpha-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/alpha-tdep.c 2012-05-16 16:35:02.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/alpha-tdep.c 2012-11-07 22:03:57.602623520 +0100
@@ -475,14 +475,13 @@ alpha_extract_return_value (struct type
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int length = TYPE_LENGTH (valtype);
gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
ULONGEST l;
switch (TYPE_CODE (valtype))
{
case TYPE_CODE_FLT:
- switch (length)
+ switch (TYPE_LENGTH (valtype))
{
case 4:
regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, raw_buffer);
@@ -505,7 +504,7 @@ alpha_extract_return_value (struct type
break;
case TYPE_CODE_COMPLEX:
- switch (length)
+ switch (TYPE_LENGTH (valtype))
{
case 8:
/* ??? This isn't correct wrt the ABI, but it's what GCC does. */
@@ -531,7 +530,7 @@ alpha_extract_return_value (struct type
default:
/* Assume everything else degenerates to an integer. */
regcache_cooked_read_unsigned (regcache, ALPHA_V0_REGNUM, &l);
- store_unsigned_integer (valbuf, length, byte_order, l);
+ store_unsigned_integer (valbuf, TYPE_LENGTH (valtype), byte_order, l);
break;
}
}
@@ -544,14 +543,13 @@ alpha_store_return_value (struct type *v
const gdb_byte *valbuf)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
- int length = TYPE_LENGTH (valtype);
gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
ULONGEST l;
switch (TYPE_CODE (valtype))
{
case TYPE_CODE_FLT:
- switch (length)
+ switch (TYPE_LENGTH (valtype))
{
case 4:
alpha_lds (gdbarch, raw_buffer, valbuf);
@@ -575,7 +573,7 @@ alpha_store_return_value (struct type *v
break;
case TYPE_CODE_COMPLEX:
- switch (length)
+ switch (TYPE_LENGTH (valtype))
{
case 8:
/* ??? This isn't correct wrt the ABI, but it's what GCC does. */
@@ -603,7 +601,7 @@ alpha_store_return_value (struct type *v
/* Assume everything else degenerates to an integer. */
/* 32-bit values must be sign-extended to 64 bits
even if the base data type is unsigned. */
- if (length == 4)
+ if (TYPE_LENGTH (valtype) == 4)
valtype = builtin_type (gdbarch)->builtin_int32;
l = unpack_long (valtype, valbuf);
regcache_cooked_write_unsigned (regcache, ALPHA_V0_REGNUM, l);
Index: gdb-7.5.0.20120926/gdb/amd64-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/amd64-tdep.c 2012-11-07 22:00:42.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/amd64-tdep.c 2012-11-07 22:03:57.623623489 +0100
@@ -446,12 +446,10 @@ amd64_non_pod_p (struct type *type)
static void
amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
{
- int len = TYPE_LENGTH (type);
-
/* 1. If the size of an object is larger than two eightbytes, or in
C++, is a non-POD structure or union type, or contains
unaligned fields, it has class memory. */
- if (len > 16 || amd64_non_pod_p (type))
+ if (TYPE_LENGTH (type) > 16 || amd64_non_pod_p (type))
{
class[0] = class[1] = AMD64_MEMORY;
return;
@@ -471,7 +469,7 @@ amd64_classify_aggregate (struct type *t
/* All fields in an array have the same type. */
amd64_classify (subtype, class);
- if (len > 8 && class[1] == AMD64_NO_CLASS)
+ if (TYPE_LENGTH (type) > 8 && class[1] == AMD64_NO_CLASS)
class[1] = class[0];
}
else
@@ -839,10 +837,9 @@ amd64_push_arguments (struct regcache *r
{
struct type *type = value_type (stack_args[i]);
const gdb_byte *valbuf = value_contents (stack_args[i]);
- int len = TYPE_LENGTH (type);
CORE_ADDR arg_addr = sp + element * 8;
- write_memory (arg_addr, valbuf, len);
+ write_memory (arg_addr, valbuf, TYPE_LENGTH (type));
if (arg_addr_regno[i] >= 0)
{
/* We also need to store the address of that argument in
@@ -853,7 +850,7 @@ amd64_push_arguments (struct regcache *r
store_unsigned_integer (buf, 8, byte_order, arg_addr);
regcache_cooked_write (regcache, arg_addr_regno[i], buf);
}
- element += ((len + 7) / 8);
+ element += ((TYPE_LENGTH (type) + 7) / 8);
}
/* The psABI says that "For calls that may call functions that use
Index: gdb-7.5.0.20120926/gdb/ax-gdb.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/ax-gdb.c 2012-07-05 03:03:01.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/ax-gdb.c 2012-11-07 22:03:57.626623484 +0100
@@ -367,9 +367,9 @@ gen_trace_static_fields (struct gdbarch
{
case axs_lvalue_memory:
{
- int length = TYPE_LENGTH (check_typedef (value.type));
-
- ax_const_l (ax, length);
+ /* Initialize the TYPE_LENGTH if it is a typedef. */
+ check_typedef (value.type);
+ ax_const_l (ax, TYPE_LENGTH (value.type));
ax_simple (ax, aop_trace);
}
break;
@@ -425,17 +425,18 @@ gen_traced_pop (struct gdbarch *gdbarch,
case axs_lvalue_memory:
{
- int length = TYPE_LENGTH (check_typedef (value->type));
-
if (string_trace)
ax_simple (ax, aop_dup);
+ /* Initialize the TYPE_LENGTH if it is a typedef. */
+ check_typedef (value->type);
+
/* There's no point in trying to use a trace_quick bytecode
here, since "trace_quick SIZE pop" is three bytes, whereas
"const8 SIZE trace" is also three bytes, does the same
thing, and the simplest code which generates that will also
work correctly for objects with large sizes. */
- ax_const_l (ax, length);
+ ax_const_l (ax, TYPE_LENGTH (value->type));
ax_simple (ax, aop_trace);
if (string_trace)
Index: gdb-7.5.0.20120926/gdb/bfin-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/bfin-tdep.c 2012-05-16 16:35:03.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/bfin-tdep.c 2012-11-07 22:03:57.643623460 +0100
@@ -513,9 +513,8 @@ bfin_push_dummy_call (struct gdbarch *gd
for (i = nargs - 1; i >= 0; i--)
{
struct type *value_type = value_enclosing_type (args[i]);
- int len = TYPE_LENGTH (value_type);
- total_len += (len + 3) & ~3;
+ total_len += (TYPE_LENGTH (value_type) + 3) & ~3;
}
/* At least twelve bytes of stack space must be allocated for the function's
@@ -531,8 +530,7 @@ bfin_push_dummy_call (struct gdbarch *gd
{
struct type *value_type = value_enclosing_type (args[i]);
struct type *arg_type = check_typedef (value_type);
- int len = TYPE_LENGTH (value_type);
- int container_len = (len + 3) & ~3;
+ int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
sp -= container_len;
write_memory (sp, value_contents_writeable (args[i]), container_len);
Index: gdb-7.5.0.20120926/gdb/breakpoint.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/breakpoint.c 2012-11-07 22:00:43.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/breakpoint.c 2012-11-07 22:03:57.660623434 +0100
@@ -1844,11 +1844,10 @@ update_watchpoint (struct watchpoint *b,
&& TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
{
CORE_ADDR addr;
- int len, type;
+ int type;
struct bp_location *loc, **tmp;
addr = value_address (v);
- len = TYPE_LENGTH (value_type (v));
type = hw_write;
if (b->base.type == bp_read_watchpoint)
type = hw_read;
@@ -1863,7 +1862,7 @@ update_watchpoint (struct watchpoint *b,
loc->pspace = frame_pspace;
loc->address = addr;
- loc->length = len;
+ loc->length = TYPE_LENGTH (value_type (v));
loc->watchpoint_type = type;
}
}
Index: gdb-7.5.0.20120926/gdb/findcmd.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/findcmd.c 2012-07-06 17:51:39.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/findcmd.c 2012-11-07 22:03:57.676623411 +0100
@@ -169,19 +169,19 @@ parse_find_args (char *args, ULONGEST *m
while (*s != '\0')
{
LONGEST x;
- int val_bytes;
+ struct type *t;
ULONGEST pattern_buf_size_need;
while (isspace (*s))
++s;
v = parse_to_comma_and_eval (&s);
- val_bytes = TYPE_LENGTH (value_type (v));
+ t = value_type (v);
/* Keep it simple and assume size == 'g' when watching for when we
need to grow the pattern buf. */
pattern_buf_size_need = (pattern_buf_end - pattern_buf
- + max (val_bytes, sizeof (int64_t)));
+ + max (TYPE_LENGTH (t), sizeof (int64_t)));
if (pattern_buf_size_need > pattern_buf_size)
{
size_t current_offset = pattern_buf_end - pattern_buf;
@@ -215,8 +215,8 @@ parse_find_args (char *args, ULONGEST *m
}
else
{
- memcpy (pattern_buf_end, value_contents (v), val_bytes);
- pattern_buf_end += val_bytes;
+ memcpy (pattern_buf_end, value_contents (v), TYPE_LENGTH (t));
+ pattern_buf_end += TYPE_LENGTH (t);
}
if (*s == ',')
Index: gdb-7.5.0.20120926/gdb/h8300-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/h8300-tdep.c 2012-11-07 22:00:44.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/h8300-tdep.c 2012-11-07 22:03:57.679623409 +0100
@@ -785,16 +785,15 @@ h8300h_extract_return_value (struct type
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int len = TYPE_LENGTH (type);
ULONGEST c;
- switch (len)
+ switch (TYPE_LENGTH (type))
{
case 1:
case 2:
case 4:
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
- store_unsigned_integer (valbuf, len, byte_order, c);
+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c);
break;
case 8: /* long long is now 8 bytes. */
if (TYPE_CODE (type) == TYPE_CODE_INT)
@@ -852,18 +851,17 @@ h8300_store_return_value (struct type *t
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int len = TYPE_LENGTH (type);
ULONGEST val;
- switch (len)
+ switch (TYPE_LENGTH (type))
{
case 1:
case 2: /* short... */
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val);
break;
case 4: /* long, float */
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM,
(val >> 16) & 0xffff);
regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM, val & 0xffff);
@@ -882,19 +880,18 @@ h8300h_store_return_value (struct type *
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int len = TYPE_LENGTH (type);
ULONGEST val;
- switch (len)
+ switch (TYPE_LENGTH (type))
{
case 1:
case 2:
case 4: /* long, float */
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val);
break;
case 8:
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM,
(val >> 32) & 0xffffffff);
regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM,
Index: gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/i386-darwin-tdep.c 2012-04-02 15:15:48.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c 2012-11-07 22:03:57.680623407 +0100
@@ -196,13 +196,12 @@ i386_darwin_push_dummy_call (struct gdba
}
else
{
- int len = TYPE_LENGTH (arg_type);
- int align = i386_darwin_arg_type_alignment (arg_type);
-
- args_space = align_up (args_space, align);
+ args_space = align_up (args_space,
+ i386_darwin_arg_type_alignment (arg_type));
if (write_pass)
write_memory (sp + args_space,
- value_contents_all (args[i]), len);
+ value_contents_all (args[i]),
+ TYPE_LENGTH (arg_type));
/* The System V ABI says that:
@@ -211,7 +210,7 @@ i386_darwin_push_dummy_call (struct gdba
depending on the size of the argument."
This makes sure the stack stays word-aligned. */
- args_space += align_up (len, 4);
+ args_space += align_up (TYPE_LENGTH (arg_type), 4);
}
}
Index: gdb-7.5.0.20120926/gdb/infcall.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/infcall.c 2012-07-31 09:34:39.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/infcall.c 2012-11-07 22:03:57.694623385 +0100
@@ -709,13 +709,11 @@ call_function_by_hand (struct value *fun
if (struct_return || hidden_first_param_p)
{
- int len = TYPE_LENGTH (values_type);
-
if (gdbarch_inner_than (gdbarch, 1, 2))
{
/* Stack grows downward. Align STRUCT_ADDR and SP after
making space for the return value. */
- sp -= len;
+ sp -= TYPE_LENGTH (values_type);
if (gdbarch_frame_align_p (gdbarch))
sp = gdbarch_frame_align (gdbarch, sp);
struct_addr = sp;
@@ -727,7 +725,7 @@ call_function_by_hand (struct value *fun
if (gdbarch_frame_align_p (gdbarch))
sp = gdbarch_frame_align (gdbarch, sp);
struct_addr = sp;
- sp += len;
+ sp += TYPE_LENGTH (values_type);
if (gdbarch_frame_align_p (gdbarch))
sp = gdbarch_frame_align (gdbarch, sp);
}
Index: gdb-7.5.0.20120926/gdb/lm32-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/lm32-tdep.c 2012-05-18 23:02:48.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/lm32-tdep.c 2012-11-07 22:03:57.695623384 +0100
@@ -261,7 +261,6 @@ lm32_push_dummy_call (struct gdbarch *gd
struct value *arg = args[i];
struct type *arg_type = check_typedef (value_type (arg));
gdb_byte *contents;
- int len;
ULONGEST val;
/* Promote small integer types to int. */
@@ -283,8 +282,8 @@ lm32_push_dummy_call (struct gdbarch *gd
/* FIXME: Handle structures. */
contents = (gdb_byte *) value_contents (arg);
- len = TYPE_LENGTH (arg_type);
- val = extract_unsigned_integer (contents, len, byte_order);
+ val = extract_unsigned_integer (contents, TYPE_LENGTH (arg_type),
+ byte_order);
/* First num_arg_regs parameters are passed by registers,
and the rest are passed on the stack. */
@@ -292,7 +291,7 @@ lm32_push_dummy_call (struct gdbarch *gd
regcache_cooked_write_unsigned (regcache, first_arg_reg + i, val);
else
{
- write_memory (sp, (void *) &val, len);
+ write_memory (sp, (void *) &val, TYPE_LENGTH (arg_type));
sp -= 4;
}
}
Index: gdb-7.5.0.20120926/gdb/m68hc11-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/m68hc11-tdep.c 2012-05-16 16:35:06.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/m68hc11-tdep.c 2012-11-07 22:03:57.724623347 +0100
@@ -1174,7 +1174,6 @@ m68hc11_push_dummy_call (struct gdbarch
int first_stack_argnum;
struct type *type;
char *val;
- int len;
char buf[2];
first_stack_argnum = 0;
@@ -1185,19 +1184,18 @@ m68hc11_push_dummy_call (struct gdbarch
else if (nargs > 0)
{
type = value_type (args[0]);
- len = TYPE_LENGTH (type);
/* First argument is passed in D and X registers. */
- if (len <= 4)
+ if (TYPE_LENGTH (type) <= 4)
{
ULONGEST v;
v = extract_unsigned_integer (value_contents (args[0]),
- len, byte_order);
+ TYPE_LENGTH (type), byte_order);
first_stack_argnum = 1;
regcache_cooked_write_unsigned (regcache, HARD_D_REGNUM, v);
- if (len > 2)
+ if (TYPE_LENGTH (type) > 2)
{
v >>= 16;
regcache_cooked_write_unsigned (regcache, HARD_X_REGNUM, v);
@@ -1208,9 +1206,8 @@ m68hc11_push_dummy_call (struct gdbarch
for (argnum = nargs - 1; argnum >= first_stack_argnum; argnum--)
{
type = value_type (args[argnum]);
- len = TYPE_LENGTH (type);
- if (len & 1)
+ if (TYPE_LENGTH (type) & 1)
{
static char zero = 0;
@@ -1218,8 +1215,8 @@ m68hc11_push_dummy_call (struct gdbarch
write_memory (sp, &zero, 1);
}
val = (char*) value_contents (args[argnum]);
- sp -= len;
- write_memory (sp, val, len);
+ sp -= TYPE_LENGTH (type);
+ write_memory (sp, val, TYPE_LENGTH (type));
}
/* Store return address. */
@@ -1291,11 +1288,10 @@ static void
m68hc11_extract_return_value (struct type *type, struct regcache *regcache,
void *valbuf)
{
- int len = TYPE_LENGTH (type);
char buf[M68HC11_REG_SIZE];
regcache_raw_read (regcache, HARD_D_REGNUM, buf);
- switch (len)
+ switch (TYPE_LENGTH (type))
{
case 1:
memcpy (valbuf, buf + 1, 1);
Index: gdb-7.5.0.20120926/gdb/mep-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/mep-tdep.c 2012-05-16 16:35:06.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/mep-tdep.c 2012-11-07 22:03:57.727623334 +0100
@@ -2337,11 +2337,10 @@ mep_push_dummy_call (struct gdbarch *gdb
for (i = 0; i < argc; i++)
{
- unsigned arg_size = TYPE_LENGTH (value_type (argv[i]));
ULONGEST value;
/* Arguments that fit in a GPR get expanded to fill the GPR. */
- if (arg_size <= MEP_GPR_SIZE)
+ if (TYPE_LENGTH (value_type (argv[i])) <= MEP_GPR_SIZE)
value = extract_unsigned_integer (value_contents (argv[i]),
TYPE_LENGTH (value_type (argv[i])),
byte_order);
Index: gdb-7.5.0.20120926/gdb/printcmd.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/printcmd.c 2012-11-07 22:00:44.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/printcmd.c 2012-11-07 22:03:57.730623334 +0100
@@ -347,13 +347,12 @@ float_type_from_length (struct type *typ
{
struct gdbarch *gdbarch = get_type_arch (type);
const struct builtin_type *builtin = builtin_type (gdbarch);
- unsigned int len = TYPE_LENGTH (type);
- if (len == TYPE_LENGTH (builtin->builtin_float))
+ if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_float))
type = builtin->builtin_float;
- else if (len == TYPE_LENGTH (builtin->builtin_double))
+ else if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_double))
type = builtin->builtin_double;
- else if (len == TYPE_LENGTH (builtin->builtin_long_double))
+ else if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_long_double))
type = builtin->builtin_long_double;
return type;
Index: gdb-7.5.0.20120926/gdb/s390-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/s390-tdep.c 2012-11-07 22:02:30.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/s390-tdep.c 2012-11-07 22:03:57.733623329 +0100
@@ -376,9 +376,11 @@ s390_value_from_register (struct type *t
struct frame_info *frame)
{
struct value *value = default_value_from_register (type, regnum, frame);
- int len = TYPE_LENGTH (check_typedef (type));
- if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && len < 8)
+ check_typedef (type);
+
+ if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM
+ && TYPE_LENGTH (type) < 8)
set_value_offset (value, 0);
return value;
Index: gdb-7.5.0.20120926/gdb/stack.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/stack.c 2012-11-07 22:00:43.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/stack.c 2012-11-07 22:03:57.737623322 +0100
@@ -354,14 +354,15 @@ read_frame_arg (struct symbol *sym, stru
if (val && entryval && !ui_out_is_mi_like_p (current_uiout))
{
- unsigned len = TYPE_LENGTH (value_type (val));
+ struct type *type = value_type (val);
if (!value_optimized_out (val) && value_lazy (val))
value_fetch_lazy (val);
if (!value_optimized_out (val) && value_lazy (entryval))
value_fetch_lazy (entryval);
if (!value_optimized_out (val)
- && value_available_contents_eq (val, 0, entryval, 0, len))
+ && value_available_contents_eq (val, 0, entryval, 0,
+ TYPE_LENGTH (type)))
{
/* Initialize it just to avoid a GCC false warning. */
struct value *val_deref = NULL, *entryval_deref;
@@ -373,12 +374,12 @@ read_frame_arg (struct symbol *sym, stru
TRY_CATCH (except, RETURN_MASK_ERROR)
{
- unsigned len_deref;
+ struct type *type_deref;
val_deref = coerce_ref (val);
if (value_lazy (val_deref))
value_fetch_lazy (val_deref);
- len_deref = TYPE_LENGTH (value_type (val_deref));
+ type_deref = value_type (val_deref);
entryval_deref = coerce_ref (entryval);
if (value_lazy (entryval_deref))
@@ -389,7 +390,7 @@ read_frame_arg (struct symbol *sym, stru
if (val != val_deref
&& value_available_contents_eq (val_deref, 0,
entryval_deref, 0,
- len_deref))
+ TYPE_LENGTH (type_deref)))
val_equal = 1;
}
Index: gdb-7.5.0.20120926/gdb/tracepoint.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/tracepoint.c 2012-06-30 00:46:46.000000000 +0200
+++ gdb-7.5.0.20120926/gdb/tracepoint.c 2012-11-07 22:03:57.741623318 +0100
@@ -1450,7 +1450,7 @@ encode_actions_1 (struct command_line *a
}
else
{
- unsigned long addr, len;
+ unsigned long addr;
struct cleanup *old_chain = NULL;
struct cleanup *old_chain1 = NULL;
@@ -1480,8 +1480,10 @@ encode_actions_1 (struct command_line *a
/* Safe because we know it's a simple expression. */
tempval = evaluate_expression (exp);
addr = value_address (tempval);
- len = TYPE_LENGTH (check_typedef (exp->elts[1].type));
- add_memrange (collect, memrange_absolute, addr, len);
+ /* Initialize the TYPE_LENGTH if it is a typedef. */
+ check_typedef (exp->elts[1].type);
+ add_memrange (collect, memrange_absolute, addr,
+ TYPE_LENGTH (exp->elts[1].type));
break;
case OP_VAR_VALUE:
Index: gdb-7.5.0.20120926/gdb/valops.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/valops.c 2012-11-07 22:00:44.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/valops.c 2012-11-07 22:06:35.899393539 +0100
@@ -1055,7 +1055,6 @@ value_fetch_lazy (struct value *val)
struct value *parent = value_parent (val);
LONGEST offset = value_offset (val);
LONGEST num;
- int length = TYPE_LENGTH (type);
if (!value_bits_valid (val,
TARGET_CHAR_BIT * offset + value_bitpos (val),
@@ -1069,9 +1068,9 @@ value_fetch_lazy (struct value *val)
value_bitsize (val), parent, &num))
mark_value_bytes_unavailable (val,
value_embedded_offset (val),
- length);
+ TYPE_LENGTH (type));
else
- store_signed_integer (value_contents_raw (val), length,
+ store_signed_integer (value_contents_raw (val), TYPE_LENGTH (type),
byte_order, num);
}
else if (VALUE_LVAL (val) == lval_memory)
@@ -1080,16 +1079,16 @@ value_fetch_lazy (struct value *val)
if (object_address_get_data (value_type (val), &addr))
{
- struct type *type = value_enclosing_type (val);
- int length = TYPE_LENGTH (check_typedef (type));
+ struct type *type = check_typedef (value_enclosing_type (val));
- if (length)
+ if (TYPE_LENGTH (type))
{
/* Delay it after object_address_get_data above. */
allocate_value_contents (val);
addr += value_offset (val);
read_value_memory (val, 0, value_stack (val),
- addr, value_contents_all_raw (val), length);
+ addr, value_contents_all_raw (val),
+ TYPE_LENGTH (type));
}
}
/* Just to be sure it has been called. */
Index: gdb-7.5.0.20120926/gdb/value.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/value.c 2012-11-07 22:00:43.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/value.c 2012-11-07 22:03:57.751623303 +0100
@@ -1034,15 +1034,14 @@ value_contents_equal (struct value *val1
{
struct type *type1;
struct type *type2;
- int len;
type1 = check_typedef (value_type (val1));
type2 = check_typedef (value_type (val2));
- len = TYPE_LENGTH (type1);
- if (len != TYPE_LENGTH (type2))
+ if (TYPE_LENGTH (type1) != TYPE_LENGTH (type2))
return 0;
- return (memcmp (value_contents (val1), value_contents (val2), len) == 0);
+ return (memcmp (value_contents (val1), value_contents (val2),
+ TYPE_LENGTH (type1)) == 0);
}
int

View File

@ -0,0 +1,45 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00145.html
### src/gdb/ChangeLog 2012/09/25 12:48:52 1.14697
### src/gdb/ChangeLog 2012/09/26 02:06:51 1.14698
## -1,3 +1,8 @@
+2012-09-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * breakpoint.c (invalidate_bp_value_on_memory_change): Expand
+ parameter LEN to ssize_t.
+
2012-09-25 Siddhesh Poyarekar <siddhesh@redhat.com>
* ada-valprint.c (ada_val_print_1): Eliminate single-use
--- src/gdb/breakpoint.c 2012/09/25 12:48:52 1.705
+++ src/gdb/breakpoint.c 2012/09/26 02:06:54 1.706
@@ -14718,7 +14718,7 @@
GDB itself. */
static void
-invalidate_bp_value_on_memory_change (CORE_ADDR addr, int len,
+invalidate_bp_value_on_memory_change (CORE_ADDR addr, ssize_t len,
const bfd_byte *data)
{
struct breakpoint *bp;
### src/gdb/doc/ChangeLog 2012/09/21 01:46:42 1.1370
### src/gdb/doc/ChangeLog 2012/09/26 02:06:55 1.1371
## -1,3 +1,7 @@
+2012-09-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * observer.texi (memory_changed): Expand parameter LEN to ssize_t.
+
2012-09-21 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
--- src/gdb/doc/observer.texi 2012/09/21 01:46:43 1.40
+++ src/gdb/doc/observer.texi 2012/09/26 02:06:55 1.41
@@ -230,7 +230,7 @@
This method is called immediately before freeing @var{inf}.
@end deftypefun
-@deftypefun void memory_changed (CORE_ADDR @var{addr}, int @var{len}, const bfd_byte *@var{data})
+@deftypefun void memory_changed (CORE_ADDR @var{addr}, ssize_t @var{len}, const bfd_byte *@var{data})
Bytes from @var{data} to @var{data} + @var{len} have been written
to the current inferior at @var{addr}.
@end deftypefun

View File

@ -0,0 +1,260 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00147.html
### src/gdb/ChangeLog 2012/09/26 02:06:51 1.14698
### src/gdb/ChangeLog 2012/09/26 07:52:44 1.14699
## -1,5 +1,19 @@
2012-09-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+ * amd64-tdep.c (amd64_return_value): Use TYPE_LENGTH directly.
+ * bfin-tdep.c (bfin_extract_return_value): Likewise.
+ (bfin_store_return_value): Likewise.
+ * cris-tdep.c (cris_store_return_value): Likewise.
+ (cris_extract_return_value): Likewise.
+ * h8300-tdep.c (h8300_extract_return_value): Likewise.
+ * hppa-tdep.c (hppa64_return_value): Likewise.
+ * lm32-tdep.c (lm32_store_return_value): Likewise.
+ * microblaze-tdep.c (microblaze_store_return_value): Likewise.
+ * spu-tdep.c (spu_value_from_register): Likewise.
+ * vax-tdep.c (vax_return_value): Likewise.
+
+2012-09-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
* breakpoint.c (invalidate_bp_value_on_memory_change): Expand
parameter LEN to ssize_t.
--- src/gdb/amd64-tdep.c 2012/09/25 12:48:52 1.110
+++ src/gdb/amd64-tdep.c 2012/09/26 07:52:47 1.111
@@ -637,7 +637,7 @@
}
gdb_assert (class[1] != AMD64_MEMORY);
- gdb_assert (len <= 16);
+ gdb_assert (TYPE_LENGTH (type) <= 16);
for (i = 0; len > 0; i++, len -= 8)
{
--- src/gdb/bfin-tdep.c 2012/09/25 12:48:52 1.11
+++ src/gdb/bfin-tdep.c 2012/09/26 07:52:47 1.12
@@ -615,7 +615,7 @@
ULONGEST tmp;
int regno = BFIN_R0_REGNUM;
- gdb_assert (len <= 8);
+ gdb_assert (TYPE_LENGTH (type) <= 8);
while (len > 0)
{
@@ -643,7 +643,7 @@
int len = TYPE_LENGTH (type);
int regno = BFIN_R0_REGNUM;
- gdb_assert (len <= 8);
+ gdb_assert (TYPE_LENGTH (type) <= 8);
while (len > 0)
{
--- src/gdb/cris-tdep.c 2012/05/18 21:02:47 1.185
+++ src/gdb/cris-tdep.c 2012/09/26 07:52:47 1.186
@@ -1662,20 +1662,20 @@
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST val;
- int len = TYPE_LENGTH (type);
- if (len <= 4)
+ if (TYPE_LENGTH (type) <= 4)
{
/* Put the return value in R10. */
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val);
}
- else if (len <= 8)
+ else if (TYPE_LENGTH (type) <= 8)
{
/* Put the return value in R10 and R11. */
val = extract_unsigned_integer (valbuf, 4, byte_order);
regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val);
- val = extract_unsigned_integer ((char *)valbuf + 4, len - 4, byte_order);
+ val = extract_unsigned_integer ((char *)valbuf + 4,
+ TYPE_LENGTH (type) - 4, byte_order);
regcache_cooked_write_unsigned (regcache, ARG2_REGNUM, val);
}
else
@@ -1833,21 +1833,21 @@
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST val;
- int len = TYPE_LENGTH (type);
- if (len <= 4)
+ if (TYPE_LENGTH (type) <= 4)
{
/* Get the return value from R10. */
regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val);
- store_unsigned_integer (valbuf, len, byte_order, val);
+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, val);
}
- else if (len <= 8)
+ else if (TYPE_LENGTH (type) <= 8)
{
/* Get the return value from R10 and R11. */
regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val);
store_unsigned_integer (valbuf, 4, byte_order, val);
regcache_cooked_read_unsigned (regcache, ARG2_REGNUM, &val);
- store_unsigned_integer ((char *)valbuf + 4, len - 4, byte_order, val);
+ store_unsigned_integer ((char *)valbuf + 4, TYPE_LENGTH (type) - 4,
+ byte_order, val);
}
else
error (_("cris_extract_return_value: type length too large"));
--- src/gdb/h8300-tdep.c 2012/09/25 12:48:53 1.136
+++ src/gdb/h8300-tdep.c 2012/09/26 07:52:48 1.137
@@ -751,12 +751,12 @@
int len = TYPE_LENGTH (type);
ULONGEST c, addr;
- switch (len)
+ switch (TYPE_LENGTH (type))
{
case 1:
case 2:
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
- store_unsigned_integer (valbuf, len, byte_order, c);
+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c);
break;
case 4: /* Needs two registers on plain H8/300 */
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
@@ -768,8 +768,9 @@
if (TYPE_CODE (type) == TYPE_CODE_INT)
{
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &addr);
- c = read_memory_unsigned_integer ((CORE_ADDR) addr, len, byte_order);
- store_unsigned_integer (valbuf, len, byte_order, c);
+ c = read_memory_unsigned_integer ((CORE_ADDR) addr,
+ TYPE_LENGTH (type), byte_order);
+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c);
}
else
{
--- src/gdb/hppa-tdep.c 2012/05/18 21:02:48 1.281
+++ src/gdb/hppa-tdep.c 2012/09/26 07:52:48 1.282
@@ -1160,7 +1160,7 @@
int len = TYPE_LENGTH (type);
int regnum, offset;
- if (len > 16)
+ if (TYPE_LENGTH (type) > 16)
{
/* All return values larget than 128 bits must be aggregate
return values. */
--- src/gdb/lm32-tdep.c 2012/09/25 12:48:53 1.13
+++ src/gdb/lm32-tdep.c 2012/09/26 07:52:48 1.14
@@ -349,18 +349,18 @@
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST val;
- int len = TYPE_LENGTH (type);
- if (len <= 4)
+ if (TYPE_LENGTH (type) <= 4)
{
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
}
- else if (len <= 8)
+ else if (TYPE_LENGTH (type) <= 8)
{
val = extract_unsigned_integer (valbuf, 4, byte_order);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
- val = extract_unsigned_integer (valbuf + 4, len - 4, byte_order);
+ val = extract_unsigned_integer (valbuf + 4, TYPE_LENGTH (type) - 4,
+ byte_order);
regcache_cooked_write_unsigned (regcache, SIM_LM32_R2_REGNUM, val);
}
else
--- src/gdb/microblaze-tdep.c 2012/08/02 09:36:39 1.13
+++ src/gdb/microblaze-tdep.c 2012/09/26 07:52:48 1.14
@@ -590,22 +590,21 @@
microblaze_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
- int len = TYPE_LENGTH (type);
gdb_byte buf[8];
memset (buf, 0, sizeof(buf));
/* Integral and pointer return values. */
- if (len > 4)
+ if (TYPE_LENGTH (type) > 4)
{
- gdb_assert (len == 8);
+ gdb_assert (TYPE_LENGTH (type) == 8);
memcpy (buf, valbuf, 8);
regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM+1, buf + 4);
}
else
/* ??? Do we need to do any sign-extension here? */
- memcpy (buf + 4 - len, valbuf, len);
+ memcpy (buf + 4 - TYPE_LENGTH (type), valbuf, TYPE_LENGTH (type));
regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
}
--- src/gdb/spu-tdep.c 2012/09/17 08:52:18 1.82
+++ src/gdb/spu-tdep.c 2012/09/26 07:52:48 1.83
@@ -316,11 +316,10 @@
struct frame_info *frame)
{
struct value *value = default_value_from_register (type, regnum, frame);
- int len = TYPE_LENGTH (type);
- if (regnum < SPU_NUM_GPRS && len < 16)
+ if (regnum < SPU_NUM_GPRS && TYPE_LENGTH (type) < 16)
{
- int preferred_slot = len < 4 ? 4 - len : 0;
+ int preferred_slot = TYPE_LENGTH (type) < 4 ? 4 - TYPE_LENGTH (type) : 0;
set_value_offset (value, preferred_slot);
}
--- src/gdb/vax-tdep.c 2012/05/16 14:35:08 1.112
+++ src/gdb/vax-tdep.c 2012/09/26 07:52:48 1.113
@@ -208,7 +208,6 @@
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
- int len = TYPE_LENGTH (type);
gdb_byte buf[8];
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
@@ -224,7 +223,7 @@
ULONGEST addr;
regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr);
- read_memory (addr, readbuf, len);
+ read_memory (addr, readbuf, TYPE_LENGTH (type));
}
return RETURN_VALUE_ABI_RETURNS_ADDRESS;
@@ -234,16 +233,16 @@
{
/* Read the contents of R0 and (if necessary) R1. */
regcache_cooked_read (regcache, VAX_R0_REGNUM, buf);
- if (len > 4)
+ if (TYPE_LENGTH (type) > 4)
regcache_cooked_read (regcache, VAX_R1_REGNUM, buf + 4);
- memcpy (readbuf, buf, len);
+ memcpy (readbuf, buf, TYPE_LENGTH (type));
}
if (writebuf)
{
/* Read the contents to R0 and (if necessary) R1. */
- memcpy (buf, writebuf, len);
+ memcpy (buf, writebuf, TYPE_LENGTH (type));
regcache_cooked_write (regcache, VAX_R0_REGNUM, buf);
- if (len > 4)
+ if (TYPE_LENGTH (type) > 4)
regcache_cooked_write (regcache, VAX_R1_REGNUM, buf + 4);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,224 @@
http://sourceware.org/ml/gdb-patches/2012-09/msg00632.html
Subject: [PATCH 2/4] Add a check to ensure that a type may fit into host memory
--MP_/PnL6l3LUsXWpZ/olqawWlzb
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
This is part two of the bitpos expansion patch. This implements checks
in some places in the code to ensure that a type size in ULONGEST is
small enough to fit into host memory. Tested for regressions on x86_64
Fedora 16.
Regards,
Siddhesh
--MP_/PnL6l3LUsXWpZ/olqawWlzb
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=ChangeLog-ensure_sizet
gdb/ChangeLog
* alpha-tdep.c (alpha_push_dummy_call) Check for underflow in
SP.
* cp-valprint (cp_print_value): Ensure BASECLASS fits into
size_t.
* dwarf2loc.c (read_pieced_value): Ensure that THIS_SIZE fits
into size_t.
(write_pieced_value): Likewise.
* findcmd.c (parse_find_args): Ensure PATTERN_BUF_SIZE fits into
size_t.
* p-valprint (pascal_object_print_value): Ensure BASECLASS fits
into size_t.
* utils.c (ulongest_fits_host_or_error): New function to find if
a ULONGEST number fits into size_t.
* utils.h: Declare ulongest_fits_host_or_error.
* valops.c (search_struct_method): Ensure BASECLASS fits into
size_t.
* value.c (allocate_value_lazy): Ensure TYPE fits into size_t.
(allocate_value_contents): Likewise.
(set_value_enclosing_type): Ensure NEW_ENCL_TYPE fits into
size_t.
* vax-tdep.c (vax_return_value): Ensure that TYPE fits into
size_t.
--MP_/PnL6l3LUsXWpZ/olqawWlzb
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-ensure-size_t.patch
Index: gdb-7.5.0.20120926/gdb/alpha-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/alpha-tdep.c 2012-11-07 22:03:57.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/alpha-tdep.c 2012-11-07 22:46:00.042902382 +0100
@@ -414,6 +414,13 @@ alpha_push_dummy_call (struct gdbarch *g
accumulate_size = 0;
else
accumulate_size -= sizeof(arg_reg_buffer);
+
+ /* Check for underflow. */
+ if (sp - accumulate_size > sp)
+ error (_("Insufficient memory in GDB host for arguments, "
+ "need %s bytes, but less than %s bytes available."),
+ plongest (accumulate_size), plongest (CORE_ADDR_MAX - sp));
+
sp -= accumulate_size;
/* Keep sp aligned to a multiple of 16 as the ABI requires. */
Index: gdb-7.5.0.20120926/gdb/cp-valprint.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/cp-valprint.c 2012-11-07 22:12:14.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/cp-valprint.c 2012-11-07 22:46:00.043902381 +0100
@@ -561,6 +561,8 @@ cp_print_value (struct type *type, struc
gdb_byte *buf;
struct cleanup *back_to;
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
+
buf = xmalloc (TYPE_LENGTH (baseclass));
back_to = make_cleanup (xfree, buf);
Index: gdb-7.5.0.20120926/gdb/dwarf2loc.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/dwarf2loc.c 2012-11-07 22:09:29.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/dwarf2loc.c 2012-11-07 22:46:00.070902342 +0100
@@ -1784,6 +1784,8 @@ read_pieced_value (struct value *v)
this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8;
source_offset = source_offset_bits / 8;
+ ulongest_fits_host_or_error (this_size);
+
if (buffer_size < this_size)
{
buffer_size = this_size;
@@ -1975,6 +1977,7 @@ write_pieced_value (struct value *to, st
}
else
{
+ ulongest_fits_host_or_error (this_size);
if (buffer_size < this_size)
{
buffer_size = this_size;
Index: gdb-7.5.0.20120926/gdb/findcmd.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/findcmd.c 2012-11-07 22:03:57.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/findcmd.c 2012-11-07 22:46:00.153902249 +0100
@@ -187,6 +187,7 @@ parse_find_args (char *args, ULONGEST *m
size_t current_offset = pattern_buf_end - pattern_buf;
pattern_buf_size = pattern_buf_size_need * 2;
+ ulongest_fits_host_or_error (pattern_buf_size);
pattern_buf = xrealloc (pattern_buf, pattern_buf_size);
pattern_buf_end = pattern_buf + current_offset;
}
Index: gdb-7.5.0.20120926/gdb/p-valprint.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/p-valprint.c 2012-11-07 22:09:29.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/p-valprint.c 2012-11-07 22:46:00.163902208 +0100
@@ -827,6 +827,7 @@ pascal_object_print_value (struct type *
gdb_byte *buf;
struct cleanup *back_to;
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
buf = xmalloc (TYPE_LENGTH (baseclass));
back_to = make_cleanup (xfree, buf);
Index: gdb-7.5.0.20120926/gdb/utils.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/utils.c 2012-11-07 22:00:43.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/utils.c 2012-11-07 22:46:00.166902202 +0100
@@ -3135,6 +3135,18 @@ host_address_to_string (const void *addr
return str;
}
+/* Ensure that the input NUM is not larger than the maximum capacity of the
+ host system. We choose SIZE_MAX / 8 as a conservative estimate of the size
+ of a resource that a system may allocate. */
+void
+ulongest_fits_host_or_error (ULONGEST num)
+{
+ if (num > SIZE_MAX / 8)
+ error (_("Insufficient memory in host GDB for object of size %s bytes, "
+ "maximum allowed %s bytes."), pulongest (num),
+ pulongest (SIZE_MAX / 8));
+}
+
char *
gdb_realpath (const char *filename)
{
Index: gdb-7.5.0.20120926/gdb/valops.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/valops.c 2012-11-07 22:09:30.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/valops.c 2012-11-07 22:46:00.181902181 +0100
@@ -2383,6 +2383,7 @@ search_struct_method (const char *name,
struct cleanup *back_to;
CORE_ADDR address;
+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass));
tmp = xmalloc (TYPE_LENGTH (baseclass));
back_to = make_cleanup (xfree, tmp);
address = value_address (*arg1p);
Index: gdb-7.5.0.20120926/gdb/value.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/value.c 2012-11-07 22:09:30.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/value.c 2012-11-07 22:46:00.184902176 +0100
@@ -663,6 +663,7 @@ allocate_value_lazy (struct type *type)
description correctly. */
check_typedef (type);
+ ulongest_fits_host_or_error (TYPE_LENGTH (type));
val = (struct value *) xzalloc (sizeof (struct value));
val->contents = NULL;
val->next = all_values;
@@ -694,6 +695,8 @@ allocate_value_lazy (struct type *type)
void
allocate_value_contents (struct value *val)
{
+ ulongest_fits_host_or_error (TYPE_LENGTH (val->enclosing_type));
+
if (!val->contents)
val->contents = (gdb_byte *) xzalloc (TYPE_LENGTH (val->enclosing_type));
}
@@ -2662,8 +2665,12 @@ void
set_value_enclosing_type (struct value *val, struct type *new_encl_type)
{
if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val)))
- val->contents =
- (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type));
+ {
+ ulongest_fits_host_or_error (TYPE_LENGTH (new_encl_type));
+
+ val->contents =
+ (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type));
+ }
val->enclosing_type = new_encl_type;
}
Index: gdb-7.5.0.20120926/gdb/vax-tdep.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/vax-tdep.c 2012-11-07 22:09:24.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/vax-tdep.c 2012-11-07 22:46:56.810819878 +0100
@@ -223,6 +223,7 @@ vax_return_value (struct gdbarch *gdbarc
ULONGEST addr;
regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr);
+ ulongest_fits_host_or_error (TYPE_LENGTH (type));
read_memory (addr, readbuf, TYPE_LENGTH (type));
}
Index: gdb-7.5.0.20120926/gdb/defs.h
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/defs.h 2012-11-07 22:00:43.111906109 +0100
+++ gdb-7.5.0.20120926/gdb/defs.h 2012-11-07 22:47:46.001001239 +0100
@@ -1170,4 +1170,6 @@ enum block_enum
FIRST_LOCAL_BLOCK = 2
};
+extern void ulongest_fits_host_or_error (ULONGEST num);
+
#endif /* #ifndef DEFS_H */

View File

@ -0,0 +1,701 @@
http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html
Subject: [PATCH 3/4] Expand watchpoint lengths to LONGEST
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
This is part three of the bitpos expansion change. Some architectures
allow arbitrary length watchpoints and combined with the fact that type
lengths could be large enough, we need LONGEST for watchpoint lengths.
It is architecture dependent however, whether the LONGEST is needed or
not. This patch updates the signatures of watchpoint insertion and
removal functions of all architectures (to comply with the function
signatures in the callback struct), but expands types only in
architectures that need it. Tested on Fedora 16 x86_64.
Regards,
Siddhesh
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=ChangeLog-wp
gdb/ChangeLog:
* arm-linux-nat.c (arm_linux_insert_watchpoint): Expand
parameter LEN to LONGEST.
(arm_linux_remove_watchpoint): Likewise.
(arm_linux_watchpoint_addr_within_range): Expand parameter
LENGTH to LONGEST.
* i386-nat.c (i386_insert_watchpoint): Expand parameter LEN to
LONGEST.
(i386_remove_watchpoint): Likewise.
* ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise.
(ia64_linux_remove_watchpoint): Likewise.
* inf-ttrace.c (inf_ttrace_insert_watchpoint): Likewise.
Expand NUM_PAGES, PAGE to LONGEST.
(inf_ttrace_remove_watchpoint): Likewise.
* mips-linux-nat.c (mips_linux_insert_watchpoint): Expand
parameter LEN to LONGEST.
(mips_linux_remove_watchpoint): Likewise.
* nto-procfs.c (procfs_remove_hw_watchpoint): Likewise.
(procfs_insert_hw_watchpoint): Likewise.
* ppc-linux-nat.c (calculate_dvc): Likewise. Expand I,
NUM_BYTE_ENABLE to LONGEST.
(check_condition): Expand parameter LEN to point to LONGEST.
(ppc_linux_can_accel_watchpoint_condition): Expand parameter
LEN to LONGEST.
(create_watchpoint_request): Likewise.
(ppc_linux_insert_watchpoint): Likewise.
(ppc_linux_remove_watchpoint): Likewise.
(ppc_linux_watchpoint_addr_within_range): Expand parameter
LENGTH to LONGEST.
* procfs.c (proc_set_watchpoint): Expand parameter LEN to
LONGEST.
(procfs_set_watchpoint): Likewise.
(procfs_insert_watchpoint): Likewise.
(procfs_remove_watchpoint): Likewise.
* remote-m32r-sdi.c (m32r_insert_watchpoint): Likewise. Use
plongest to format print LEN.
(m32r_remove_watchpoint): Likewise.
* remote-mips.c (mips_insert_watchpoint): Expand parameter LEN
to LONGEST.
(mips_remove_watchpoint): Likewise.
* remote.c (remote_insert_watchpoint): Likewise.
Use phex_nz to format print LEN.
(remote_remove_watchpoint): Likewise.
(remote_watchpoint_addr_within_range): Expand parameter LENGTH
to LONGEST.
* s390-nat.c (s390_insert_watchpoint): Expand parameter LEN to
LONGEST.
(s390_remove_watchpoint): Likewise.
* target.c (update_current_target): Expand parameter LEN for
callbacks to TO_INSERT_WATCHPOINT, TO_REMOVE_WATCHPOINT,
TO_CAN_ACCEL_WATCHPOINT_CONDITION, to LONGEST.
(default_watchpoint_addr_within_range): Expand parameter
LENGTH to LONGEST.
(debug_to_can_accel_watchpoint_condition): Expand parameter LEN
to LONGEST. Use plongest to format print LEN.
(debug_to_watchpoint_addr_within_range): Expand parameter LENGTH
to LONGEST. Use plongest to format print LENGTH.
(debug_to_insert_watchpoint): Expand parameter LEN to LONGEST.
Use plongest to format print LEN.
(debug_to_remove_watchpoint): Likewise.
* target.h (struct target_ops): Expand parameter LEN of
TO_REMOVE_WATCHPOINT, TO_INSERT_WATCHPOINT,
TO_WATCHPOINT_ADDR_WITHIN_RANGE and
TO_CAN_ACCEL_WATCHPOINT_CONDITION to LONGEST.
--MP_/6HRlH6vpyqtSy4CYyMrX6b2
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-wp.patch
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index 231b008..6deb23d 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -1105,7 +1105,7 @@ arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
/* Insert a Hardware breakpoint. */
static int
-arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
+arm_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
struct expression *cond)
{
struct lwp_info *lp;
@@ -1123,7 +1123,7 @@ arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
/* Remove a hardware breakpoint. */
static int
-arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
+arm_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
struct expression *cond)
{
struct lwp_info *lp;
@@ -1180,7 +1180,7 @@ arm_linux_stopped_by_watchpoint (void)
static int
arm_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
- CORE_ADDR start, int length)
+ CORE_ADDR start, LONGEST length)
{
return start <= addr && start + length - 1 >= addr;
}
diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
index 76c51a8..9e293fe 100644
--- a/gdb/i386-nat.c
+++ b/gdb/i386-nat.c
@@ -592,7 +592,7 @@ i386_update_inferior_debug_regs (struct i386_debug_reg_state *new_state)
of the type TYPE. Return 0 on success, -1 on failure. */
static int
-i386_insert_watchpoint (CORE_ADDR addr, int len, int type,
+i386_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
struct i386_debug_reg_state *state = i386_debug_reg_state ();
@@ -629,7 +629,7 @@ i386_insert_watchpoint (CORE_ADDR addr, int len, int type,
address ADDR, whose length is LEN bytes, and for accesses of the
type TYPE. Return 0 on success, -1 on failure. */
static int
-i386_remove_watchpoint (CORE_ADDR addr, int len, int type,
+i386_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
struct i386_debug_reg_state *state = i386_debug_reg_state ();
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index 9b5fbf3..6061eae 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -542,7 +542,7 @@ is_power_of_2 (int val)
}
static int
-ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
+ia64_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
struct expression *cond)
{
struct lwp_info *lp;
@@ -596,7 +596,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
}
static int
-ia64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type,
+ia64_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
int idx;
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c
index d60eddb..c33db45 100644
--- a/gdb/inf-ttrace.c
+++ b/gdb/inf-ttrace.c
@@ -313,14 +313,14 @@ inf_ttrace_disable_page_protections (pid_t pid)
type TYPE. */
static int
-inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type,
+inf_ttrace_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
const int pagesize = inf_ttrace_page_dict.pagesize;
pid_t pid = ptid_get_pid (inferior_ptid);
CORE_ADDR page_addr;
- int num_pages;
- int page;
+ LONGEST num_pages;
+ LONGEST page;
gdb_assert (type == hw_write);
@@ -337,14 +337,14 @@ inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type,
type TYPE. */
static int
-inf_ttrace_remove_watchpoint (CORE_ADDR addr, int len, int type,
+inf_ttrace_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
const int pagesize = inf_ttrace_page_dict.pagesize;
pid_t pid = ptid_get_pid (inferior_ptid);
CORE_ADDR page_addr;
- int num_pages;
- int page;
+ LONGEST num_pages;
+ LONGEST page;
gdb_assert (type == hw_write);
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 5566d0c..7467d11 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -1017,7 +1017,7 @@ populate_regs_from_watches (struct pt_watch_regs *regs)
watch. Return zero on success. */
static int
-mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type,
+mips_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
struct pt_watch_regs regs;
@@ -1067,7 +1067,7 @@ mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type,
Return zero on success. */
static int
-mips_linux_remove_watchpoint (CORE_ADDR addr, int len, int type,
+mips_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
int retval;
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index b58f318..25fecf3 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -69,10 +69,10 @@ static ptid_t do_attach (ptid_t ptid);
static int procfs_can_use_hw_breakpoint (int, int, int);
-static int procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type,
+static int procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond);
-static int procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type,
+static int procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond);
static int procfs_stopped_by_watchpoint (void);
@@ -1493,14 +1493,14 @@ procfs_can_use_hw_breakpoint (int type, int cnt, int othertype)
}
static int
-procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type,
+procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
return procfs_hw_watchpoint (addr, -1, type);
}
static int
-procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type,
+procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
return procfs_hw_watchpoint (addr, len, type);
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 67e1cac..abfb2fc 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -1839,11 +1839,11 @@ can_use_watchpoint_cond_accel (void)
CONDITION_VALUE will hold the value which should be put in the
DVC register. */
static void
-calculate_dvc (CORE_ADDR addr, int len, CORE_ADDR data_value,
+calculate_dvc (CORE_ADDR addr, LONGEST len, CORE_ADDR data_value,
uint32_t *condition_mode, uint64_t *condition_value)
{
- int i, num_byte_enable, align_offset, num_bytes_off_dvc,
- rightmost_enabled_byte;
+ LONGEST i, num_byte_enable;
+ int align_offset, num_bytes_off_dvc, rightmost_enabled_byte;
CORE_ADDR addr_end_data, addr_end_dvc;
/* The DVC register compares bytes within fixed-length windows which
@@ -1930,7 +1930,7 @@ num_memory_accesses (struct value *v)
of the constant. */
static int
check_condition (CORE_ADDR watch_addr, struct expression *cond,
- CORE_ADDR *data_value, int *len)
+ CORE_ADDR *data_value, LONGEST *len)
{
int pc = 1, num_accesses_left, num_accesses_right;
struct value *left_val, *right_val, *left_chain, *right_chain;
@@ -1997,7 +1997,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond,
the condition expression, thus only triggering the watchpoint when it is
true. */
static int
-ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw,
+ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw,
struct expression *cond)
{
CORE_ADDR data_value;
@@ -2014,7 +2014,7 @@ ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw,
static void
create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
- int len, int rw, struct expression *cond,
+ LONGEST len, int rw, struct expression *cond,
int insert)
{
if (len == 1
@@ -2059,7 +2059,7 @@ create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
}
static int
-ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
+ppc_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
struct expression *cond)
{
struct lwp_info *lp;
@@ -2127,7 +2127,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
}
static int
-ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
+ppc_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw,
struct expression *cond)
{
struct lwp_info *lp;
@@ -2267,7 +2267,7 @@ ppc_linux_stopped_by_watchpoint (void)
static int
ppc_linux_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
- CORE_ADDR start, int length)
+ CORE_ADDR start, LONGEST length)
{
int mask;
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 4a9336f..26accd8 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -2470,7 +2470,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr)
#endif
static int
-proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
+proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, LONGEST len, int wflags)
{
#if !defined (PCWATCH) && !defined (PIOCSWATCH)
/* If neither or these is defined, we can't support watchpoints.
@@ -4816,7 +4816,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid)
/* Insert a watchpoint. */
static int
-procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
+procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag,
int after)
{
#ifndef UNIXWARE
@@ -4938,7 +4938,7 @@ procfs_stopped_data_address (struct target_ops *targ, CORE_ADDR *addr)
}
static int
-procfs_insert_watchpoint (CORE_ADDR addr, int len, int type,
+procfs_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
if (!target_have_steppable_watchpoint
@@ -4960,7 +4960,7 @@ procfs_insert_watchpoint (CORE_ADDR addr, int len, int type,
}
static int
-procfs_remove_watchpoint (CORE_ADDR addr, int len, int type,
+procfs_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0);
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index 748aeba..b385c3f 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -1417,14 +1417,14 @@ m32r_can_use_hw_watchpoint (int type, int cnt, int othertype)
watchpoint. */
static int
-m32r_insert_watchpoint (CORE_ADDR addr, int len, int type,
+m32r_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
int i;
if (remote_debug)
- fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n",
- paddress (target_gdbarch, addr), len, type);
+ fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%s,%d)\n",
+ paddress (target_gdbarch, addr), plongest (len), type);
for (i = 0; i < MAX_ACCESS_BREAKS; i++)
{
@@ -1442,14 +1442,14 @@ m32r_insert_watchpoint (CORE_ADDR addr, int len, int type,
}
static int
-m32r_remove_watchpoint (CORE_ADDR addr, int len, int type,
+m32r_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
int i;
if (remote_debug)
- fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n",
- paddress (target_gdbarch, addr), len, type);
+ fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%s,%d)\n",
+ paddress (target_gdbarch, addr), plongest (len), type);
for (i = 0; i < MAX_ACCESS_BREAKS; i++)
{
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index eee2460..9a9265a 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -2419,7 +2419,7 @@ calculate_mask (CORE_ADDR addr, int len)
watchpoint. */
static int
-mips_insert_watchpoint (CORE_ADDR addr, int len, int type,
+mips_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
if (mips_set_breakpoint (addr, len, type))
@@ -2431,7 +2431,7 @@ mips_insert_watchpoint (CORE_ADDR addr, int len, int type,
/* Remove a watchpoint. */
static int
-mips_remove_watchpoint (CORE_ADDR addr, int len, int type,
+mips_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
if (mips_clear_breakpoint (addr, len, type))
diff --git a/gdb/remote.c b/gdb/remote.c
index 8c27390..bcec331 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8035,7 +8035,7 @@ watchpoint_to_Z_packet (int type)
}
static int
-remote_insert_watchpoint (CORE_ADDR addr, int len, int type,
+remote_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
struct remote_state *rs = get_remote_state ();
@@ -8050,7 +8050,7 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type,
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
- xsnprintf (p, endbuf - p, ",%x", len);
+ xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len)));
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
@@ -8070,7 +8070,7 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type,
static int
remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
- CORE_ADDR start, int length)
+ CORE_ADDR start, LONGEST length)
{
CORE_ADDR diff = remote_address_masked (addr - start);
@@ -8079,7 +8079,7 @@ remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
static int
-remote_remove_watchpoint (CORE_ADDR addr, int len, int type,
+remote_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
struct remote_state *rs = get_remote_state ();
@@ -8094,7 +8094,7 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type,
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
- xsnprintf (p, endbuf - p, ",%x", len);
+ xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len)));
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c
index 4974bad..3f41519 100644
--- a/gdb/s390-nat.c
+++ b/gdb/s390-nat.c
@@ -517,7 +517,7 @@ s390_fix_watch_points (struct lwp_info *lp)
}
static int
-s390_insert_watchpoint (CORE_ADDR addr, int len, int type,
+s390_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
struct lwp_info *lp;
@@ -538,7 +538,7 @@ s390_insert_watchpoint (CORE_ADDR addr, int len, int type,
}
static int
-s390_remove_watchpoint (CORE_ADDR addr, int len, int type,
+s390_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
struct lwp_info *lp;
diff --git a/gdb/target.c b/gdb/target.c
index f7207c0..a69fb06 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -49,7 +49,8 @@ static void target_info (char *, int);
static void default_terminal_info (char *, int);
static int default_watchpoint_addr_within_range (struct target_ops *,
- CORE_ADDR, CORE_ADDR, int);
+ CORE_ADDR, CORE_ADDR,
+ LONGEST);
static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST);
@@ -114,10 +115,10 @@ static int debug_to_insert_hw_breakpoint (struct gdbarch *,
static int debug_to_remove_hw_breakpoint (struct gdbarch *,
struct bp_target_info *);
-static int debug_to_insert_watchpoint (CORE_ADDR, int, int,
+static int debug_to_insert_watchpoint (CORE_ADDR, LONGEST, int,
struct expression *);
-static int debug_to_remove_watchpoint (CORE_ADDR, int, int,
+static int debug_to_remove_watchpoint (CORE_ADDR, LONGEST, int,
struct expression *);
static int debug_to_stopped_by_watchpoint (void);
@@ -125,11 +126,12 @@ static int debug_to_stopped_by_watchpoint (void);
static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *);
static int debug_to_watchpoint_addr_within_range (struct target_ops *,
- CORE_ADDR, CORE_ADDR, int);
+ CORE_ADDR, CORE_ADDR,
+ LONGEST);
static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST);
-static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int,
+static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int,
struct expression *);
static void debug_to_terminal_init (void);
@@ -751,10 +753,10 @@ update_current_target (void)
(int (*) (struct gdbarch *, struct bp_target_info *))
return_minus_one);
de_fault (to_insert_watchpoint,
- (int (*) (CORE_ADDR, int, int, struct expression *))
+ (int (*) (CORE_ADDR, LONGEST, int, struct expression *))
return_minus_one);
de_fault (to_remove_watchpoint,
- (int (*) (CORE_ADDR, int, int, struct expression *))
+ (int (*) (CORE_ADDR, LONGEST, int, struct expression *))
return_minus_one);
de_fault (to_stopped_by_watchpoint,
(int (*) (void))
@@ -767,7 +769,7 @@ update_current_target (void)
de_fault (to_region_ok_for_hw_watchpoint,
default_region_ok_for_hw_watchpoint);
de_fault (to_can_accel_watchpoint_condition,
- (int (*) (CORE_ADDR, int, int, struct expression *))
+ (int (*) (CORE_ADDR, LONGEST, int, struct expression *))
return_zero);
de_fault (to_terminal_init,
(void (*) (void))
@@ -3558,7 +3560,7 @@ default_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
static int
default_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
- CORE_ADDR start, int length)
+ CORE_ADDR start, LONGEST length)
{
return addr >= start && addr < start + length;
}
@@ -4263,7 +4265,7 @@ debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len)
}
static int
-debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw,
+debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw,
struct expression *cond)
{
int retval;
@@ -4273,8 +4275,8 @@ debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw,
fprintf_unfiltered (gdb_stdlog,
"target_can_accel_watchpoint_condition "
- "(%s, %d, %d, %s) = %ld\n",
- core_addr_to_string (addr), len, rw,
+ "(%s, %s, %d, %s) = %ld\n",
+ core_addr_to_string (addr), plongest (len), rw,
host_address_to_string (cond), (unsigned long) retval);
return retval;
}
@@ -4309,7 +4311,7 @@ debug_to_stopped_data_address (struct target_ops *target, CORE_ADDR *addr)
static int
debug_to_watchpoint_addr_within_range (struct target_ops *target,
CORE_ADDR addr,
- CORE_ADDR start, int length)
+ CORE_ADDR start, LONGEST length)
{
int retval;
@@ -4317,9 +4319,9 @@ debug_to_watchpoint_addr_within_range (struct target_ops *target,
start, length);
fprintf_filtered (gdb_stdlog,
- "target_watchpoint_addr_within_range (%s, %s, %d) = %d\n",
+ "target_watchpoint_addr_within_range (%s, %s, %s) = %d\n",
core_addr_to_string (addr), core_addr_to_string (start),
- length, retval);
+ plongest (length), retval);
return retval;
}
@@ -4354,7 +4356,7 @@ debug_to_remove_hw_breakpoint (struct gdbarch *gdbarch,
}
static int
-debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type,
+debug_to_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
int retval;
@@ -4362,14 +4364,14 @@ debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type,
retval = debug_target.to_insert_watchpoint (addr, len, type, cond);
fprintf_unfiltered (gdb_stdlog,
- "target_insert_watchpoint (%s, %d, %d, %s) = %ld\n",
- core_addr_to_string (addr), len, type,
+ "target_insert_watchpoint (%s, %s, %d, %s) = %ld\n",
+ core_addr_to_string (addr), plongest (len), type,
host_address_to_string (cond), (unsigned long) retval);
return retval;
}
static int
-debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type,
+debug_to_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type,
struct expression *cond)
{
int retval;
@@ -4377,8 +4379,8 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type,
retval = debug_target.to_remove_watchpoint (addr, len, type, cond);
fprintf_unfiltered (gdb_stdlog,
- "target_remove_watchpoint (%s, %d, %d, %s) = %ld\n",
- core_addr_to_string (addr), len, type,
+ "target_remove_watchpoint (%s, %s, %d, %s) = %ld\n",
+ core_addr_to_string (addr), plongest (len), type,
host_address_to_string (cond), (unsigned long) retval);
return retval;
}
diff --git a/gdb/target.h b/gdb/target.h
index 69228e1..4b52d53 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -466,8 +466,8 @@ struct target_ops
/* Documentation of what the two routines below are expected to do is
provided with the corresponding target_* macros. */
- int (*to_remove_watchpoint) (CORE_ADDR, int, int, struct expression *);
- int (*to_insert_watchpoint) (CORE_ADDR, int, int, struct expression *);
+ int (*to_remove_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *);
+ int (*to_insert_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *);
int (*to_insert_mask_watchpoint) (struct target_ops *,
CORE_ADDR, CORE_ADDR, int);
@@ -478,13 +478,13 @@ struct target_ops
int to_have_continuable_watchpoint;
int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *);
int (*to_watchpoint_addr_within_range) (struct target_ops *,
- CORE_ADDR, CORE_ADDR, int);
+ CORE_ADDR, CORE_ADDR, LONGEST);
/* Documentation of this routine is provided with the corresponding
target_* macro. */
int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, LONGEST);
- int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int,
+ int (*to_can_accel_watchpoint_condition) (CORE_ADDR, LONGEST, int,
struct expression *);
int (*to_masked_watch_num_registers) (struct target_ops *,
CORE_ADDR, CORE_ADDR);
--MP_/6HRlH6vpyqtSy4CYyMrX6b2--

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,113 @@
http://sourceware.org/ml/gdb-cvs/2012-09/msg00160.html
### src/gdb/ChangeLog 2012/09/26 23:53:53 1.14709
### src/gdb/ChangeLog 2012/09/27 08:57:14 1.14710
## -1,3 +1,16 @@
+2012-09-27 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * gdbtypes.c (lookup_array_range_type): Expand parameters
+ LOW_BOUND and HIGH_BOUND to LONGEST.
+ (lookup_string_range_type): Likewise.
+ * gdbtypes.h (lookup_array_range_type): Likewise.
+ (lookup_string_range_type): Likewise.
+ * valops.c (value_cstring): Expand parameter LEN to ssize_t.
+ Expand HIGHBOUND to ssize_t.
+ (value_string): Likewise.
+ * value.h (value_cstring): Expand parameter LEN to ssize_t.
+ (value_string): Likewise.
+
2012-09-27 Yao Qi <yao@codesourcery.com>
PR breakpoints/13898
Index: gdb-7.5.0.20120926/gdb/gdbtypes.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/gdbtypes.c 2012-11-07 22:09:57.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/gdbtypes.c 2012-11-07 22:50:47.048741164 +0100
@@ -1022,7 +1022,7 @@ create_array_type (struct type *result_t
struct type *
lookup_array_range_type (struct type *element_type,
- int low_bound, int high_bound)
+ LONGEST low_bound, LONGEST high_bound)
{
struct gdbarch *gdbarch = get_type_arch (element_type);
struct type *index_type = builtin_type (gdbarch)->builtin_int;
@@ -1058,7 +1058,7 @@ create_string_type (struct type *result_
struct type *
lookup_string_range_type (struct type *string_char_type,
- int low_bound, int high_bound)
+ LONGEST low_bound, LONGEST high_bound)
{
struct type *result_type;
Index: gdb-7.5.0.20120926/gdb/gdbtypes.h
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/gdbtypes.h 2012-11-07 22:09:29.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/gdbtypes.h 2012-11-07 22:51:46.440655817 +0100
@@ -1640,7 +1640,7 @@ extern struct type *create_range_type (s
extern struct type *create_array_type (struct type *, struct type *,
struct type *);
-extern struct type *lookup_array_range_type (struct type *, int, int);
+extern struct type *lookup_array_range_type (struct type *, LONGEST, LONGEST);
extern CORE_ADDR type_range_any_field_internal (struct type *range_type,
int fieldno);
@@ -1656,7 +1656,7 @@ extern void finalize_type (struct type *
extern struct type *create_string_type (struct type *, struct type *,
struct type *);
-extern struct type *lookup_string_range_type (struct type *, int, int);
+extern struct type *lookup_string_range_type (struct type *, LONGEST, LONGEST);
extern struct type *create_set_type (struct type *, struct type *);
Index: gdb-7.5.0.20120926/gdb/valops.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/valops.c 2012-11-07 22:46:00.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/valops.c 2012-11-07 22:50:47.091741104 +0100
@@ -1937,11 +1937,11 @@ value_array (int lowbound, int highbound
}
struct value *
-value_cstring (char *ptr, int len, struct type *char_type)
+value_cstring (char *ptr, ssize_t len, struct type *char_type)
{
struct value *val;
int lowbound = current_language->string_lower_bound;
- int highbound = len / TYPE_LENGTH (char_type);
+ ssize_t highbound = len / TYPE_LENGTH (char_type);
struct type *stringtype
= lookup_array_range_type (char_type, lowbound, highbound + lowbound - 1);
@@ -1960,11 +1960,11 @@ value_cstring (char *ptr, int len, struc
string may contain embedded null bytes. */
struct value *
-value_string (char *ptr, int len, struct type *char_type)
+value_string (char *ptr, ssize_t len, struct type *char_type)
{
struct value *val;
int lowbound = current_language->string_lower_bound;
- int highbound = len / TYPE_LENGTH (char_type);
+ ssize_t highbound = len / TYPE_LENGTH (char_type);
struct type *stringtype
= lookup_string_range_type (char_type, lowbound, highbound + lowbound - 1);
Index: gdb-7.5.0.20120926/gdb/value.h
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/value.h 2012-11-07 22:09:30.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/value.h 2012-11-07 22:51:11.744705614 +0100
@@ -593,9 +593,9 @@ extern struct value *value_mark (void);
extern void value_free_to_mark (struct value *mark);
-extern struct value *value_cstring (char *ptr, int len,
+extern struct value *value_cstring (char *ptr, ssize_t len,
struct type *char_type);
-extern struct value *value_string (char *ptr, int len,
+extern struct value *value_string (char *ptr, ssize_t len,
struct type *char_type);
extern struct value *value_bitstring (char *ptr, int len,
struct type *index_type);

View File

@ -0,0 +1,627 @@
http://sourceware.org/ml/gdb-patches/2012-10/msg00231.html
Subject: Re: [PATCH] Expand fortran array bounds sizes to LONGEST
On Mon, 15 Oct 2012 15:25:55 +0200, Jan Kratochvil wrote:
> I have filed for it now:
> Invalid debug/ array bounds w/-fno-range-check and 32-bit target
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54934
Therefore it looks as a valid gfortran FSF GCC HEAD bug so provided
a hand-patched .S file for i386; patched GDB PASSes with it.
Thanks,
Jan
2012-10-15 Siddhesh Poyarekar <siddhesh@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.fortran/array-bounds.exp: New test file.
* gdb.fortran/array-bounds.f: New test file.
* gdb.fortran/array-bounds.S: New test file.
--- /dev/null 2012-09-26 15:32:16.098506310 +0200
+++ gdb-7.2/gdb/testsuite/gdb.fortran/array-bounds.exp 2012-10-15 20:53:26.427072583 +0200
@@ -0,0 +1,43 @@
+# Copyright 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite. It contains test to ensure that
+# array bounds accept LONGEST.
+
+if { [skip_fortran_tests] } { return -1 }
+
+set testfile "array-bounds"
+
+if { [is_ilp32_target] && ([istarget "i\[34567\]86-*-linux*"]
+ || [istarget "x86_64-*-linux*"]) } {
+ set srcfile ${testfile}.S
+ set opts {nodebug f90}
+} else {
+ set srcfile ${testfile}.f
+ set opts {debug f90}
+}
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile $opts]} {
+ print "compile failed"
+ return -1
+}
+
+if { ![runto MAIN__] } {
+ perror "Could not run to breakpoint `MAIN__'."
+ continue
+}
+
+gdb_test "print &foo" {.*\(4294967296:4294967297\).*}
+gdb_test "print &bar" {.*\(-4294967297:-4294967296\).*}
--- /dev/null 2012-09-26 15:32:16.098506310 +0200
+++ gdb-7.2/gdb/testsuite/gdb.fortran/array-bounds.f 2012-10-15 19:35:12.500254261 +0200
@@ -0,0 +1,22 @@
+c Copyright 2012 Free Software Foundation, Inc.
+
+c This program is free software; you can redistribute it and/or modify
+c it under the terms of the GNU General Public License as published by
+c the Free Software Foundation; either version 3 of the License, or
+c (at your option) any later version.
+c
+c This program is distributed in the hope that it will be useful,
+c but WITHOUT ANY WARRANTY; without even the implied warranty of
+c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+c GNU General Public License for more details.
+c
+c You should have received a copy of the GNU General Public License
+c along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ dimension foo(4294967296_8:4294967297_8)
+ dimension bar(-4294967297_8:-4294967296_8)
+ bar = 42
+ foo=bar
+ stop
+ end
+
--- /dev/null 2012-09-26 15:32:16.098506310 +0200
+++ gdb-7.2/gdb/testsuite/gdb.fortran/array-bounds.S 2012-10-15 20:52:36.851118215 +0200
@@ -0,0 +1,529 @@
+/* Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ This file is part of the gdb testsuite. */
+
+ .file "array-bounds.f"
+ .text
+.Ltext0:
+ .type MAIN__, @function
+MAIN__:
+.LFB0:
+ .file 1 "gdb.fortran/array-bounds.f"
+ # gdb.fortran/array-bounds.f:16
+ .loc 1 16 0
+ .cfi_startproc
+# BLOCK 2 seq:0
+# PRED: ENTRY (FALLTHRU)
+ pushl %ebp
+.LCFI0:
+ .cfi_def_cfa_offset 8
+ .cfi_offset 5, -8
+ movl %esp, %ebp
+.LCFI1:
+ .cfi_def_cfa_register 5
+ subl $40, %esp
+.LBB2:
+# SUCC: 3 (FALLTHRU)
+ # gdb.fortran/array-bounds.f:18
+ .loc 1 18 0
+ movl $-1, %eax
+# BLOCK 3 seq:1
+# PRED: 2 (FALLTHRU) 4 [100.0%]
+.L3:
+ # gdb.fortran/array-bounds.f:18
+ .loc 1 18 0 is_stmt 0 discriminator 1
+ testl %eax, %eax
+# SUCC: 5 4 (FALLTHRU)
+ jg .L2
+# BLOCK 4 seq:2
+# PRED: 3 (FALLTHRU)
+ # gdb.fortran/array-bounds.f:18
+ .loc 1 18 0 discriminator 2
+ leal 1(%eax), %ecx
+ movl .LC0, %edx
+ movl %edx, -16(%ebp,%ecx,4)
+ addl $1, %eax
+# SUCC: 3 [100.0%]
+ jmp .L3
+# BLOCK 5 seq:3
+# PRED: 3
+.L2:
+.LBE2:
+ # gdb.fortran/array-bounds.f:19
+ .loc 1 19 0 is_stmt 1
+ movl -16(%ebp), %eax
+ movl -12(%ebp), %edx
+ movl %eax, -24(%ebp)
+ movl %edx, -20(%ebp)
+ # gdb.fortran/array-bounds.f:20
+ .loc 1 20 0
+ movl $0, 4(%esp)
+ movl $0, (%esp)
+# SUCC:
+ call _gfortran_stop_string
+ .cfi_endproc
+.LFE0:
+ .size MAIN__, .-MAIN__
+ .globl main
+ .type main, @function
+main:
+.LFB1:
+ # gdb.fortran/array-bounds.f:21
+ .loc 1 21 0
+ .cfi_startproc
+# BLOCK 2 seq:0
+# PRED: ENTRY (FALLTHRU)
+ pushl %ebp
+.LCFI2:
+ .cfi_def_cfa_offset 8
+ .cfi_offset 5, -8
+ movl %esp, %ebp
+.LCFI3:
+ .cfi_def_cfa_register 5
+ andl $-16, %esp
+ subl $16, %esp
+ # gdb.fortran/array-bounds.f:21
+ .loc 1 21 0
+ movl 12(%ebp), %eax
+ movl %eax, 4(%esp)
+ movl 8(%ebp), %eax
+ movl %eax, (%esp)
+ call _gfortran_set_args
+ movl $options.1.1824, 4(%esp)
+ movl $7, (%esp)
+ call _gfortran_set_options
+ call MAIN__
+ movl $0, %eax
+ leave
+.LCFI4:
+ .cfi_restore 5
+ .cfi_def_cfa 4, 4
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE1:
+ .size main, .-main
+ .section .rodata
+ .align 4
+ .type options.1.1824, @object
+ .size options.1.1824, 28
+options.1.1824:
+ .long 68
+ .long 1023
+ .long 0
+ .long 0
+ .long 1
+ .long 1
+ .long 0
+ .align 4
+.LC0:
+ .long 1109917696
+ .text
+.Letext0:
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .long 2f - 1f # Length of Compilation Unit Info
+1:
+ .value 0x2 # DWARF version number
+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
+ .byte 0x4 # Pointer Size (in bytes)
+dieb: .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
+ .long .LASF5 # DW_AT_producer: "GNU Fortran 4.8.0 20121015 (experimental) -ffixed-form -m32 -mtune=generic -march=x86-64 -g -gdwarf-2 -fintrinsic-modules-path .../gcchead-root/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/finclude"
+ .byte 0xe # DW_AT_language
+ .byte 0x2 # DW_AT_identifier_case
+ .long .LASF6 # DW_AT_name: "gdb.fortran/array-bounds.f"
+ .long .LASF7 # DW_AT_comp_dir: ""
+ .long .Ltext0 # DW_AT_low_pc
+ .long .Letext0 # DW_AT_high_pc
+ .long .Ldebug_line0 # DW_AT_stmt_list
+die26: .uleb128 0x2 # (DIE (0x26) DW_TAG_subprogram)
+ .long .LASF8 # DW_AT_name: "MAIN__"
+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f)
+ .byte 0x10 # DW_AT_decl_line
+ .long .LFB0 # DW_AT_low_pc
+ .long .LFE0 # DW_AT_high_pc
+ .long .LLST0 # DW_AT_frame_base
+ .byte 0x1 # DW_AT_GNU_all_tail_call_sites
+ .byte 0x1 # DW_AT_main_subprogram
+ .byte 0x2 # DW_AT_calling_convention
+ .long die66 - .Ldebug_info0 # DW_AT_sibling
+die40: .uleb128 0x3 # (DIE (0x40) DW_TAG_variable)
+ .ascii "bar\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f)
+ .byte 0x11 # DW_AT_decl_line
+ .long die66 - .Ldebug_info0 # DW_AT_type
+ .byte 0x2 # DW_AT_location
+ .byte 0x91 # DW_OP_fbreg
+ .sleb128 -24
+die4e: .uleb128 0x3 # (DIE (0x4e) DW_TAG_variable)
+ .ascii "foo\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f)
+ .byte 0x10 # DW_AT_decl_line
+ .long die88 - .Ldebug_info0 # DW_AT_type
+ .byte 0x2 # DW_AT_location
+ .byte 0x91 # DW_OP_fbreg
+ .sleb128 -32
+die5c: .uleb128 0x4 # (DIE (0x5c) DW_TAG_lexical_block)
+ .long .LBB2 # DW_AT_low_pc
+ .long .LBE2 # DW_AT_high_pc
+ .byte 0 # end of children of DIE 0x26
+die66: .uleb128 0x5 # (DIE (0x66) DW_TAG_array_type)
+ .long die81 - .Ldebug_info0 # DW_AT_type
+ .long die7a - .Ldebug_info0 # DW_AT_sibling
+die6f: .uleb128 0x6 # (DIE (0x6f) DW_TAG_subrange_type)
+ .long die7a - .Ldebug_info0 # DW_AT_type
+#if 0
+ .long 0xffffffff # DW_AT_lower_bound
+ .byte 0 # DW_AT_upper_bound
+#else
+ .quad 0xfffffffeffffffff # DW_AT_lower_bound
+ .quad 0xffffffff00000000 # DW_AT_upper_bound
+#endif
+ .byte 0 # end of children of DIE 0x66
+die7a: .uleb128 0x7 # (DIE (0x7a) DW_TAG_base_type)
+#if 0
+ .byte 0x4 # DW_AT_byte_size
+#else
+ .byte 0x8 # DW_AT_byte_size
+#endif
+ .byte 0x5 # DW_AT_encoding
+ .long .LASF0 # DW_AT_name: "integer(kind=4)"
+die81: .uleb128 0x7 # (DIE (0x81) DW_TAG_base_type)
+ .byte 0x4 # DW_AT_byte_size
+ .byte 0x4 # DW_AT_encoding
+ .long .LASF1 # DW_AT_name: "real(kind=4)"
+die88: .uleb128 0x5 # (DIE (0x88) DW_TAG_array_type)
+ .long die81 - .Ldebug_info0 # DW_AT_type
+ .long die99 - .Ldebug_info0 # DW_AT_sibling
+die91: .uleb128 0x8 # (DIE (0x91) DW_TAG_subrange_type)
+ .long die7a - .Ldebug_info0 # DW_AT_type
+#if 0
+ .byte 0 # DW_AT_lower_bound
+ .byte 0x1 # DW_AT_upper_bound
+#else
+ .quad 0x100000000 # DW_AT_lower_bound
+ .quad 0x100000001 # DW_AT_upper_bound
+#endif
+ .byte 0 # end of children of DIE 0x88
+die99: .uleb128 0x9 # (DIE (0x99) DW_TAG_subprogram)
+ .byte 0x1 # DW_AT_external
+ .long .LASF9 # DW_AT_name: "main"
+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f)
+ .byte 0x15 # DW_AT_decl_line
+ .long die7a - .Ldebug_info0 # DW_AT_type
+ .long .LFB1 # DW_AT_low_pc
+ .long .LFE1 # DW_AT_high_pc
+ .long .LLST1 # DW_AT_frame_base
+ .byte 0x1 # DW_AT_GNU_all_tail_call_sites
+ .long died4 - .Ldebug_info0 # DW_AT_sibling
+dieb6: .uleb128 0xa # (DIE (0xb6) DW_TAG_formal_parameter)
+ .long .LASF2 # DW_AT_name: "argc"
+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f)
+ .byte 0x15 # DW_AT_decl_line
+ .long died4 - .Ldebug_info0 # DW_AT_type
+ .byte 0x2 # DW_AT_location
+ .byte 0x91 # DW_OP_fbreg
+ .sleb128 0
+diec4: .uleb128 0xa # (DIE (0xc4) DW_TAG_formal_parameter)
+ .long .LASF3 # DW_AT_name: "argv"
+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f)
+ .byte 0x15 # DW_AT_decl_line
+ .long died9 - .Ldebug_info0 # DW_AT_type
+ .byte 0x3 # DW_AT_location
+ .byte 0x91 # DW_OP_fbreg
+ .sleb128 4
+ .byte 0x6 # DW_OP_deref
+ .byte 0 # end of children of DIE 0x99
+died4: .uleb128 0xb # (DIE (0xd4) DW_TAG_const_type)
+ .long die7a - .Ldebug_info0 # DW_AT_type
+died9: .uleb128 0xc # (DIE (0xd9) DW_TAG_pointer_type)
+ .byte 0x4 # DW_AT_byte_size
+ .long diedf - .Ldebug_info0 # DW_AT_type
+diedf: .uleb128 0x7 # (DIE (0xdf) DW_TAG_base_type)
+ .byte 0x1 # DW_AT_byte_size
+ .byte 0x8 # DW_AT_encoding
+ .long .LASF4 # DW_AT_name: "character(kind=1)"
+ .byte 0 # end of children of DIE 0xb
+2:
+ .section .debug_abbrev,"",@progbits
+.Ldebug_abbrev0:
+ .uleb128 0x1 # (abbrev code)
+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x25 # (DW_AT_producer)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x13 # (DW_AT_language)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x42 # (DW_AT_identifier_case)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x1b # (DW_AT_comp_dir)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x10 # (DW_AT_stmt_list)
+ .uleb128 0x6 # (DW_FORM_data4)
+ .byte 0
+ .byte 0
+ .uleb128 0x2 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0x6 # (DW_FORM_data4)
+ .uleb128 0x2116 # (DW_AT_GNU_all_tail_call_sites)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x6a # (DW_AT_main_subprogram)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x36 # (DW_AT_calling_convention)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x3 # (abbrev code)
+ .uleb128 0x34 # (TAG: DW_TAG_variable)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0xa # (DW_FORM_block1)
+ .byte 0
+ .byte 0
+ .uleb128 0x4 # (abbrev code)
+ .uleb128 0xb # (TAG: DW_TAG_lexical_block)
+ .byte 0 # DW_children_no
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .byte 0
+ .byte 0
+ .uleb128 0x5 # (abbrev code)
+ .uleb128 0x1 # (TAG: DW_TAG_array_type)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x6 # (abbrev code)
+ .uleb128 0x21 # (TAG: DW_TAG_subrange_type)
+ .byte 0 # DW_children_no
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+#if 0
+ .uleb128 0x22 # (DW_AT_lower_bound)
+ .uleb128 0x6 # (DW_FORM_data4)
+ .uleb128 0x2f # (DW_AT_upper_bound)
+ .uleb128 0xb # (DW_FORM_data1)
+#else
+ .uleb128 0x22 # (DW_AT_lower_bound)
+ .uleb128 0x7 # (DW_FORM_data8)
+ .uleb128 0x2f # (DW_AT_upper_bound)
+ .uleb128 0x7 # (DW_FORM_data8)
+#endif
+ .byte 0
+ .byte 0
+ .uleb128 0x7 # (abbrev code)
+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
+ .byte 0 # DW_children_no
+ .uleb128 0xb # (DW_AT_byte_size)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3e # (DW_AT_encoding)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .byte 0
+ .byte 0
+ .uleb128 0x8 # (abbrev code)
+ .uleb128 0x21 # (TAG: DW_TAG_subrange_type)
+ .byte 0 # DW_children_no
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+#if 0
+ .uleb128 0x22 # (DW_AT_lower_bound)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x2f # (DW_AT_upper_bound)
+ .uleb128 0xb # (DW_FORM_data1)
+#else
+ .uleb128 0x22 # (DW_AT_lower_bound)
+ .uleb128 0x7 # (DW_FORM_data8)
+ .uleb128 0x2f # (DW_AT_upper_bound)
+ .uleb128 0x7 # (DW_FORM_data8)
+#endif
+ .byte 0
+ .byte 0
+ .uleb128 0x9 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3f # (DW_AT_external)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0x6 # (DW_FORM_data4)
+ .uleb128 0x2116 # (DW_AT_GNU_all_tail_call_sites)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0xa # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0xa # (DW_FORM_block1)
+ .byte 0
+ .byte 0
+ .uleb128 0xb # (abbrev code)
+ .uleb128 0x26 # (TAG: DW_TAG_const_type)
+ .byte 0 # DW_children_no
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0xc # (abbrev code)
+ .uleb128 0xf # (TAG: DW_TAG_pointer_type)
+ .byte 0 # DW_children_no
+ .uleb128 0xb # (DW_AT_byte_size)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .byte 0
+ .section .debug_loc,"",@progbits
+.Ldebug_loc0:
+.LLST0:
+ .long .LFB0-.Ltext0 # Location list begin address (*.LLST0)
+ .long .LCFI0-.Ltext0 # Location list end address (*.LLST0)
+ .value 0x2 # Location expression size
+ .byte 0x74 # DW_OP_breg4
+ .sleb128 4
+ .long .LCFI0-.Ltext0 # Location list begin address (*.LLST0)
+ .long .LCFI1-.Ltext0 # Location list end address (*.LLST0)
+ .value 0x2 # Location expression size
+ .byte 0x74 # DW_OP_breg4
+ .sleb128 8
+ .long .LCFI1-.Ltext0 # Location list begin address (*.LLST0)
+ .long .LFE0-.Ltext0 # Location list end address (*.LLST0)
+ .value 0x2 # Location expression size
+ .byte 0x75 # DW_OP_breg5
+ .sleb128 8
+ .long 0 # Location list terminator begin (*.LLST0)
+ .long 0 # Location list terminator end (*.LLST0)
+.LLST1:
+ .long .LFB1-.Ltext0 # Location list begin address (*.LLST1)
+ .long .LCFI2-.Ltext0 # Location list end address (*.LLST1)
+ .value 0x2 # Location expression size
+ .byte 0x74 # DW_OP_breg4
+ .sleb128 4
+ .long .LCFI2-.Ltext0 # Location list begin address (*.LLST1)
+ .long .LCFI3-.Ltext0 # Location list end address (*.LLST1)
+ .value 0x2 # Location expression size
+ .byte 0x74 # DW_OP_breg4
+ .sleb128 8
+ .long .LCFI3-.Ltext0 # Location list begin address (*.LLST1)
+ .long .LCFI4-.Ltext0 # Location list end address (*.LLST1)
+ .value 0x2 # Location expression size
+ .byte 0x75 # DW_OP_breg5
+ .sleb128 8
+ .long .LCFI4-.Ltext0 # Location list begin address (*.LLST1)
+ .long .LFE1-.Ltext0 # Location list end address (*.LLST1)
+ .value 0x2 # Location expression size
+ .byte 0x74 # DW_OP_breg4
+ .sleb128 4
+ .long 0 # Location list terminator begin (*.LLST1)
+ .long 0 # Location list terminator end (*.LLST1)
+ .section .debug_aranges,"",@progbits
+ .long 0x1c # Length of Address Ranges Info
+ .value 0x2 # DWARF Version
+ .long .Ldebug_info0 # Offset of Compilation Unit Info
+ .byte 0x4 # Size of Address
+ .byte 0 # Size of Segment Descriptor
+ .value 0 # Pad to 8 byte boundary
+ .value 0
+ .long .Ltext0 # Address
+ .long .Letext0-.Ltext0 # Length
+ .long 0
+ .long 0
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .section .debug_str,"MS",@progbits,1
+.LASF4:
+ .string "character(kind=1)"
+.LASF5:
+ .string "GNU Fortran 4.8.0 20121015 (experimental) -ffixed-form -m32 -mtune=generic -march=x86-64 -g -gdwarf-2 -fintrinsic-modules-path .../gcchead-root/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/finclude"
+.LASF7:
+ .string ""
+.LASF0:
+#if 0
+ .string "integer(kind=4)"
+#else
+ .string "integer(kind=8)"
+#endif
+.LASF9:
+ .string "main"
+.LASF8:
+ .string "MAIN__"
+.LASF6:
+ .string "gdb.fortran/array-bounds.f"
+.LASF2:
+ .string "argc"
+.LASF1:
+ .string "real(kind=4)"
+.LASF3:
+ .string "argv"
+ .ident "GCC: (GNU) 4.8.0 20121015 (experimental)"
+ .section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,156 @@
http://sourceware.org/ml/gdb-patches/2012-08/msg00562.html
Subject: [PATCH] Expand fortran array bounds sizes to LONGEST
--MP_/90J7bck2fqDySEX9JkZtaqL
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
Range bounds for a gdb type can have LONGEST values for low and high
bounds. Fortran range bounds functions however use only int. The larger
ranges don't compile by default on gcc, but it is possible to override
the check in the compiler by using -fno-range-check. As a result, this
check is necessary so that we don't print junk in case of an overflow.
Attached patch does this expansion and also includes a test case that
verifies that the problem is fixed. I have also verified on x86_64 that
this patch does not cause any regressions.
Regards,
Siddhesh
gdb/ChangeLog:
* f-lang.h (f77_get_upperbound): Return LONGEST.
(f77_get_lowerbound): Likewise.
* f-typeprint.c (f_type_print_varspec_suffix): Expand
UPPER_BOUND and LOWER_BOUND to LONGEST. Use plongest to format
print them.
(f_type_print_base): Expand UPPER_BOUND to LONGEST. Use
plongest to format print it.
* f-valprint.c (f77_get_lowerbound): Return LONGEST.
(f77_get_upperbound): Likewise.
(f77_get_dynamic_length_of_aggregate): Expand UPPER_BOUND,
LOWER_BOUND to LONGEST.
(f77_create_arrayprint_offset_tbl): Likewise.
testsuite/ChangeLog:
* gdb.fortran/array-bounds.exp: New test case.
* gdb.fortran/array-bounds.f: New test case.
--MP_/90J7bck2fqDySEX9JkZtaqL
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=f77-bounds.patch
Index: gdb-7.5.0.20120926/gdb/f-lang.h
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/f-lang.h 2012-11-07 22:12:39.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/f-lang.h 2012-11-07 22:52:02.688632498 +0100
@@ -66,9 +66,9 @@ enum f90_range_type
extern char *real_main_name; /* Name of main function. */
extern int real_main_c_value; /* C_value field of main function. */
-extern int f77_get_upperbound (struct type *);
+extern LONGEST f77_get_upperbound (struct type *);
-extern int f77_get_lowerbound (struct type *);
+extern LONGEST f77_get_lowerbound (struct type *);
extern void f77_get_dynamic_array_length (struct type *);
Index: gdb-7.5.0.20120926/gdb/f-typeprint.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/f-typeprint.c 2012-11-07 22:00:41.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/f-typeprint.c 2012-11-07 22:52:02.689632497 +0100
@@ -182,7 +182,7 @@ f_type_print_varspec_suffix (struct type
int show, int passed_a_ptr, int demangled_args,
int arrayprint_recurse_level)
{
- int upper_bound, lower_bound;
+ LONGEST upper_bound, lower_bound;
/* No static variables are permitted as an error call may occur during
execution of this function. */
@@ -212,7 +212,7 @@ f_type_print_varspec_suffix (struct type
lower_bound = f77_get_lowerbound (type);
if (lower_bound != 1) /* Not the default. */
- fprintf_filtered (stream, "%d:", lower_bound);
+ fprintf_filtered (stream, "%s:", plongest (lower_bound));
/* Make sure that, if we have an assumed size array, we
print out a warning and print the upperbound as '*'. */
@@ -222,7 +222,7 @@ f_type_print_varspec_suffix (struct type
else
{
upper_bound = f77_get_upperbound (type);
- fprintf_filtered (stream, "%d", upper_bound);
+ fprintf_filtered (stream, "%s", plongest (upper_bound));
}
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
@@ -291,7 +291,7 @@ void
f_type_print_base (struct type *type, struct ui_file *stream, int show,
int level)
{
- int upper_bound;
+ LONGEST upper_bound;
int index;
QUIT;
@@ -373,7 +373,7 @@ f_type_print_base (struct type *type, st
else
{
upper_bound = f77_get_upperbound (type);
- fprintf_filtered (stream, "character*%d", upper_bound);
+ fprintf_filtered (stream, "character*%s", plongest (upper_bound));
}
break;
Index: gdb-7.5.0.20120926/gdb/f-valprint.c
===================================================================
--- gdb-7.5.0.20120926.orig/gdb/f-valprint.c 2012-11-07 22:09:29.000000000 +0100
+++ gdb-7.5.0.20120926/gdb/f-valprint.c 2012-11-07 22:52:21.888604907 +0100
@@ -57,7 +57,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN
#define F77_DIM_BYTE_STRIDE(n) (f77_array_offset_tbl[n][0])
-int
+LONGEST
f77_get_lowerbound (struct type *type)
{
f_object_address_data_valid_or_error (type);
@@ -68,7 +68,7 @@ f77_get_lowerbound (struct type *type)
return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
}
-int
+LONGEST
f77_get_upperbound (struct type *type)
{
f_object_address_data_valid_or_error (type);
@@ -92,8 +92,8 @@ f77_get_upperbound (struct type *type)
static void
f77_get_dynamic_length_of_aggregate (struct type *type)
{
- int upper_bound = -1;
- int lower_bound = 1;
+ LONGEST upper_bound = -1;
+ LONGEST lower_bound = 1;
/* Recursively go all the way down into a possibly multi-dimensional
F77 array and get the bounds. For simple arrays, this is pretty
@@ -128,7 +128,7 @@ f77_create_arrayprint_offset_tbl (struct
struct type *tmp_type;
LONGEST eltlen;
int ndimen = 1;
- int upper, lower;
+ LONGEST upper, lower;
tmp_type = type;

View File

@ -0,0 +1,425 @@
--- gdb-7.5.0.20120926-m64/gdb/value.c-orig 2012-11-09 17:08:52.137406118 +0100
+++ gdb-7.5.0.20120926-m64/gdb/value.c 2012-11-09 17:32:38.324199230 +0100
@@ -663,7 +663,6 @@ allocate_value_lazy (struct type *type)
description correctly. */
check_typedef (type);
- ulongest_fits_host_or_error (TYPE_LENGTH (type));
val = (struct value *) xzalloc (sizeof (struct value));
val->contents = NULL;
val->next = all_values;
--- /dev/null 2012-10-18 11:08:13.202328239 +0200
+++ gdb-7.5.0.20120926-m64-test/gdb/testsuite/gdb.base/longest-types.exp 2012-11-09 18:13:56.286587994 +0100
@@ -0,0 +1,59 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+standard_testfile .c longest-types-64bit.S
+
+proc test { name } { with_test_prefix $name {
+ # 64-bit array size should not overflow
+ gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0}
+
+ # The offset should not overflow
+ gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000}
+}}
+
+
+# Test 64-bit file first as it is not compiled so its compilation never fails.
+
+set file64bitbz2uu ${srcdir}/${subdir}/${testfile}-64bit.bz2.uu
+set file64bit ${objdir}/${subdir}/${testfile}-64bit
+
+if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} {
+ untested "failed uudecode or bzip2"
+ return -1
+}
+file stat ${file64bit} file64bitstat
+if {$file64bitstat(size) != 9501} {
+ untested "uudecode or bzip2 produce invalid result"
+ return -1
+}
+
+clean_restart ${file64bit}
+
+#if { [prepare_for_testing ${testfile}.exp ${testfile}-64bit $srcfile2 {nodebug}] } {
+# return -1
+#}
+
+test "64bit"
+
+
+# And here is the native build test.
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } {
+ return -1
+}
+
+test "native"
--- /dev/null 2012-10-18 11:08:13.202328239 +0200
+++ ./gdb/testsuite/gdb.base/longest-types.c 2012-11-09 17:08:51.374406344 +0100
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+struct foo
+{
+ char buf[0xffff000000];
+ char buf2[2];
+} *f;
+
+int
+main (void)
+{
+ return 0;
+}
--- /dev/null 2012-10-18 11:08:13.202328239 +0200
+++ ./gdb/testsuite/gdb.base/longest-types-64bit.S 2012-11-09 17:51:37.597846130 +0100
@@ -0,0 +1,249 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ .file "longest-types-64bit.c"
+ .text
+.Ltext0:
+ .globl main
+main:
+ .comm f,8,8
+.Letext0:
+ .file 1 "gdb.base/longest-types-64bit.c"
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .4byte 0x9a /* Length of Compilation Unit Info */
+ .2byte 0x2 /* DWARF version number */
+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
+ .byte 0x8 /* Pointer Size (in bytes) */
+ .uleb128 0x1 /* (DIE (0xb) DW_TAG_compile_unit) */
+ .4byte .LASF3 /* DW_AT_producer: "GNU C 4.7.3 20121109 (prerelease)" */
+ .byte 0x1 /* DW_AT_language */
+ .4byte .LASF4 /* DW_AT_name: "gdb.base/longest-types-64bit.c" */
+ .4byte .LASF5 /* DW_AT_comp_dir: "" */
+ .4byte .Ldebug_line0 /* DW_AT_stmt_list */
+ .uleb128 0x2 /* (DIE (0x1d) DW_TAG_structure_type) */
+ .ascii "foo\0" /* DW_AT_name */
+ .4byte 0xff000002 /* DW_AT_byte_size */
+ .byte 0x1 /* DW_AT_decl_file (gdb.base/longest-types-64bit.c) */
+ .byte 0x12 /* DW_AT_decl_line */
+ .4byte 0x4e /* DW_AT_sibling */
+ .uleb128 0x3 /* (DIE (0x2c) DW_TAG_member) */
+ .ascii "buf\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.base/longest-types-64bit.c) */
+ .byte 0x14 /* DW_AT_decl_line */
+ .4byte 0x4e /* DW_AT_type */
+ .byte 0x2 /* DW_AT_data_member_location */
+ .byte 0x23 /* DW_OP_plus_uconst */
+ .uleb128 0
+ .uleb128 0x4 /* (DIE (0x3a) DW_TAG_member) */
+ .4byte .LASF0 /* DW_AT_name: "buf2" */
+ .byte 0x1 /* DW_AT_decl_file (gdb.base/longest-types-64bit.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .4byte 0x73 /* DW_AT_type */
+ .byte 0x7 /* DW_AT_data_member_location */
+ .byte 0x23 /* DW_OP_plus_uconst */
+ .uleb128 0xffff000000
+ .byte 0 /* end of children of DIE 0x1d */
+ .uleb128 0x5 /* (DIE (0x4e) DW_TAG_array_type) */
+ .4byte 0x6c /* DW_AT_type */
+ .4byte 0x65 /* DW_AT_sibling */
+ .uleb128 0x6 /* (DIE (0x57) DW_TAG_subrange_type) */
+ .4byte 0x65 /* DW_AT_type */
+ .quad 0xfffeffffff /* DW_AT_upper_bound */
+ .byte 0 /* end of children of DIE 0x4e */
+ .uleb128 0x7 /* (DIE (0x65) DW_TAG_base_type) */
+ .byte 0x8 /* DW_AT_byte_size */
+ .byte 0x7 /* DW_AT_encoding */
+ .4byte .LASF1 /* DW_AT_name: "sizetype" */
+ .uleb128 0x7 /* (DIE (0x6c) DW_TAG_base_type) */
+ .byte 0x1 /* DW_AT_byte_size */
+ .byte 0x6 /* DW_AT_encoding */
+ .4byte .LASF2 /* DW_AT_name: "char" */
+ .uleb128 0x5 /* (DIE (0x73) DW_TAG_array_type) */
+ .4byte 0x6c /* DW_AT_type */
+ .4byte 0x83 /* DW_AT_sibling */
+ .uleb128 0x8 /* (DIE (0x7c) DW_TAG_subrange_type) */
+ .4byte 0x65 /* DW_AT_type */
+ .byte 0x1 /* DW_AT_upper_bound */
+ .byte 0 /* end of children of DIE 0x73 */
+ .uleb128 0x9 /* (DIE (0x83) DW_TAG_variable) */
+ .ascii "f\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.base/longest-types-64bit.c) */
+ .byte 0x16 /* DW_AT_decl_line */
+ .4byte 0x97 /* DW_AT_type */
+ .byte 0x1 /* DW_AT_external */
+ .byte 0x9 /* DW_AT_location */
+ .byte 0x3 /* DW_OP_addr */
+ .quad f
+ .uleb128 0xa /* (DIE (0x97) DW_TAG_pointer_type) */
+ .byte 0x8 /* DW_AT_byte_size */
+ .4byte 0x1d /* DW_AT_type */
+ .byte 0 /* end of children of DIE 0xb */
+ .section .debug_abbrev,"",@progbits
+.Ldebug_abbrev0:
+ .uleb128 0x1 /* (abbrev code) */
+ .uleb128 0x11 /* (TAG: DW_TAG_compile_unit) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x25 /* (DW_AT_producer) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .uleb128 0x13 /* (DW_AT_language) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .uleb128 0x1b /* (DW_AT_comp_dir) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .uleb128 0x10 /* (DW_AT_stmt_list) */
+ .uleb128 0x6 /* (DW_FORM_data4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x2 /* (abbrev code) */
+ .uleb128 0x13 /* (TAG: DW_TAG_structure_type) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0xb /* (DW_AT_byte_size) */
+ .uleb128 0x6 /* (DW_FORM_data4) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x1 /* (DW_AT_sibling) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x3 /* (abbrev code) */
+ .uleb128 0xd /* (TAG: DW_TAG_member) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x38 /* (DW_AT_data_member_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0x4 /* (abbrev code) */
+ .uleb128 0xd /* (TAG: DW_TAG_member) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x38 /* (DW_AT_data_member_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0x5 /* (abbrev code) */
+ .uleb128 0x1 /* (TAG: DW_TAG_array_type) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x1 /* (DW_AT_sibling) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x6 /* (abbrev code) */
+ .uleb128 0x21 /* (TAG: DW_TAG_subrange_type) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x2f /* (DW_AT_upper_bound) */
+ .uleb128 0x7 /* (DW_FORM_data8) */
+ .byte 0
+ .byte 0
+ .uleb128 0x7 /* (abbrev code) */
+ .uleb128 0x24 /* (TAG: DW_TAG_base_type) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0xb /* (DW_AT_byte_size) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3e /* (DW_AT_encoding) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .byte 0
+ .byte 0
+ .uleb128 0x8 /* (abbrev code) */
+ .uleb128 0x21 /* (TAG: DW_TAG_subrange_type) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x2f /* (DW_AT_upper_bound) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .byte 0
+ .byte 0
+ .uleb128 0x9 /* (abbrev code) */
+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x3f /* (DW_AT_external) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x2 /* (DW_AT_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0xa /* (abbrev code) */
+ .uleb128 0xf /* (TAG: DW_TAG_pointer_type) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0xb /* (DW_AT_byte_size) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .byte 0
+ .section .debug_aranges,"",@progbits
+ .4byte 0x1c /* Length of Address Ranges Info */
+ .2byte 0x2 /* DWARF Version */
+ .4byte .Ldebug_info0 /* Offset of Compilation Unit Info */
+ .byte 0x8 /* Size of Address */
+ .byte 0 /* Size of Segment Descriptor */
+ .2byte 0 /* Pad to 16 byte boundary */
+ .2byte 0
+ .quad 0
+ .quad 0
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .section .debug_str,"MS",@progbits,1
+.LASF4:
+ .string "gdb.base/longest-types-64bit.c"
+.LASF3:
+ .string "GNU C 4.7.3 20121109 (prerelease)"
+.LASF0:
+ .string "buf2"
+.LASF1:
+ .string "sizetype"
+.LASF5:
+ .string ""
+.LASF2:
+ .string "char"
+ .ident "GCC: (GNU) 4.7.3 20121109 (prerelease)"
+ .section .note.GNU-stack,"",@progbits
--- /dev/null 2012-10-18 11:08:13.202328239 +0200
+++ gdb-7.5.0.20120926-m64-test/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu 2012-11-09 18:04:52.995692771 +0100
@@ -0,0 +1,67 @@
+begin 755 gdb.base/longest-types-64bit.bz2
+M0EIH.3%!62936<'N#OH`"G/________^______?_Y______//]7SQD5'^/_%
+M=VY7?F_[X`F]]SG7531-==V:Z-.FW;M.U7=';:UH@<&FD31,E3]J'HE-/TR@
+M]4_5/32;%/U3]1--HU/U$#$R'I'J,FC0T-,)B'J#:CU,F@]0`/4:>F@CU/4,
+MA@$S2>IH!H`TR/0-$$:9`C(&FHU3VE-J;4\%,@>4T:#]49-J/4`>HT!H#3)^
+MJ`!H-``T]0&@-```:'J``&@`:9!`R9,@&3(`#3!#0!H``-#$--`,@``T`T#(
+M:`:`&0&@::,0:-```:``-`E-$1#4-3:4]3R9-39(Q/)#3R-30:9#$T!D!H&@
+M,CTGI!H#(#0T`#0``T`T`:``-``T`0,F3(!DR``TP0T`:``#0Q#30#(``-`-
+M`R&@&@!D!H&FC$&C0``&@`#0)%)H32>JGZ&!)Z1B1X@)DTVC4>H`&0:``R&@
+M,C0:``T``,C0``!H``#(`T`:#0U^\?]7K8M.96V/2[?M*DC)>WIUF)H7T\<T
+M[0D)70G25.YB!,:;8Q(;&XPAB4+$Q%:P)PA-;E=!-&$KNR22EM>$:KKRE&\Q
+M..M]L1*,!>D!X)RW,[,1I,9N%X-N&2+*:&)DJY4(VFQG%9K[/?J06WACF6-I
+MJ&JJ9,ZK4;X28M@[==%ME(A54:%>+3->MRK(G!8#TY>@E$6DR&<_5:C&/RZE
+MI<ON+RY5`LA"@DD$$DF!I9O]5X%G985_=V<.;?K9:G2R-#K<CB,1;26A<H4G
+M3R3I!)WX,-%>,!E6#`;*8R*E@++*))U)[6=OKFM%'+$-H5\X@1D)_Y*"NKV.
+M&\F8?SXW^<O]_DW.8WD@HY.NMMIBXFVROM_SKZ#4-`>HQ:Y@(Q[.>PEG=]@^
+M%C"3EZ/1X'H*02ZQH":6"@;8Z0LEW6<OKJ%$`01%`B;O!N*W1V.HC$``,:CS
+M6(/OTI'-:O6=7$/#?0T9Q[GSY1)6V`+CV@#XWMF`<S:AG<!43X"VGD,E=>)>
+M6^V=*`FB'5G4MD8L3J5XT#SW;J1]ZO+"SPIS%J(P46+Q=CC2$H-`-B&TD)M`
+M&A:066DA%AB0C6,460>M8B+$:-BR&@NM()F`S',,F8+#&0.SMOK@.G<'83N.
+MDA"#5-`JVC("1*TA;/M()&8J0+YH%IFV)+OA@4,`E?3M$[$@&Q`3]A!$&A(-
+M$PBT+2,@PU+2H9(T-H3N6'(2;""%2T*1I2P@`L?AG8&A!=31J7)1(9FB'8X=
+MWJ0S#YEG9K$.#.[L.[CNA"4JSJ^GK2*)UH=MC0.R8+E75'.09<NU&R0G1>[G
+MMQ1*[GI:>#>K`_NZS:V6>$K;OX6#!!N'"2413$DTL&]7KY>B<3V5!!C8#X5+
+MF%9<N\]C%B6OS;LH@1LR3R<LS+<]N]9\JZ<LJ#2_S2'UW('DZ!N>X!8NOKM5
+M+"N&P4.75C16!A9Q;:C.6N`WZDV=-]!<BTB<1Q*P(T4'&*2:@$=J@(M8)!5=
+MO;[ECS>,5PG<T[XC594XI0@RVPD86,M11%(T>]SNP[GV^L?YGI]7_'D8N?XV
+M'[7KZJWYVMXGBQS[`!)YI%3:D)I2!;%'R`W&YB<`9O2#F"C/)F;JK9P+@3&(
+MAH31[W)=YCODQDUKNM7A"3.C!2%CHTJNZ"Z\+#F-?(DLE>XAC%07B8;$%J_L
+MJPK48QC&,916=IM+<1&WRKLB6&Q2O79*!7S$,`7J8*!`!=K:5W550[NH9M#_
+MKL!LT,&;59GZW7S"5Z4%`%&!`9"J9`0:IR&H=MTKT=PEYC$,4K90M9AT'%;_
+MB0HVLE)(W&YWF,C:TURXO:`M[RX(A-GT97456Q4Z*HPU*4J:*[WU-4GD.9UV
+MSA#L4X[[*Y+)8IF.EO<.TP4IC2?(4HX)W1#:GOMOD2F;HM1BV#<E%PM+0&N5
+MP@$\$FD4C-Q^L"H^)NP2-.^JTT!8+!;'Z=KM7%'K@\)*PSETF&M6<Q#>;PH[
+M7:PJ-!#,!6N<3')-0C,>15'IZ>@U^CJJJ+>+>%%)%BBATD\)*F6&BLMIR&?\
+MQ2_?33@"NR1/CN\:)>5DG6`>$;$3QA94'-3]*CU6YG])<=2)'GC"RP-RK&-3
+MZDT-M_)R+F06DS?CR>E@^!,33"U6X<@OXO$Q>U$\T@IU<H-42=0YE[$,T`\H
+M('>'@T=>K`G7H8K5GLXMS3*^@JLVBHHE'.&?9RKC?Y`&&3J5!/C$++<@U#Q'
+M9R3I.$+S`%]-.UO>WH^C73F<&;RIJR+(Q@7(3PP*W[-O,,DD3S7BUK^I@D%*
+M`Y<*2TXJ&7;2'6'R.U>]0-="M`K+&N%/==N4U@9%@M1)U&251C($^S"WL"]T
+M-XN'D2[II3-$K%+&`3['O)%,8G*E%_8RV6A5B_4(2/?-AIC.\/>,YFJ<(G.8
+MAVP?UN*=ME:7&T!C%)I:&4H:-5>&^!&0>A.O'0G'/6&ZZ964@04&=#DC`%&:
+MUNLOS?,?'T:T!8L80<H_W1>='M:96K4;JX)6.('1#J$.1/L)$IS<4/*'2D34
+M/@J\BA(I2T40JS%9G8F!7U5_!#'U!+[7$ES&)@:*QAET-IBX6'_N5^7/#>@V
+MN3&,-6(AG[8&!8LV+F_U"W?/)+Y^,;=1K:SW28<0WA2"UPHP^8FG#R$!`Y`,
+MLF<`U*NNU\[6N03"*?I8D=K7.Z*H=A_3<H1Z%.Q8%2SR@I45('.EGR<N^\`Z
+M\[Z\D+/3>7;S=LVC(BQ,5<M0A"#`]7UK7W3%5(:FBMER3XSP15N!)`-^ZJZ%
+M:4)>8Q_\#G`'P*_-]T!G4$`V0BS]'S)D/;V7R?.2F?SF)N+2+#P2_<G#1B)C
+M(8?NF/+?:UMR3B#9$MBDCI2G7&N'T`FV!ERQ[21DOJ_8I73#BILTTSK)B5P<
+MG22S=*7TI>G(49TCE&*UIVT-MP808VTVV-$(*`VT<%>%96AHOL`(7%SI2%-R
+M#G2F02VQQH-7KT3E05I9Z)E\$Y8ED1KU`(4QHT%B]1$F:F1&8DAN.Q4&*?F@
+M.8D965.$PRH<VD+()"8&I%<R"P,Y[A,)^B(O%1(J%,)M(O6)8E%LY?C6X@@K
+M(F!2TA\,RE<O"E2*G?JE2YF\*OJM?$KWXW6R(3LR-)W.[:ZJC?ZE4,("J$()
+M5@U!62M"WBJ=&Q(L$5,4494K=.0B0#,C3$*``XLTF$DN!6P#%,4K%HTIC[*O
+M6"4S,;RN&@=NP7@72:=U#&JPBQ-60OEAWY;CUYF+$73.R>T5HD,G=G!KTF3D
+M94"&ZA-F,.19=8`\(Q;A07Q%!19*3#*F9Q+D(0K@V87@O.=7EJIM6`!4`>D!
+M)49QHA!BV+:4O@K00$$!5*6>A@2@4D)@R\"%$2F"O:24J*L(RP#N;O4K7I&2
+M[#)KR47H-N[<O^S-)"_Q\>VJ%3>$`9,AF8QID&I3G+D`*]BX98B$2K":A7_\
+M_]7LT!4,$NL5)NE>9[:MK2_/'GO:7"P`=<X'"U9""0<PJ`3`.:*(Z]-.GQ,9
+M>P(\L]O?"-APH(834$,W!IJS+U1F1C.!D$!&KS^-6%F90PQ[F]F=$^QE\X+-
+M@.W*LPH_78B>MHH@69RU[*'1J@8QAC\KSV@IG\(;_CUW:ZR2.,0$E3LZ_^P=
+M<_DCP"Q<`;+_;YP#^U%&E^#2M%,T?F3UN^>TSH)GFL"\%RF[KNZ+[R+@<&.$
+MC42)B96\1-.O_I).K7)X]W>EQ):4C(XB*+:S%0_37D^EBP+1HU(D?3"%_O2R
+M6-#X>AU#<$*!/,W6QC^;O^%]LR&_X'<8X$<3CUU_QFAJ;">H)2443GD4W!4#
+?<55!2^6_8J$)-O<>\H0U/6Q^>UG0%W)%.%"0P>X.^@``
+`
+end

View File

@ -0,0 +1,723 @@
Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.S
===================================================================
--- /dev/null
+++ gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.S
@@ -0,0 +1,638 @@
+/* Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This file has been generated from the file named `xlf-variable.f', which
+ should be present in this directory. The command used to generate this
+ file was:
+
+ xlf -qnoopt -g9 -S xlf-variable.f -o xlf-variable.S
+
+ After issuing this command, you must hand-edit this file and remove the
+ mentions for `_xlfExit', since it is only present in XLF-specific
+ libraries. You must also make sure to remove the file named `mod1.mod'
+ which will be created in the compilation directory.
+
+ In order to generated this file, the following XLF package was used:
+
+ xlf.14.1.0.0.linux.eval.tar.gz
+
+ These instructions may be different for different versions of the XLF
+ compiler. */
+
+.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; .set r4,4
+.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
+.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
+.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
+.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
+.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
+.set r30,30; .set r31,31
+.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4
+.set fp5,5; .set fp6,6; .set fp7,7; .set fp8,8; .set fp9,9
+.set fp10,10; .set fp11,11; .set fp12,12; .set fp13,13; .set fp14,14
+.set fp15,15; .set fp16,16; .set fp17,17; .set fp18,18; .set fp19,19
+.set fp20,20; .set fp21,21; .set fp22,22; .set fp23,23; .set fp24,24
+.set fp25,25; .set fp26,26; .set fp27,27; .set fp28,28; .set fp29,29
+.set fp30,30; .set fp31,31
+.set v0,0; .set v1,1; .set v2,2; .set v3,3; .set v4,4
+.set v5,5; .set v6,6; .set v7,7; .set v8,8; .set v9,9
+.set v10,10; .set v11,11; .set v12,12; .set v13,13; .set v14,14
+.set v15,15; .set v16,16; .set v17,17; .set v18,18; .set v19,19
+.set v20,20; .set v21,21; .set v22,22; .set v23,23; .set v24,24
+.set v25,25; .set v26,26; .set v27,27; .set v28,28; .set v29,29
+.set v30,30; .set v31,31
+.set q0,0; .set q1,1; .set q2,2; .set q3,3; .set q4,4
+.set q5,5; .set q6,6; .set q7,7; .set q8,8; .set q9,9
+.set q10,10; .set q11,11; .set q12,12; .set q13,13; .set q14,14
+.set q15,15; .set q16,16; .set q17,17; .set q18,18; .set q19,19
+.set q20,20; .set q21,21; .set q22,22; .set q23,23; .set q24,24
+.set q25,25; .set q26,26; .set q27,27; .set q28,28; .set q29,29
+.set q30,30; .set q31,31
+.set MQ,0; .set XER,1; .set FROM_RTCU,4; .set FROM_RTCL,5; .set FROM_DEC,6
+.set LR,8; .set CTR,9; .set TID,17; .set DSISR,18; .set DAR,19; .set TO_RTCU,20
+.set TO_RTCL,21; .set TO_DEC,22; .set SDR_0,24; .set SDR_1,25; .set SRR_0,26
+.set SRR_1,27
+.set BO_dCTR_NZERO_AND_NOT,0; .set BO_dCTR_NZERO_AND_NOT_1,1
+.set BO_dCTR_ZERO_AND_NOT,2; .set BO_dCTR_ZERO_AND_NOT_1,3
+.set BO_IF_NOT,4; .set BO_IF_NOT_1,5; .set BO_IF_NOT_2,6
+.set BO_IF_NOT_3,7; .set BO_dCTR_NZERO_AND,8; .set BO_dCTR_NZERO_AND_1,9
+.set BO_dCTR_ZERO_AND,10; .set BO_dCTR_ZERO_AND_1,11; .set BO_IF,12
+.set BO_IF_1,13; .set BO_IF_2,14; .set BO_IF_3,15; .set BO_dCTR_NZERO,16
+.set BO_dCTR_NZERO_1,17; .set BO_dCTR_ZERO,18; .set BO_dCTR_ZERO_1,19
+.set BO_ALWAYS,20; .set BO_ALWAYS_1,21; .set BO_ALWAYS_2,22
+.set BO_ALWAYS_3,23; .set BO_dCTR_NZERO_8,24; .set BO_dCTR_NZERO_9,25
+.set BO_dCTR_ZERO_8,26; .set BO_dCTR_ZERO_9,27; .set BO_ALWAYS_8,28
+.set BO_ALWAYS_9,29; .set BO_ALWAYS_10,30; .set BO_ALWAYS_11,31
+.set CR0_LT,0; .set CR0_GT,1; .set CR0_EQ,2; .set CR0_SO,3
+.set CR1_FX,4; .set CR1_FEX,5; .set CR1_VX,6; .set CR1_OX,7
+.set CR2_LT,8; .set CR2_GT,9; .set CR2_EQ,10; .set CR2_SO,11
+.set CR3_LT,12; .set CR3_GT,13; .set CR3_EQ,14; .set CR3_SO,15
+.set CR4_LT,16; .set CR4_GT,17; .set CR4_EQ,18; .set CR4_SO,19
+.set CR5_LT,20; .set CR5_GT,21; .set CR5_EQ,22; .set CR5_SO,23
+.set CR6_LT,24; .set CR6_GT,25; .set CR6_EQ,26; .set CR6_SO,27
+.set CR7_LT,28; .set CR7_GT,29; .set CR7_EQ,30; .set CR7_SO,31
+.set TO_LT,16; .set TO_GT,8; .set TO_EQ,4; .set TO_LLT,2; .set TO_LGT,1
+
+ .file "xlf-variable.f"
+ .globl __mod1_NMOD_____mod1
+ .type __mod1_NMOD_____mod1,@function
+ .size __mod1_NMOD_____mod1,32
+ .globl main
+ .type main,@function
+ .size main,68
+ .globl __mod1_NMOD_sub1
+ .type __mod1_NMOD_sub1,@function
+ .size __mod1_NMOD_sub1,136
+ .globl _main
+ .type _main,@function
+ .size _main,68
+
+ .section ".text"
+ .align 7
+.LC.text:
+__mod1_NMOD_____mod1:
+ stwu SP,-32(SP)
+ stw r31,28(SP)
+ or r31,SP,SP
+ b $+0x4
+ addi r11,r31,32
+ lwz r31,-4(r11)
+ or SP,r11,r11
+ bclr BO_ALWAYS,CR0_LT
+.LC.text32:
+
+__mod1_NMOD_sub1:
+ stwu SP,-32(SP)
+ stw r31,28(SP)
+ stw r30,24(SP)
+ or r31,SP,SP
+ addis r30,r0,.const_dr@ha
+ addi r30,r30,.const_dr@l
+ addis r3,r0,__N_mod1@ha
+ addi r3,r3,__N_mod1@l
+ addi r0,r0,1
+ stb r0,4(r3)
+ addi r4,r0,14
+ stb r4,5(r3)
+ stb r0,7(r3)
+ addis r5,r0,__N__mod1@ha
+ addi r5,r5,__N__mod1@l
+ stw r5,0(r3)
+ lbz r5,6(r3)
+ rlwinm r5,r5,0,25,25
+ ori r5,r5,0x0040
+ stb r5,6(r3)
+ lwz r5,0(r3)
+ lfs fp0,0(r30)
+ stfs fp0,0(r5)
+ stb r0,4(r3)
+ stb r4,5(r3)
+ addi r4,r0,0
+ stb r4,6(r3)
+ stb r0,7(r3)
+ b $+0x4
+ addi r11,r31,32
+ lwz r30,-8(r11)
+ lwz r31,-4(r11)
+ or SP,r11,r11
+ bclr BO_ALWAYS,CR0_LT
+.LC.text168:
+ .long 0
+ .skip 0x54
+.LC.text256:
+
+main:
+_main:
+ mfspr r0,LR
+ stwu SP,-32(SP)
+ stw r31,28(SP)
+ stw r0,36(SP)
+ or r31,SP,SP
+ bl __mod1_NMOD_sub1
+ addi r3,r0,0
+.LC.text288:
+
+ tw TO_EQ,r14,r14
+ addi r3,r0,0
+ b $+0x4
+ addi r11,r31,32
+ lwz r31,-4(r11)
+ lwz r0,4(r11)
+ mtspr LR,r0
+ or SP,r11,r11
+ bclr BO_ALWAYS,CR0_LT
+.LC.text324:
+
+
+ .section ".rodata","a"
+ .align 2
+.LC.rodata:
+ .type .const_dr,@object
+ .size .const_dr,4
+.const_dr:
+ .long 0x40400000
+
+ .section ".eh_frame","wa"
+ .align 2
+.LC.eh_frame:
+ .long 0x0000000c
+ .long 0x00000000
+ .long 0x0100047c
+ .long 0x410c0100
+ .long 0x0000001c
+ .long 0x00000014
+ .long .LC.text
+ .long 0x00000020
+ .long 0x410e2041
+ .long 0x9f01410d
+ .long 0x1f410a42
+ .long 0xdf420b00
+ .long 0x00000020
+ .long 0x00000034
+ .long .LC.text32
+ .long 0x00000088
+ .long 0x410e2041
+ .long 0x9f01419e
+ .long 0x02410d1f
+ .long 0x590a42de
+ .long 0x41df420b
+ .long 0x0000000c
+ .long 0x00000000
+ .long 0x0100047c
+ .long 0x410c0100
+ .long 0x00000020
+ .long 0x00000014
+ .long .LC.text256
+ .long 0x00000044
+ .long 0x420e2041
+ .long 0x9f014111
+ .long 0x417f410d
+ .long 0x1f460a42
+ .long 0xdf440b00
+
+ .section ".data","wa"
+ .align 4
+.LC.data:
+ .globl __N_mod1
+ .type __N_mod1,@object
+ .size __N_mod1,8
+__N_mod1:
+ .long 0x00000000
+ .long 0x01000001
+
+ .section ".except.1","wa"
+ .align 1
+.LC.except.1:
+ .long .LC.text288
+ .byte 0x01
+ .byte 0x09
+
+ .ident "Fri Jun 15 16:35:45 2012 .IBM XL Fortran for Linux, V14.1 (5765-J05, 5725-C75) Version 14.01.0000.0000.Fri Jun 15 16:35:45 2012 .IBM XL Fortran for Linux, V14.1 (5765-J05, 5725-C75) Version 14.01.0000.0000."
+
+ .section ".debug_aranges"
+ .align 0
+.LC.debug_aranges:
+ .long 0x0000001c
+ .byte 0x00
+ .byte 0x02
+ .long .LC.debug_info
+ .long 0x04000000
+ .byte 0x00
+ .byte 0x00
+ .long .LC.text
+ .long 0x000000a8
+ .long 0x00000000
+ .long 0x00000000
+ .long 0x0000001c
+ .byte 0x00
+ .byte 0x02
+ .long .LC.debug_info273
+ .long 0x04000000
+ .byte 0x00
+ .byte 0x00
+ .long .LC.text256
+ .long 0x00000044
+ .long 0x00000000
+ .long 0x00000000
+
+ .section ".debug_pubnames"
+ .align 0
+.LC.debug_pubnames:
+ .long 0x0000002f
+ .byte 0x00
+ .byte 0x02
+ .long .LC.debug_info
+ .long 0x00000111
+ .long 0x000000dc
+ .long 0x79000000
+ .long 0x00ec7a00
+ .long 0x000000fc
+ .long 0x5f5f6d6f
+ .long 0x64315f4e
+ .long 0x4d4f445f
+ .long 0x73756231
+ .long 0x00000000
+ .long 0x00000000
+ .byte 0x18
+ .byte 0x00
+ .byte 0x02
+ .long .LC.debug_info273
+ .long 0x00000127
+ .long 0x0000010f
+ .long 0x5f6d6169
+ .long 0x6e000000
+ .byte 0x00
+ .byte 0x00
+
+ .section ".debug_info"
+ .align 0
+.LC.debug_info:
+ .long 0x0000010d
+ .byte 0x00
+ .byte 0x02
+ .long .LC.debug_abbrev
+ .long 0x0401786c
+ .long 0x662d7661
+ .long 0x72696162
+ .long 0x6c652e66
+ .byte 0x00
+ .long .LC.debug_line
+ .long .LC.text
+ .long .LC.text168
+ .long 0x082f726f
+ .long 0x6f742f73
+ .long 0x65726769
+ .long 0x6f646a2f
+ .long 0x6764622d
+ .long 0x372e302e
+ .long 0x312d3432
+ .long 0x2e656c35
+ .long 0x2f676462
+ .long 0x2d372e30
+ .long 0x2e312f67
+ .long 0x64622f74
+ .long 0x65737473
+ .long 0x75697465
+ .long 0x2f676462
+ .long 0x2e666f72
+ .long 0x7472616e
+ .long 0x0049424d
+ .long 0x20584c20
+ .long 0x466f7274
+ .long 0x72616e20
+ .long 0x666f7220
+ .long 0x4c696e75
+ .long 0x782c2056
+ .long 0x31342e31
+ .long 0x20283537
+ .long 0x36352d4a
+ .long 0x30352c20
+ .long 0x35373235
+ .long 0x2d433735
+ .long 0x29205665
+ .long 0x7273696f
+ .long 0x6e203134
+ .long 0x2e30312e
+ .long 0x30303030
+ .long 0x2e303030
+ .long 0x30000249
+ .long 0x4e544547
+ .long 0x45520004
+ .long 0x05030005
+ .long 0x02524541
+ .long 0x4c000404
+ .long 0x04050000
+ .long 0x0000c706
+ .long 0x6d6f6431
+ .long 0x00070503
+ .long __N_mod1
+ .long 0x79000100
+ .long 0x01000000
+ .long 0xd0070503
+ .long __N__mod1
+ .long 0x7a000100
+ .long 0x01000000
+ .long 0xc7087375
+ .byte 0x62
+ .byte 0x31
+ .byte 0x00
+ .long .LC.text32
+ .long .LC.text168
+ .long 0x01180101
+ .byte 0x6f
+ .byte 0x00
+ .byte 0x00
+.LC.debug_info273:
+ .long 0x00000123
+ .byte 0x00
+ .byte 0x02
+ .long .LC.debug_abbrev97
+ .long 0x0401786c
+ .long 0x662d7661
+ .long 0x72696162
+ .long 0x6c652e66
+ .byte 0x00
+ .long .LC.debug_line98
+ .long .LC.text256
+ .long .LC.text324
+ .long 0x082f726f
+ .long 0x6f742f73
+ .long 0x65726769
+ .long 0x6f646a2f
+ .long 0x6764622d
+ .long 0x372e302e
+ .long 0x312d3432
+ .long 0x2e656c35
+ .long 0x2f676462
+ .long 0x2d372e30
+ .long 0x2e312f67
+ .long 0x64622f74
+ .long 0x65737473
+ .long 0x75697465
+ .long 0x2f676462
+ .long 0x2e666f72
+ .long 0x7472616e
+ .long 0x0049424d
+ .long 0x20584c20
+ .long 0x466f7274
+ .long 0x72616e20
+ .long 0x666f7220
+ .long 0x4c696e75
+ .long 0x782c2056
+ .long 0x31342e31
+ .long 0x20283537
+ .long 0x36352d4a
+ .long 0x30352c20
+ .long 0x35373235
+ .long 0x2d433735
+ .long 0x29205665
+ .long 0x7273696f
+ .long 0x6e203134
+ .long 0x2e30312e
+ .long 0x30303030
+ .long 0x2e303030
+ .long 0x30000249
+ .long 0x4e544547
+ .long 0x45520004
+ .long 0x05030005
+ .long 0x02524541
+ .long 0x4c000404
+ .long 0x04000000
+ .long 0xb9050000
+ .long 0x0000c706
+ .long 0x000000f4
+ .long 0x26264e26
+ .long 0x6d6f6431
+ .long 0x00080779
+ .long 0x00022300
+ .long 0x000000d4
+ .long 0x00060000
+ .long 0x010f2626
+ .long 0x4e26266d
+ .long 0x6f643100
+ .long 0x04077a00
+ .long 0x02230000
+ .long 0x0000c700
+ .long 0x085f6d61
+ .byte 0x69
+ .byte 0x6e
+ .byte 0x00
+ .long .LC.text256
+ .long .LC.text324
+ .long 0x0201016f
+ .long 0x000000b9
+ .byte 0x00
+
+ .section ".debug_abbrev"
+ .align 0
+.LC.debug_abbrev:
+ .long 0x01110103
+ .long 0x08100611
+ .long 0x01120113
+ .long 0x0b1b0825
+ .long 0x08000002
+ .long 0x24000308
+ .long 0x0b0b3e0b
+ .long 0x00000324
+ .long 0x000b0b3e
+ .long 0x0b000004
+ .long 0x15000000
+ .long 0x050f0033
+ .long 0x0b491300
+ .long 0x00061e01
+ .long 0x03080000
+ .long 0x07340002
+ .long 0x0a03083a
+ .long 0x0b3b0b3f
+ .long 0x0c491300
+ .long 0x00082e00
+ .long 0x03081101
+ .long 0x12013a0b
+ .long 0x3b0b3f0c
+ .long 0x400a0000
+ .byte 0x00
+.LC.debug_abbrev97:
+ .long 0x01110103
+ .long 0x08100611
+ .long 0x01120113
+ .long 0x0b1b0825
+ .long 0x08000002
+ .long 0x24000308
+ .long 0x0b0b3e0b
+ .long 0x00000324
+ .long 0x000b0b3e
+ .long 0x0b000004
+ .long 0x15004913
+ .long 0x0000050f
+ .long 0x00330b49
+ .long 0x13000006
+ .long 0x13010113
+ .long 0x03080b0b
+ .long 0x0000070d
+ .long 0x00030838
+ .long 0x0a491300
+ .long 0x00082e00
+ .long 0x03081101
+ .long 0x1201360b
+ .long 0x3f0c400a
+ .long 0x49130000
+ .byte 0x00
+
+ .section ".debug_line"
+ .align 0
+.LC.debug_line:
+ .long 0x0000005e
+ .long 0x00020000
+ .long 0x00220101
+ .long 0x9cdc0a00
+ .long 0x01010101
+ .long 0x00000001
+ .long 0x00786c66
+ .long 0x2d766172
+ .long 0x6961626c
+ .long 0x652e6600
+ .long 0x00000000
+ .long 0x04010005
+ .byte 0x02
+ .long .LC.text
+ .long 0x03130109
+ .long 0x000c0309
+ .long 0x01090014
+ .long 0x037b0109
+ .long 0x00180301
+ .long 0x01090038
+ .long 0x03010109
+ .long 0x000c0301
+ .long 0x01090014
+ .long 0x03010109
+ .long 0x00180001
+ .byte 0x01
+.LC.debug_line98:
+ .long 0x00000046
+ .long 0x00020000
+ .long 0x00220101
+ .long 0x9cdc0a00
+ .long 0x01010101
+ .long 0x00000001
+ .long 0x00786c66
+ .long 0x2d766172
+ .long 0x6961626c
+ .long 0x652e6600
+ .long 0x00000000
+ .long 0x04010005
+ .byte 0x02
+ .long .LC.text256
+ .long 0x031f0109
+ .long 0x00140300
+ .long 0x01090004
+ .long 0x03010109
+ .long 0x002c0001
+ .byte 0x01
+
+ .section ".debug_frame"
+ .align 0
+.LC.debug_frame:
+ .long 0x0000000c
+ .long 0xffffffff
+ .long 0x0100047c
+ .long 0x410c0100
+ .long 0x0000001c
+ .long .LC.debug_frame
+ .long .LC.text
+ .long 0x00000020
+ .long 0x410e2041
+ .long 0x9f01410d
+ .long 0x1f410a42
+ .long 0xdf420b00
+ .long 0x00000020
+ .long .LC.debug_frame
+ .long .LC.text32
+ .long 0x00000088
+ .long 0x410e2041
+ .long 0x9f01419e
+ .long 0x02410d1f
+ .long 0x590a42de
+ .long 0x41df420b
+.LC.debug_frame84:
+ .long 0x0000000c
+ .long 0xffffffff
+ .long 0x0100047c
+ .long 0x410c0100
+ .long 0x00000020
+ .long .LC.debug_frame84
+ .long .LC.text256
+ .long 0x00000044
+ .long 0x420e2041
+ .long 0x9f014111
+ .long 0x417f410d
+ .long 0x1f460a42
+ .long 0xdf440b00
+
+ .section ".debug_pubtypes"
+ .align 0
+.LC.debug_pubtypes:
+ .long 0x00000023
+ .byte 0x00
+ .byte 0x02
+ .long .LC.debug_info
+ .long 0x00000111
+ .long 0x000000b9
+ .long 0x494e5445
+ .long 0x47455200
+ .long 0x000000c7
+ .long 0x5245414c
+ .long 0x00000000
+ .long 0x00000000
+ .byte 0x3e
+ .byte 0x00
+ .byte 0x02
+ .long .LC.debug_info273
+ .long 0x00000127
+ .long 0x000000b9
+ .long 0x494e5445
+ .long 0x47455200
+ .long 0x000000c7
+ .long 0x5245414c
+ .long 0x00000000
+ .long 0xda26264e
+ .long 0x266d6f64
+ .long 0x31000000
+ .long 0x00f42626
+ .long 0x4e26266d
+ .long 0x6f643100
+ .long 0x00000000
+
+ .comm __N__mod1,4,16
Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.exp
===================================================================
--- /dev/null
+++ gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.exp
@@ -0,0 +1,37 @@
+# Copyright 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This test can only be run on PPC64 machines.
+
+if { ![istarget powerpc64-*] || ![is_ilp32_target] } {
+ return -1
+}
+
+set testfile "xlf-variable"
+set srcfile ${testfile}.S
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+if { ![runto_main] } {
+ return -1
+}
+
+gdb_test "step" ".*y => z.*" "y => z"
+gdb_test "step" ".*y = 3\.0.*" "y = 3.0"
+gdb_test "step" ".*nullify \\(y\\).*" "nullify (y)"
+gdb_test "print z" "= 3" "z = 3"
+gdb_test "ptype z" "= REAL" "z is REAL"
Index: gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.f
===================================================================
--- /dev/null
+++ gdb-7.4.50.20120603/gdb/testsuite/gdb.fortran/xlf-variable.f
@@ -0,0 +1,33 @@
+c Copyright 2012 Free Software Foundation, Inc.
+c
+c This program is free software; you can redistribute it and/or modify
+c it under the terms of the GNU General Public License as published by
+c the Free Software Foundation; either version 3 of the License, or
+c (at your option) any later version.
+c
+c This program is distributed in the hope that it will be useful,
+c but WITHOUT ANY WARRANTY; without even the implied warranty of
+c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+c GNU General Public License for more details.
+c
+c You should have received a copy of the GNU General Public License
+c along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+c This file is the Fortran source file for xlf-variable.f.
+c It was used to generate the assembly output called xlf-variable.S,
+c which was generated using IBM's XLF compiler.
+
+ module mod1
+ real, pointer :: y
+ real, target :: z
+ contains
+ subroutine sub1
+ y => z
+ y = 3.0
+ nullify (y)
+ end subroutine
+ end module
+
+ use mod1
+ call sub1
+ end

View File

@ -1,293 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00065.html
Subject: [commit 1/2] testsuite: code_elim.exp: unique names
Hi,
this is just removal of non-unique test names and one small simplification.
Checked in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2012-06/msg00011.html
### src/gdb/testsuite/ChangeLog 2012/05/28 20:37:29 1.3209
### src/gdb/testsuite/ChangeLog 2012/06/03 17:06:04 1.3210
## -1,3 +1,16 @@
+2012-06-03 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.base/code_elim.exp (add-symbol-file ${testfile1} 0x100000):
+ Simplify it to ...
+ (symbol-file ${testfile1}): ... here.
+ (test eliminated var my_global_symbol)
+ (test eliminated var my_static_symbol)
+ (test eliminated var my_global_func, get address of main): Wrap them to
+ 'single psymtabs' and 'single symtabs'
+ (get address of my_global_symbol, get address of my_static_symbol)
+ (get address of my_global_func, get address of main): Wrap them to
+ 'order1' and 'order2'.
+
2012-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.server/solib-list-lib.c: New file.
--- src/gdb/testsuite/gdb.base/code_elim.exp 2012/01/16 16:21:44 1.4
+++ src/gdb/testsuite/gdb.base/code_elim.exp 2012/06/03 17:06:04 1.5
@@ -95,16 +95,16 @@
gdb_exit
gdb_start
-gdb_test "add-symbol-file ${binfile1} 0x100000" \
+gdb_test "symbol-file ${binfile1}" \
"Reading symbols from .*${testfile1}\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
- "add-symbol-file ${testfile1} 0x100000" \
- "add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
- "y"
+ "symbol-file ${testfile1}"
-test_eliminated_var my_global_symbol
-test_eliminated_var my_static_symbol
-test_eliminated_var my_global_func
-not_null_var_address main
+with_test_prefix "single psymtabs" {
+ test_eliminated_var my_global_symbol
+ test_eliminated_var my_static_symbol
+ test_eliminated_var my_global_func
+ not_null_var_address main
+}
# Same thing for symtabs
@@ -115,10 +115,12 @@
gdb_start
set GDBFLAGS $saved_gdbflags
-test_eliminated_var my_global_symbol
-test_eliminated_var my_static_symbol
-test_eliminated_var my_global_func
-not_null_var_address main
+with_test_prefix "single symtabs" {
+ test_eliminated_var my_global_symbol
+ test_eliminated_var my_static_symbol
+ test_eliminated_var my_global_func
+ not_null_var_address main
+}
# binfile2 contains the symbols that have been eliminated in binfile1. Check
# the eliminated symbols does not hide these valid ones.
@@ -138,10 +140,12 @@
"add symbol table from file \".*${testfile2}\" at\[ \t\r\n\]+\.text_addr = 0x200000\[\r\n\]+\\(y or n\\) " \
"y"
-not_null_var_address my_global_symbol
-not_null_var_address my_static_symbol
-not_null_var_address my_global_func
-not_null_var_address main
+with_test_prefix "order1" {
+ not_null_var_address my_global_symbol
+ not_null_var_address my_static_symbol
+ not_null_var_address my_global_func
+ not_null_var_address main
+}
# Same thing, but loading binfile2 before binfile1.
@@ -160,9 +164,9 @@
"add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
"y"
-not_null_var_address my_global_symbol
-not_null_var_address my_static_symbol
-not_null_var_address my_global_func
-not_null_var_address main
-
-
+with_test_prefix "order2" {
+ not_null_var_address my_global_symbol
+ not_null_var_address my_static_symbol
+ not_null_var_address my_global_func
+ not_null_var_address main
+}
http://sourceware.org/ml/gdb-patches/2012-06/msg00066.html
Subject: [commit 2/2] testsuite: code_elim.exp: Fix false FAIL
Hi,
with Fedora 18 x86_64 (Rawhide) there is a false FAIl since:
2167931cf70f91206efb8b01e848a55d82a347ce is the first bad commit
Author: Tom Tromey <tromey@redhat.com>
Date: Fri May 18 15:31:39 2012 +0000
http://sourceware.org/bugzilla/show_bug.cgi?id=13907
print &my_global_symbol
-$1 = (int *) 0x804a004
-(gdb) PASS: gdb.base/code_elim.exp: get address of my_global_symbol
+$1 = (int *) 0x804a004 <completed.5732>
+(gdb) FAIL: gdb.base/code_elim.exp: get address of my_global_symbol
Nothing really changed, just GDB now prints <completed.5732> and the testcase
expects either none or <my_global_symbol> suffix.
This is because the two symbol files (their sections .data/.bss) have
overlapped so GDB chooses randomly which symbol to display. And since
Fedora 18 GCC puts there that "completed.5732" symbol.
This may be because add-symbol-file FILE ADDR relocates to ADDR on the .text
section and leaves other sections at their original place, which is IMO a bit
unexpected; it is a FAQ people expect more ADDR to be relocation displacement
(and not relative to .text and not limited to .text). But this is really
outside of the scope of this testcase false FAIL.
Checked in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2012-06/msg00012.html
### src/gdb/testsuite/ChangeLog 2012/06/03 17:06:04 1.3210
### src/gdb/testsuite/ChangeLog 2012/06/03 17:10:28 1.3211
## -11,6 +11,16 @@
(get address of my_global_func, get address of main): Wrap them to
'order1' and 'order2'.
+ * gdb.base/code_elim.exp
+ (add-symbol-file ${testfile1} 0x100000)
+ (add-symbol-file ${testfile2} 0x200000): Wrap them to 'order1' and
+ 'order2'.
+ (order1: add-symbol-file ${testfile1} 0x100000)
+ (order1: add-symbol-file ${testfile2} 0x200000)
+ (order2: add-symbol-file ${testfile2} 0x200000)
+ (order2: add-symbol-file ${testfile1} 0x100000): Add -s .data and -s
+ .bss as appropriate.
+
2012-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.server/solib-list-lib.c: New file.
--- src/gdb/testsuite/gdb.base/code_elim.exp 2012/06/03 17:06:04 1.5
+++ src/gdb/testsuite/gdb.base/code_elim.exp 2012/06/03 17:10:28 1.6
@@ -128,19 +128,19 @@
gdb_exit
gdb_start
-gdb_test "add-symbol-file ${binfile1} 0x100000" \
- "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
- "add-symbol-file ${testfile1} 0x100000" \
- "add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
- "y"
-
-gdb_test "add-symbol-file ${binfile2} 0x200000" \
- "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
- "add-symbol-file ${testfile2} 0x200000" \
- "add symbol table from file \".*${testfile2}\" at\[ \t\r\n\]+\.text_addr = 0x200000\[\r\n\]+\\(y or n\\) " \
- "y"
-
with_test_prefix "order1" {
+ gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
+ "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile1} 0x100000" \
+ "add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
+ "y"
+
+ gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
+ "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile2} 0x200000" \
+ "add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
+ "y"
+
not_null_var_address my_global_symbol
not_null_var_address my_static_symbol
not_null_var_address my_global_func
@@ -152,19 +152,19 @@
gdb_exit
gdb_start
-gdb_test "add-symbol-file ${binfile2} 0x200000" \
- "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
- "add-symbol-file ${testfile2} 0x200000" \
- "add symbol table from file \".*${testfile2}\" at\[ \t\r\n\]+\.text_addr = 0x200000\[\r\n\]+\\(y or n\\) " \
- "y"
-
-gdb_test "add-symbol-file ${binfile1} 0x100000" \
- "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
- "add-symbol-file ${testfile1} 0x100000" \
- "add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
- "y"
-
with_test_prefix "order2" {
+ gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
+ "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile2} 0x200000" \
+ "add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
+ "y"
+
+ gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
+ "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile1} 0x100000" \
+ "add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
+ "y"
+
not_null_var_address my_global_symbol
not_null_var_address my_static_symbol
not_null_var_address my_global_func
http://sourceware.org/ml/gdb-cvs/2012-06/msg00047.html
### src/gdb/ChangeLog 2012/06/06 06:04:42 1.14330
### src/gdb/ChangeLog 2012/06/06 16:57:34 1.14331
## -1,3 +1,8 @@
+2012-06-06 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * configure.ac: Move development=true below AC_INIT.
+ * configure: Regenerate.
+
2012-06-05 Stan Shebs <stan@codesourcery.com>
* mi/mi-interp.c (mi_interpreter_init): Set raw_stdout from
--- src/gdb/configure 2012/06/01 18:20:18 1.366
+++ src/gdb/configure 2012/06/06 16:57:36 1.367
@@ -2683,6 +2683,11 @@
+# Provide more thorough testing by -lmcheck.
+# Set it to 'true' for development snapshots, 'false' for releases or
+# pre-releases.
+development=true
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--- src/gdb/configure.ac 2012/06/01 18:20:18 1.177
+++ src/gdb/configure.ac 2012/06/06 16:57:38 1.178
@@ -18,16 +18,16 @@
dnl Process this file with autoconf to produce a configure script.
-dnl Provide more thorough testing by -lmcheck.
-dnl Set it to 'true' for development snapshots, 'false' for releases or
-dnl pre-releases.
-development=true
-
AC_PREREQ(2.59)dnl
AC_INIT(main.c)
AC_CONFIG_HEADER(config.h:config.in)
AM_MAINTAINER_MODE
+# Provide more thorough testing by -lmcheck.
+# Set it to 'true' for development snapshots, 'false' for releases or
+# pre-releases.
+development=true
+
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
ACX_LARGEFILE

View File

@ -1,119 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-03/msg00357.html
Subject: [patch 1/2] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #5
Hi,
posted as a new thread.
As described in
cancel: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #4 [Re: [revert] Regression on PowerPC]
http://sourceware.org/ml/gdb-patches/2012-03/msg00322.html
just ON_STACK had some regressions.
The expectations in that mail were wrong (at least that cleanup/fix is not
required for gdb.cp/gdb2495.exp).
The problem is that the inferior call return pad breakpoint instruction is
never removed even after inferior call finishes. It is even still visible in
"maintenance info breakpoints". This does not matter much for AT_ENTRY_POINT
but for ON_STACK it just corrupts stack.
No regressions on
{x86_64,x86_64-m32,i686}-fedora(15-rawhide)/rhel(5-6)-linux-gnu and for
gdbsever non-extended mode.
Thanks,
Jan
gdb/
2012-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
Remove momentary breakpoints for completed inferior calls.
* dummy-frame.c: Include gdbthread.h.
(pop_dummy_frame_bpt): New function.
(pop_dummy_frame): Initialie DUMMY earlier. Call pop_dummy_frame_bpt.
gdb/testsuite/
2012-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
Remove momentary breakpoints for completed inferior calls.
* gdb.base/call-signal-resume.exp (maintenance print dummy-frames)
(maintenance info breakpoints): New tests.
Index: gdb-7.4.50.20120602/gdb/dummy-frame.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/dummy-frame.c 2012-01-04 09:17:00.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/dummy-frame.c 2012-06-02 20:42:40.907720327 +0200
@@ -29,6 +29,7 @@
#include "gdbcmd.h"
#include "gdb_string.h"
#include "observer.h"
+#include "gdbthread.h"
/* Dummy frame. This saves the processor state just prior to setting
up the inferior function call. Older targets save the registers
@@ -108,19 +109,36 @@ remove_dummy_frame (struct dummy_frame *
xfree (dummy);
}
+/* Delete any breakpoint B which is a momentary breakpoint for return from
+ inferior call matching DUMMY_VOIDP. */
+
+static int
+pop_dummy_frame_bpt (struct breakpoint *b, void *dummy_voidp)
+{
+ struct dummy_frame *dummy = dummy_voidp;
+
+ if (b->disposition == disp_del && frame_id_eq (b->frame_id, dummy->id)
+ && b->thread == pid_to_thread_id (inferior_ptid))
+ delete_breakpoint (b);
+
+ /* Continue the traversal. */
+ return 0;
+}
+
/* Pop *DUMMY_PTR, restoring program state to that before the
frame was created. */
static void
pop_dummy_frame (struct dummy_frame **dummy_ptr)
{
- struct dummy_frame *dummy;
+ struct dummy_frame *dummy = *dummy_ptr;
+
+ restore_infcall_suspend_state (dummy->caller_state);
- restore_infcall_suspend_state ((*dummy_ptr)->caller_state);
+ iterate_over_breakpoints (pop_dummy_frame_bpt, dummy);
/* restore_infcall_control_state frees inf_state,
all that remains is to pop *dummy_ptr. */
- dummy = *dummy_ptr;
*dummy_ptr = dummy->next;
xfree (dummy);
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/call-signal-resume.exp
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/gdb.base/call-signal-resume.exp 2012-01-23 18:11:50.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/call-signal-resume.exp 2012-06-02 20:43:10.523709052 +0200
@@ -101,6 +101,18 @@ gdb_test "frame $frame_number" ".*"
gdb_test_no_output "set confirm off"
gdb_test "return" ""
+# Verify there are no remains of the dummy frame.
+gdb_test_no_output "maintenance print dummy-frames"
+set test "maintenance info breakpoints"
+gdb_test_multiple $test $test {
+ -re "call dummy.*\r\n$gdb_prompt $" {
+ fail $test
+ }
+ -re "\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
# Resume execution, the program should continue without any signal.
gdb_test "break stop_two" "Breakpoint \[0-9\]* at .*"

View File

@ -1,166 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-03/msg00358.html
Subject: [patch 2/2] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #5
Hi,
here is the ON_STACK code again, with fixed alignment for i386 SSE.
It is generalized for all OSes on i386/amd64. I can move it to
{i386,amd64)-linux-tdep.c but I find this code much more lightweight than
i386_push_dummy_call which is already present in i386-tdep.
No regressions on
{x86_64,x86_64-m32,i686}-fedora(15-rawhide)/rhel(5-6)-linux-gnu and for
gdbsever non-extended mode.
For x86_64-fedora17-linux-gnu it fixes:
-FAIL: gdb.cp/gdb2495.exp: Call a function that raises an exception without a handler.
-FAIL: gdb.cp/gdb2495.exp: bt after returning from a popped frame
+PASS: gdb.cp/gdb2495.exp: Call a function that raises an exception without a handler.
+PASS: gdb.cp/gdb2495.exp: bt after returning from a popped frame
Thanks,
Jan
gdb/
2012-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* amd64-dicos-tdep.c (amd64_dicos_push_dummy_code): Remove.
(amd64_dicos_init_abi): Remove its installment.
* dicos-tdep.c (dicos_init_abi): Remove the
set_gdbarch_call_dummy_location call. Update the comment here.
* i386-dicos-tdep.c (i386_dicos_push_dummy_code): Remove.
(i386_dicos_init_abi): Remove its installment.
* i386-tdep.c (i386_push_dummy_code): New function.
(i386_gdbarch_init): Call set_gdbarch_call_dummy_location, install
i386_push_dummy_code.
--- a/gdb/amd64-dicos-tdep.c
+++ b/gdb/amd64-dicos-tdep.c
@@ -23,24 +23,6 @@
#include "amd64-tdep.h"
#include "dicos-tdep.h"
-static CORE_ADDR
-amd64_dicos_push_dummy_code (struct gdbarch *gdbarch,
- CORE_ADDR sp, CORE_ADDR funaddr,
- struct value **args, int nargs,
- struct type *value_type,
- CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
- struct regcache *regcache)
-{
- int bplen;
- CORE_ADDR bppc = sp;
-
- gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
- *bp_addr = sp - bplen;
- *real_pc = funaddr;
-
- return *bp_addr;
-}
-
static void
amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -49,8 +31,6 @@ amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_init_abi (info, gdbarch);
dicos_init_abi (gdbarch);
-
- set_gdbarch_push_dummy_code (gdbarch, amd64_dicos_push_dummy_code);
}
static enum gdb_osabi
--- a/gdb/dicos-tdep.c
+++ b/gdb/dicos-tdep.c
@@ -43,8 +43,8 @@ dicos_init_abi (struct gdbarch *gdbarch)
/* There's no (standard definition of) entry point or a guaranteed
text location with a symbol where to place the call dummy, so we
- put it on the stack. */
- set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ need it on the stack. Rely on i386_gdbarch_init used also for
+ amd64 to set up ON_STACK inferior calls. */
/* DICOS rewinds the PC itself. */
set_gdbarch_decr_pc_after_break (gdbarch, 0);
--- a/gdb/i386-dicos-tdep.c
+++ b/gdb/i386-dicos-tdep.c
@@ -22,32 +22,12 @@
#include "gdb_string.h"
#include "dicos-tdep.h"
-static CORE_ADDR
-i386_dicos_push_dummy_code (struct gdbarch *gdbarch,
- CORE_ADDR sp, CORE_ADDR funaddr,
- struct value **args, int nargs,
- struct type *value_type,
- CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
- struct regcache *regcache)
-{
- int bplen;
- CORE_ADDR bppc = sp;
-
- gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
- *bp_addr = sp - bplen;
- *real_pc = funaddr;
-
- return *bp_addr;
-}
-
static void
i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
dicos_init_abi (gdbarch);
-
- set_gdbarch_push_dummy_code (gdbarch, i386_dicos_push_dummy_code);
}
static enum gdb_osabi
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2326,6 +2326,30 @@ i386_16_byte_align_p (struct type *type)
return 0;
}
+/* Implementation for set_gdbarch_push_dummy_code. */
+
+static CORE_ADDR
+i386_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr,
+ struct value **args, int nargs, struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
+ struct regcache *regcache)
+{
+ int bplen;
+ CORE_ADDR bppc = sp;
+
+ gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
+ sp -= bplen;
+
+ /* amd64_push_dummy_call does alignment on its own but i386_push_dummy_call
+ does not. ABI requires stack alignment for executables using SSE. */
+ if (gdbarch_frame_align_p (gdbarch))
+ sp = gdbarch_frame_align (gdbarch, sp);
+
+ *bp_addr = sp;
+ *real_pc = funaddr;
+ return sp;
+}
+
static CORE_ADDR
i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
@@ -7372,6 +7396,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target);
/* Call dummy code. */
+ set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ set_gdbarch_push_dummy_code (gdbarch, i386_push_dummy_code);
set_gdbarch_push_dummy_call (gdbarch, i386_push_dummy_call);
set_gdbarch_frame_align (gdbarch, i386_frame_align);

View File

@ -1,3 +1,38 @@
-------------------------------------------------------------------
Mon Dec 3 14:29:15 UTC 2012 - matz@suse.com
- Merge from gdb-7.5.1-30.fc18.src.rpm.
7.5.1 gives:
* An "Attempt to dereference a generic pointer" errors (-var-create).
* Backtrace problems on x32 (PR backtrace/14646).
* next/step/finish problems on x32 (PR gdb/14647).
* A "malformed linespec error: unexpected keyword, [...]" error
(PR breakpoints/14643).
* GDB crash while stepping through powerpc (32bits) code.
* A failed assertion in linux_ptrace_test_ret_to_nx.
* A "!frame_id_inlined_p (frame_id)" failed assertion.
* A "No more reverse-execution history." error during reverse
"next" execution (PR 14548).
* Incomplete command descriptions in "apropos" output.
* PR gdb/14494 (a GDB crash difficult to characterize).
7.5 gives:
* Go language support.
* New targets (x32 ABI, microMIPS, Renesas RL78, HP OpenVMS ia64).
* More Python scripting improvements.
* SDT (Static Defined Tracing) probes support with SystemTap probes.
* GDBserver improvements (stdio connections, target-side evaluation
of breakpoint conditions, remote protocol improvements).
* Other miscellaneous improvements (ability to stop when a shared
library is loaded/unloaded, dynamic printf, etc).
* Reverse debugging on ARM.
-------------------------------------------------------------------
Tue Jun 19 13:58:08 UTC 2012 - rguenther@suse.com
- Do not provide a custom (safe) auto-load dir.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jun 12 13:00:14 UTC 2012 - rguenther@suse.com Tue Jun 12 13:00:14 UTC 2012 - rguenther@suse.com

257
gdb.spec
View File

@ -16,11 +16,10 @@
Summary: A GNU source-level debugger for C, C++, Fortran and other languages Summary: A GNU source-level debugger for C, C++, Fortran and other languages
Name: gdb Name: gdb
# Set version to contents of gdb/version.in. %global snap 20120817
# NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # See timestamp of source gnulib installed into gdb/gnulib/ .
# and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). %global snapgnulib 20120623
%global snap 20120603 Version: 7.5.1
Version: 7.4.50.%{snap}
# The release always contains a leading reserved number, start it at 1. # 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. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
@ -30,12 +29,14 @@ License: GPL-3.0+ and GPL-3.0-with-GCC-exception and LGPL-2.1+ and LGPL-3.0+
Group: Development/Tools/Debuggers Group: Development/Tools/Debuggers
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Do not provide URL for snapshots as the file lasts there only for 2 days. # Do not provide URL for snapshots as the file lasts there only for 2 days.
# ftp://sourceware.org/pub/gdb/snapshots/current/gdb-%{version}.tar.bz2
# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{version}.tar.bz2
# ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2 # ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
Source: gdb-%{version}.tar.bz2 Source: gdb-%{version}.tar.bz2
URL: http://gnu.org/software/gdb/ URL: http://gnu.org/software/gdb/
%if "%{scl}" == "devtoolset-1.1"
Obsoletes: devtoolset-1.0-%{pkg_name}
%endif
# For our convenience # For our convenience
%global gdb_src %{name}-%{version} %global gdb_src %{name}-%{version}
%global gdb_build build-%{_target_platform} %global gdb_build build-%{_target_platform}
@ -227,7 +228,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
# Backported fixups post the source tarball. # Backported fixups post the source tarball.
#Xdrop: Just backports. #Xdrop: Just backports.
Patch232: gdb-upstream.patch #Patch232: gdb-upstream.patch
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
#=fedoratest+ppc #=fedoratest+ppc
@ -365,6 +366,7 @@ Patch360: gdb-6.8-bz457187-largefile-test.patch
Patch381: gdb-simultaneous-step-resume-breakpoint-test.patch Patch381: gdb-simultaneous-step-resume-breakpoint-test.patch
# Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. # Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
# Fix regression of undisplayed missing shared libraries caused by a fix for.
#=push+work: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> #=push+work: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*>
Patch382: gdb-core-open-vdso-warning.patch Patch382: gdb-core-open-vdso-warning.patch
@ -431,12 +433,6 @@ Patch496: gdb-bz568248-oom-is-error.patch
#=push: There is different patch on gdb-patches, waiting now for resolution in kernel. #=push: There is different patch on gdb-patches, waiting now for resolution in kernel.
Patch504: gdb-bz623749-gcore-relro.patch Patch504: gdb-bz623749-gcore-relro.patch
# Fix lost siginfo_t in linux-nat (BZ 592031).
#=push
Patch510: gdb-bz592031-siginfo-lost-4of5.patch
#=push
Patch511: gdb-bz592031-siginfo-lost-5of5.patch
# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). # Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
#=fedoratest #=fedoratest
Patch526: gdb-bz634108-solib_address.patch Patch526: gdb-bz634108-solib_address.patch
@ -469,8 +465,15 @@ Patch579: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
# Fix dlopen of libpthread.so, patched glibc required (Gary Benson, BZ 669432). # Fix dlopen of libpthread.so, patched glibc required (Gary Benson, BZ 669432).
#=push #=push
Patch618: gdb-dlopen-stap-probe.patch Patch618: gdb-dlopen-stap-probe-1of7.patch
Patch717: gdb-dlopen-stap-probe-2of7.patch
Patch718: gdb-dlopen-stap-probe-3of7.patch
Patch719: gdb-dlopen-stap-probe-4of7.patch
Patch720: gdb-dlopen-stap-probe-5of7.patch
Patch721: gdb-dlopen-stap-probe-6of7.patch
Patch722: gdb-dlopen-stap-probe-7of7.patch
Patch619: gdb-dlopen-stap-probe-test.patch Patch619: gdb-dlopen-stap-probe-test.patch
Patch723: gdb-dlopen-stap-probe-test2.patch
# Work around PR libc/13097 "linux-vdso.so.1" warning message. # Work around PR libc/13097 "linux-vdso.so.1" warning message.
#=push #=push
@ -494,31 +497,60 @@ Patch653: gdb-attach-fail-reasons-5of5.patch
#=fedora #=fedora
Patch657: gdb-attach-fail-reasons-5of5configure.patch Patch657: gdb-attach-fail-reasons-5of5configure.patch
# Fix inferior calls, particularly uncaught thrown exceptions (BZ 799531).
#=push+work
Patch654: gdb-x86-onstack-1of2.patch
Patch658: gdb-x86-onstack-2of2.patch
# Workaround crashes from stale frame_info pointer (BZ 804256). # Workaround crashes from stale frame_info pointer (BZ 804256).
#=push+work #=fedora
Patch661: gdb-stale-frame_info.patch Patch661: gdb-stale-frame_info.patch
# Workaround PR libc/14166 for inferior calls of strstr. # Workaround PR libc/14166 for inferior calls of strstr.
#=push+work: But push it to glibc. #=push+work: But push it to glibc.
Patch690: gdb-glibc-strstr-workaround.patch Patch690: gdb-glibc-strstr-workaround.patch
# Fix dejagnu-1.5-4.fc17 compatibility for Go (for BZ 635651). # Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789).
#=fedoratest #=fedoratest
Patch692: gdb-dejagnu-go.patch #+ppc
Patch698: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
# Revert recent breakage of UNIX objfiles order for symbols lookup. # Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343).
Patch693: gdb-objfile-order.patch #=fedoratest
Patch703: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
# Disable -lmcheck in the development builds. # Implement MiniDebugInfo F-18 Feature consumer (Alexander Larsson, BZ 834068).
Patch694: gdb-disable-mcheck.patch #=fedora
Patch716: gdb-minidebuginfo.patch
# Fix assertion on some files as glibc-2.15.90-8.fc18 (Doug Evans). # Fix crash printing classes (BZ 849357, Tom Tromey).
Patch695: gdb-index-assert.patch Patch726: gdb-print-class.patch
# Permit passing pointers as address number even for C++ methods (Keith Seitz).
Patch728: gdb-check-type.patch
# entry values: Fix resolving in inlined frames.
Patch729: gdb-entryval-inlined.patch
# Fix `GDB cannot access struct member whose offset is larger than 256MB'
# (RH BZ 795424).
Patch797: gdb-rhbz795424-bitpos-06of25.patch
Patch798: gdb-rhbz795424-bitpos-07of25.patch
Patch799: gdb-rhbz795424-bitpos-08of25.patch
Patch800: gdb-rhbz795424-bitpos-09of25.patch
Patch801: gdb-rhbz795424-bitpos-10of25.patch
Patch802: gdb-rhbz795424-bitpos-11of25.patch
Patch803: gdb-rhbz795424-bitpos-12of25.patch
Patch804: gdb-rhbz795424-bitpos-13of25.patch
Patch805: gdb-rhbz795424-bitpos-14of25.patch
Patch806: gdb-rhbz795424-bitpos-15of25.patch
Patch807: gdb-rhbz795424-bitpos-16of25.patch
Patch808: gdb-rhbz795424-bitpos-17of25.patch
Patch809: gdb-rhbz795424-bitpos-18of25.patch
Patch810: gdb-rhbz795424-bitpos-19of25.patch
Patch811: gdb-rhbz795424-bitpos-20of25.patch
Patch812: gdb-rhbz795424-bitpos-21of25.patch
Patch813: gdb-rhbz795424-bitpos-22of25.patch
Patch814: gdb-rhbz795424-bitpos-23of25.patch
Patch815: gdb-rhbz795424-bitpos-24of25.patch
Patch816: gdb-rhbz795424-bitpos-25of25.patch
Patch817: gdb-rhbz795424-bitpos-25of25-test.patch
Patch818: gdb-rhbz795424-bitpos-lazyvalue.patch
# Upstream patch to fix gcc -Werror # Upstream patch to fix gcc -Werror
Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch
@ -575,6 +607,9 @@ BuildRequires: glibc-devel-32bit
%if 0%{suse_version} > 1120 %if 0%{suse_version} > 1120
BuildRequires: gcc-c++-32bit BuildRequires: gcc-c++-32bit
%endif %endif
%if 0%{!?rhel:1} || 0%{?rhel} > 6
BuildRequires: xz
%endif
%endif # 0%{?_with_testsuite:1} %endif # 0%{?_with_testsuite:1}
@ -609,6 +644,10 @@ License: GFDL-1.3
Group: Documentation/Other Group: Documentation/Other
PreReq: %{install_info_prereq} PreReq: %{install_info_prereq}
%if "%{scl}" == "devtoolset-1.1"
Obsoletes: devtoolset-1.0-%{pkg_name}-doc
%endif
%description doc %description doc
GDB, the GNU debugger, allows you to debug programs written in C, C++, GDB, the GNU debugger, allows you to debug programs written in C, C++,
Java, and other languages, by executing them in a controlled fashion Java, and other languages, by executing them in a controlled fashion
@ -627,14 +666,18 @@ tar xjf %{SOURCE5}
# Files have `# <number> <file>' statements breaking VPATH / find-debuginfo.sh . # Files have `# <number> <file>' statements breaking VPATH / find-debuginfo.sh .
rm -f gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c rm -f gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c
rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c gdb/go-exp.c
# *.info* is needlessly split in the distro tar; also it would not get used as
# we build in %{gdb_build}, just to be sure.
find -name "*.info*"|xargs rm -f
# Apply patches defined above. # Apply patches defined above.
# Match the Fedora's version info. # Match the Fedora's version info.
%patch2 -p1 %patch2 -p1
%patch232 -p1 #patch232 -p1
%patch349 -p1 %patch349 -p1
%patch1 -p1 %patch1 -p1
%patch3 -p1 %patch3 -p1
@ -723,28 +766,55 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch491 -p1 %patch491 -p1
%patch496 -p1 %patch496 -p1
%patch504 -p1 %patch504 -p1
%patch510 -p1
%patch511 -p1
%patch526 -p1 %patch526 -p1
%patch542 -p1 %patch542 -p1
%patch547 -p1 %patch547 -p1
%patch548 -p1 %patch548 -p1
%patch579 -p1 %patch579 -p1
%patch618 -p1 %patch618 -p1
%patch717 -p1
%patch718 -p1
%patch719 -p1
%patch720 -p1
%patch721 -p1
%patch722 -p1
%patch723 -p1
%patch619 -p1 %patch619 -p1
%patch627 -p1 %patch627 -p1
%patch634 -p1 %patch634 -p1
%patch643 -p1 %patch643 -p1
%patch653 -p1 %patch653 -p1
%patch657 -p1 %patch657 -p1
%patch654 -p1
%patch658 -p1
%patch661 -p1 %patch661 -p1
%patch690 -p1 %patch690 -p1
%patch692 -p1 %patch698 -p1
%patch693 -p1 %patch703 -p1
%patch694 -p1 %patch716 -p1
%patch695 -p1 %patch726 -p1
%patch728 -p1
%patch729 -p1
%patch797 -p1
%patch798 -p1
%patch799 -p1
%patch800 -p1
%patch801 -p1
%patch802 -p1
%patch803 -p1
%patch804 -p1
%patch805 -p1
%patch806 -p1
%patch807 -p1
%patch808 -p1
%patch809 -p1
%patch810 -p1
%patch811 -p1
%patch812 -p1
%patch813 -p1
%patch814 -p1
%patch815 -p1
%patch816 -p1
%patch817 -p1
%patch818 -p1
%patch1002 -p1 %patch1002 -p1
%patch1003 -p1 %patch1003 -p1
@ -767,6 +837,7 @@ rm -f gdb/doc/*.info-*
%build %build
rm -rf %{buildroot}
# Identify the build directory with the version of gdb as well as the # Identify the build directory with the version of gdb as well as the
# architecture, to allow for mutliple versions to be installed and # architecture, to allow for mutliple versions to be installed and
@ -801,8 +872,12 @@ fi
--enable-gdb-build-warnings=,-Wno-unused \ --enable-gdb-build-warnings=,-Wno-unused \
%ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 sparc sparcv9 sparc64 %ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 sparc sparcv9 sparc64
--disable-werror \ --disable-werror \
%else
%if %{suse_version} < 1110
--disable-werror \
%else %else
--enable-werror \ --enable-werror \
%endif
%endif %endif
--with-separate-debug-dir=/usr/lib/debug \ --with-separate-debug-dir=/usr/lib/debug \
--disable-sim \ --disable-sim \
@ -840,9 +915,6 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \
%else %else
--disable-inprocess-agent \ --disable-inprocess-agent \
%endif %endif
$(: %{_bindir}/mono-gdb.py is workaround for mono BZ 815501. ) \
--with-auto-load-dir='$debugdir:$datadir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}' \
--with-auto-load-safe-path='$debugdir:$datadir/auto-load%{?scl::%{_root_datadir}/gdb/auto-load}:%{_root_bindir}/mono-gdb.py' \
%ifarch sparc sparcv9 %ifarch sparc sparcv9
sparc-%{_vendor}-%{_target_os}%{?_gnu} sparc-%{_vendor}-%{_target_os}%{?_gnu}
%else %else
@ -887,10 +959,10 @@ else
fi fi
# Prepare gdb/config.h first. # Prepare gdb/config.h first.
make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$FPROFILE_CFLAGS" maybe-configure-gdb make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" maybe-configure-gdb
perl -i.relocatable -pe 's/^(D\[".*_RELOCATABLE"\]=" )1(")$/${1}0$2/' gdb/config.status perl -i.relocatable -pe 's/^(D\[".*_RELOCATABLE"\]=" )1(")$/${1}0$2/' gdb/config.status
make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$FPROFILE_CFLAGS" make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS"
! grep '_RELOCATABLE.*1' gdb/config.h ! grep '_RELOCATABLE.*1' gdb/config.h
@ -1208,6 +1280,103 @@ fi
%changelog %changelog
* Sun Dec 2 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.1-30.fc18
- Temporarily disable PDF in gdb-doc before texinfo RH BZ 876710 gets fixed.
* Thu Nov 29 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.1-29.fc18
- Provide Source URL when it is a release.
* Thu Nov 29 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.1-28.fc18
- Fix (unsplit) split info doc.
* Thu Nov 29 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.1-27.fc18
- Rebase to FSF GDB 7.5.1 (7.5 stable branch).
* Fri Nov 9 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.0.20120926-26.fc18
- Fix `GDB cannot access struct member whose offset is larger than 256MB'
(RH BZ 871066).
* Fri Oct 5 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.0.20120926-25.fc18
- entry values: Fix resolving in inlined frames.
* Thu Sep 27 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.0.20120926-24.fc18
- Permit passing pointers as address number even for C++ methods (Keith Seitz).
* Thu Sep 27 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.0.20120926-23.fc18
- Fix crash printing classes (BZ 849357, Tom Tromey).
* Wed Sep 26 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.0.20120926-22.fc18
- Fix .spec 'bundled' Provides for the stable branch rebase.
* Wed Sep 26 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.0.20120926-21.fc18
- [ppc32] Fix stepping over symbol-less code crash regression (BZ 860696).
- Rebase to FSF GDB 7.5.0.20120926 (7.5 stable branch).
- Remove the .spec Source keyword URL as not valid now.
* Fri Sep 14 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5-20.fc18
- [RHEL-6] Disable no longer valid workaround of man pages .gz suffix.
* Sat Aug 18 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5-19.fc18
- Rebase to FSF GDB 7.5.
- Update dlopen to support two variants of glibc (Gary Benson, BZ 669432).
* Fri Aug 17 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.91.20120801-18.fc18
- Drop Source URL for snapshots.
- Separate %%{snapgnulib} from %%{snap}.
- Fix %%{libstdcxxpython} to be %%{name}-prefixed.
- Fix debug info for go-exp.y and go-exp.c.
- Include RHEL-5 compatible %%{buildroot} cleanup.
- Use %%__global_ldflags.
* Wed Aug 1 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.91.20120801-17.fc18
- Rebase to FSF GDB 7.4.91.20120801.
- [dwz] Rebase it from FSF GDB HEAD.
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.4.50.20120714-16.fc18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Jul 16 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120714-15.fc18
- [devtoolset] Include Obsoletes of devtoolset-1.0-* by devtoolset-1.1-*.
* Sun Jul 15 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120714-14.fc18
- Rebase to FSF GDB 7.4.50.20120714.
- Fix entryval feature crash on some .debug files optimized by dwz (BZ 839596).
- Fix another stale frame_info * (PR 11914, like PR 13866).
* Fri Jul 6 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120703-13.fc18
- [RHEL] Disable MiniDebugInfo F-18 feature on RHEL <= 6 (BZ 834068).
* Fri Jul 6 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120703-12.fc18
- Fix .spec metadata for the MiniDebugInfo F-18 feature (BZ 834068).
* Fri Jul 6 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120703-11.fc18
- [archer-tromey-dwz-multifile-rebase] Fix DWARF files reading (Tom Tromey).
* Fri Jul 6 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120703-10.fc18
- Fix build-id-core-loads internal error (BZ 837870).
* Thu Jul 5 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120703-9.fc18
- Implement MiniDebugInfo F-18 Feature consumer (Alexander Larsson, BZ 834068).
* Tue Jul 3 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120703-8.fc18
- Rebase to FSF GDB 7.4.50.20120703.
- [archer-tromey-dwz-multifile-rebase] Merge new branch (Tom Tromey).
- [arm] <--with testsuite>: Disable fpc BuildRequires as it is not yet built.
- Revert function returning pointer fix (PR 9514) regressing Fedora errno patch.
* Thu Jun 21 2012 Sergio Durigan Junior <sergiodj@redhat.com> - 7.4.50.20120603-7.fc18
- Include testcase for BZ 818343.
* Tue Jun 19 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120603-6.fc18
- Fix regression of undisplayed missing shared libraries caused by a fix for:
GNU/Linux core open: Can't read pathname for load map: Input/output error.
* Sun Jun 17 2012 Sergio Durigan Junior <sergiodj@redhat.com> - 7.4.50.20120603-5.fc18
- Include testcase for BZ 823789.
* Thu Jun 14 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120603-4.fc18
- Support DW_OP_GNU_parameter_ref for -O2 -g inferiors (BZ 827375).
* Wed Jun 6 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120603-3.fc18 * Wed Jun 6 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120603-3.fc18
- Disable -lmcheck in the development builds. - Disable -lmcheck in the development builds.
- Fix assertion on some files as glibc-2.15.90-8.fc18 (Doug Evans). - Fix assertion on some files as glibc-2.15.90-8.fc18 (Doug Evans).