[patch] pr1430

Matt Rice
2008-03-14T20:38:35Z

[-- 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;