Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] pr1430
@ 2008-03-14 20:38 Matt Rice
  2008-03-21 15:16 ` Daniel Jacobowitz
  2008-03-21 15:18 ` Daniel Jacobowitz
  0 siblings, 2 replies; 4+ messages in thread
From: Matt Rice @ 2008-03-14 20:38 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

here is an attempt at fixing pr1430

canonicalizes to file.m:foo or file.m:-[AClass foo]
which is how it knows that foo is a function and it shouldn't attempt
to look up a method
named foo. not sure if this should be done in decode_line_2 based on
language setting?

so if you move files around or anything you have to reset your
breakpoints, but i would take that over an endless loop.

matt

[-- Attachment #2: gdb1430.diff --]
[-- Type: application/octet-stream, Size: 1018 bytes --]

Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.74
diff -u -p -r1.74 linespec.c
--- linespec.c	1 Jan 2008 22:53:11 -0000	1.74
+++ linespec.c	14 Mar 2008 19:55:20 -0000
@@ -1155,7 +1155,19 @@ decode_objc (char **argptr, int funfirst
   if (i1 > 1)
     {
       /* More than one match. The user must choose one or more.  */
-      return decode_line_2 (sym_arr, i2, funfirstline, canonical);
+      values = decode_line_2 (sym_arr, i2, funfirstline, canonical);
+      for (i2 = 0; i2 < values.nelts; i2++)
+	{
+	  char **canonical_arr = *canonical;
+	  char *canonical_name = canonical_arr[i2];
+	  char *filename = values.sals[i2].symtab->filename;
+	  char *file_canonical = xmalloc(strlen(filename) + strlen(canonical_name)
+						 + sizeof(":\0"));
+
+	  sprintf(file_canonical, "%s:%s", filename, canonical_name); 
+	  canonical_arr[i2] = file_canonical;
+	  xfree(canonical_name);
+	}
     }
 
   return values;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-03-22  4:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14 20:38 [patch] pr1430 Matt Rice
2008-03-21 15:16 ` Daniel Jacobowitz
2008-03-22  4:43   ` Matt Rice
2008-03-21 15:18 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox