public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-tromey-ambiguous-linespec: fix func_command to ignore sals from other program spaces
@ 2011-10-12 18:29 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2011-10-12 18:29 UTC (permalink / raw)
  To: archer-commits

The branch, archer-tromey-ambiguous-linespec has been updated
       via  a5fb3b491e5da5a235907a9cd4e6034d1e6756f0 (commit)
       via  1517b88b9aa227cf0ecb736df17ffc79e776cd5e (commit)
       via  98190fc8de5916cb92202fed3d1bbe8c70d535cf (commit)
       via  be899bc586bd34ebfc58fb711c058f87ae1dd325 (commit)
       via  7aa6734f748be305d32bcf71162d5b0c47e3635f (commit)
      from  e4e58c918cd9802dd23cab118566d3d05d4bbcb6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit a5fb3b491e5da5a235907a9cd4e6034d1e6756f0
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Oct 12 12:28:47 2011 -0600

    fix func_command to ignore sals from other program spaces

commit 1517b88b9aa227cf0ecb736df17ffc79e776cd5e
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Oct 12 12:28:18 2011 -0600

    fix line_info to use the sal's program space

commit 98190fc8de5916cb92202fed3d1bbe8c70d535cf
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Oct 12 11:28:20 2011 -0600

    remove broken ObjC special-case from parse_breakpoint_sals

commit be899bc586bd34ebfc58fb711c058f87ae1dd325
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Oct 12 11:22:07 2011 -0600

    remove some unused declarations

commit 7aa6734f748be305d32bcf71162d5b0c47e3635f
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Oct 12 09:36:46 2011 -0600

    fix comment

-----------------------------------------------------------------------

Summary of changes:
 gdb/ada-lang.h   |    9 ---------
 gdb/breakpoint.c |   12 +++---------
 gdb/source.c     |    7 ++++++-
 gdb/stack.c      |   16 ++++++++++------
 4 files changed, 19 insertions(+), 25 deletions(-)

First 500 lines of diff:
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index d887ef3..d6404ca 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -238,15 +238,6 @@ extern int user_select_syms (struct ada_symbol_info *, int, int);
 
 extern int get_selections (int *, int, int, int, char *);
 
-extern char *ada_start_decode_line_1 (char *);
-
-extern struct symtabs_and_lines ada_finish_decode_line_1 (char **,
-                                                          struct symtab *,
-                                                          int, char ***);
-
-extern struct symtabs_and_lines ada_sals_for_line (const char*, int,
-						   int, char***, int);
-
 extern int ada_scan_number (const char *, int, LONGEST *, int *);
 
 extern struct type *ada_parent_type (struct type *);
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c545549..73054b1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7453,17 +7453,11 @@ parse_breakpoint_sals (char **address,
       /* Force almost all breakpoints to be in terms of the
          current_source_symtab (which is decode_line_1's default).
          This should produce the results we want almost all of the
-         time while leaving default_breakpoint_* alone.
-
-         ObjC: However, don't match an Objective-C method name which
-         may have a '+' or '-' succeeded by a '[' */
+         time while leaving default_breakpoint_* alone.  */
 	 
       struct symtab_and_line cursal = get_current_source_symtab_and_line ();
 			
-      if (default_breakpoint_valid
-	  && (!cursal.symtab
- 	      || ((strchr ("+-", (*address)[0]) != NULL)
- 		  && ((*address)[1] != '['))))
+      if (default_breakpoint_valid)
 	decode_line_full (address, 1, default_breakpoint_symtab,
 			  default_breakpoint_line, canonical,
 			  NULL, NULL);
@@ -8308,7 +8302,7 @@ break_range_command (char *arg, int from_tty)
   init_linespec_result (&canonical_end);
   arg_start = arg;
 
-  /* We call decode_line_1 directly here instead of using
+  /* We call decode_line_full directly here instead of using
      parse_breakpoint_sals because we need to specify the start location's
      symtab and line as the default symtab and line for the end of the
      range.  This makes it possible to have ranges like "foo.c:27, +14",
diff --git a/gdb/source.c b/gdb/source.c
index d01dff4..f11c900 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1409,6 +1409,7 @@ line_info (char *arg, int from_tty)
   struct symtab_and_line sal;
   CORE_ADDR start_pc, end_pc;
   int i;
+  struct cleanup *cleanups;
 
   init_sal (&sal);		/* initialize to zeroes */
 
@@ -1428,11 +1429,15 @@ line_info (char *arg, int from_tty)
       dont_repeat ();
     }
 
+  cleanups = make_cleanup (xfree, sals.sals);
+  save_current_program_space ();
+
   /* C++  More than one line may have been specified, as when the user
      specifies an overloaded function name.  Print info on them all.  */
   for (i = 0; i < sals.nelts; i++)
     {
       sal = sals.sals[i];
+      set_current_program_space (sal.pspace);
 
       if (sal.symtab == 0)
 	{
@@ -1498,7 +1503,7 @@ line_info (char *arg, int from_tty)
 	printf_filtered (_("Line number %d is out of range for \"%s\".\n"),
 			 sal.line, sal.symtab->filename);
     }
-  xfree (sals.sals);
+  do_cleanups (cleanups);
 }
 \f
 /* Commands to search the source file for a regexp.  */
diff --git a/gdb/stack.c b/gdb/stack.c
index 953d3bd..8a3ea4f 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -2330,20 +2330,25 @@ func_command (char *arg, int from_tty)
   int i;
   int level = 1;
   struct function_bounds *func_bounds = NULL;
+  struct cleanup *cleanups;
 
   if (arg != NULL)
     return;
 
   frame = parse_frame_specification ("0");
   sals = decode_line_spec (arg, 1);
+  cleanups = make_cleanup (xfree, sals.sals);
   func_bounds = (struct function_bounds *) xmalloc (
 			      sizeof (struct function_bounds) * sals.nelts);
+  make_cleanup (xfree, func_bounds);
   for (i = 0; (i < sals.nelts && !found); i++)
     {
-      if (sals.sals[i].pc == 0
-	  || find_pc_partial_function (sals.sals[i].pc, NULL,
-				       &func_bounds[i].low,
-				       &func_bounds[i].high) == 0)
+      if (sals.sals[i].pspace != current_program_space)
+	func_bounds[i].low = func_bounds[i].high = 0;
+      else if (sals.sals[i].pc == 0
+	       || find_pc_partial_function (sals.sals[i].pc, NULL,
+					    &func_bounds[i].low,
+					    &func_bounds[i].high) == 0)
 	{
 	  func_bounds[i].low = func_bounds[i].high = 0;
 	}
@@ -2362,8 +2367,7 @@ func_command (char *arg, int from_tty)
     }
   while (!found && level == 0);
 
-  if (func_bounds)
-    xfree (func_bounds);
+  do_cleanups (cleanups);
 
   if (!found)
     printf_filtered (_("'%s' not within current stack frame.\n"), arg);


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-12 18:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-12 18:29 [SCM] archer-tromey-ambiguous-linespec: fix func_command to ignore sals from other program spaces tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).