This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Redefine skip_quoted

In the Apple code, we use skip_quoted to allow for the possibility of spaces in Objective-C function names.

I'm actually coming to think that allowing people to break on unquoted Objective-C methods was a mistake: it's caused us no end of trouble trying to shoehorn decode_line_1() into handling every possible edge-case. I'm not sure how practical it is for us to remove it at this point, though --- we'd have to do some research among our Objective-C developers to find out how important a feature it is to them, I think.

Here's the appropriate diff from our linespec.c:

diff -u -r1.1.1.10 -r1.17
--- linespec.c 2002/09/26 20:57:05
+++ linespec.c 2002/09/26 22:19:22 1.17
@@ -1094,10 +1245,15 @@
else if (is_quoted)
- p = skip_quoted (*argptr);
+ /* allow word separators in function names for Obj-C */
+ p = skip_quoted (*argptr, "");
if (p[-1] != '\'')
error ("Unmatched single quote.");
@@ -1105,9 +1261,10 @@
- p = skip_quoted (*argptr);
+ /* allow word separators in function names for Obj-C */
+ p = skip_quoted (*argptr, "");

copy = (char *) alloca (p - *argptr + 1);

On Monday, October 14, 2002, at 04:29 PM, Jim Blandy wrote:

I don't understand the purpose of this patch.

Instead of havingb skip_quoted use gdb_completer_word_break_characters
directly, it adds an argument to skip_quoted, and then passes the
return value from get_gdb_completer_word_break_characters () in every
case.  But the Objective-C case does exactly the same thing as all the
other cases; it doesn't behave any differently.

Is this some sort of preparatory patch for something else?  What's
coming down the line?

Michael Snyder <> writes:

Adam Fedor wrote:

Objective-C has a different idea of what word break characters are.
Hence this patch (although the new usage isn't actually apparent in this
I think you need Jim or Elena's buy-in for the change in linespec.c,
but I'll approve the rest.  Jim, Elena's on vacation -- can you give
a quick look at this?

2002-10-04 Adam Fedor <>

* ( Add $(completer_h) to dependancies.
(jv-exp.tarb.o): Likewise.
( Likewise.
* completer.c (skip_quoted): Take additional "word break
characters" argument.
* completer.h: Update definition of skip_quoted.
* defs.h (skip_quoted): Delete, declared in completer.h.
* c-exp.y: Include completer.h. Update definition of skip_quoted.
* p-exp.y: Likewise.
* jv-exp.y: Likewise.
* linespec.c (decode_line_1): Likewise.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]