From: Matt Rice <ratmice@gmail.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: gdb.objc/objcdecode.exp test error..
Date: Fri, 25 Sep 2009 04:03:00 -0000 [thread overview]
Message-ID: <8ba6bed40909242103m3a33cd1ck385bf3240298462c@mail.gmail.com> (raw)
In-Reply-To: <20090924005319.GD5134@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]
On Wed, Sep 23, 2009 at 5:53 PM, Joel Brobecker <brobecker@adacore.com> wrote:
<snip>
> (gdb) break create
>
> can result in numerous breakpoints being set if create just happens
> to be the name any ObjC method. And as it turns out, the NSThread
> class has a method called "main"...
>
> I really think that allowing the above shortcut is a mis-feature
> that we should consider removing. We could possibly think about
> introducing another syntax meaning all "create" methods in all
> classes, if it really is needed by ObjC developers.
here is a patch which does this....
the previous patches i'd sent (category.diff) i keep finding failures
that aren't covered by my tests.
so i'll keep working on that and getting more complete test coverage,
I will have to update the tests that I had previously sent
because they tested the various failure modes of this feature mostly,
if we remove it, there are lots of invalid tests in there that need to
be tweaked.
2009-09-24 Matt Rice <ratmice@gmail.com>
* linespec.c: (is_objc_method_format): Allow '[' .... ']' formatted
objc methods.
(decode_line_1): Don't call decode_objc unless its an objc
method format.
[-- Attachment #2: disable-misfeature.patch --]
[-- Type: application/octet-stream, Size: 1860 bytes --]
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 52149f0..d53886f 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -11085,15 +11085,6 @@ enter:
list +[NSText initialize]
@end smallexample
-In the current version of @value{GDBN}, the plus or minus sign is
-required. In future versions of @value{GDBN}, the plus or minus
-sign will be optional, but you can use it to narrow the search. It
-is also possible to specify just a method name:
-
-@smallexample
-break create
-@end smallexample
-
You must specify the complete method name, including any colons. If
your program's source files contain more than one @code{create} method,
you'll be presented with a numbered list of classes that implement that
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 70e27f7..f4dc4a7 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -466,6 +466,8 @@ is_objc_method_format (const char *s)
if ((s[0] == ':') && (strchr ("+-", s[1]) != NULL)
&& (s[2] == '[') && strchr(s, ']'))
return 1;
+ else if (s[0] == '[' && strchr(s, ']'))
+ return 1;
/* Handle arguments that are just SYMBOL. */
else if ((strchr ("+-", s[0]) != NULL) && (s[1] == '[') && strchr(s, ']'))
return 1;
@@ -739,13 +741,14 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
/* Check if the symbol could be an Objective-C selector. */
- {
- struct symtabs_and_lines values;
- values = decode_objc (argptr, funfirstline, NULL,
- canonical, saved_arg);
- if (values.sals != NULL)
- return values;
- }
+ if (is_objc_method)
+ {
+ struct symtabs_and_lines values;
+ values = decode_objc (argptr, funfirstline, NULL,
+ canonical, saved_arg);
+ if (values.sals != NULL)
+ return values;
+ }
/* Does it look like there actually were two parts? */
next prev parent reply other threads:[~2009-09-25 4:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-06 1:31 Matt Rice
2009-03-06 17:33 ` Joel Brobecker
2009-03-06 19:13 ` Pedro Alves
2009-03-07 12:07 ` Matt Rice
2009-03-08 14:16 ` Matt Rice
2009-03-09 2:10 ` Matt Rice
2009-09-11 11:43 ` Matt Rice
2009-09-24 0:53 ` Joel Brobecker
2009-09-24 8:24 ` Matt Rice
2009-09-24 18:28 ` Tom Tromey
2009-09-24 22:07 ` Matt Rice
2009-09-24 22:29 ` Matt Rice
2009-09-24 22:51 ` Matt Rice
2009-09-25 4:03 ` Matt Rice [this message]
2009-10-13 0:44 ` Tom Tromey
2009-10-14 1:59 ` Joel Brobecker
2009-09-23 23:13 ` Joel Brobecker
2009-09-24 6:48 ` Matt Rice
2009-09-24 16:41 ` Joel Brobecker
2009-09-24 17:31 ` Joel Brobecker
2009-09-24 17:41 ` Joel Brobecker
2009-09-24 16:52 ` Joel Brobecker
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=8ba6bed40909242103m3a33cd1ck385bf3240298462c@mail.gmail.com \
--to=ratmice@gmail.com \
--cc=brobecker@adacore.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