Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Matt Rice" <ratmice@gmail.com>
To: gdb-patches@sourceware.org
Subject: [patch] pr1430
Date: Fri, 14 Mar 2008 20:38:00 -0000	[thread overview]
Message-ID: <8ba6bed40803141338t4bf3ce57u70c494fa4004ee60@mail.gmail.com> (raw)

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

             reply	other threads:[~2008-03-14 20:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-14 20:38 Matt Rice [this message]
2008-03-21 15:16 ` Daniel Jacobowitz
2008-03-22  4:43   ` Matt Rice
2008-03-21 15:18 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ba6bed40803141338t4bf3ce57u70c494fa4004ee60@mail.gmail.com \
    --to=ratmice@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox