• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
GDB: A parse error near end of expression
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GDB: A parse error near end of expression


  • Subject: GDB: A parse error near end of expression
  • From: Perrog <email@hidden>
  • Date: Fri, 10 Nov 2006 13:45:16 +0100

Hi!

I'm adding my own user-command in GDB.
define nslog
 call (void)NSLog(@"%@", (id)[(id)$arg0 description])
end

If arguments to nslog are Objective-C pointer, everything works OK and
the description is printed.

But when I pass certain arguments to my nslog, GDB fails with "A parse
error near end of expression". It is arguments containing Objective-C
code.

But if I, however, pass Objective-C expression to the built-in print
command, I get no "parse error".

Am I doing something wrong in my command definition?

Or can't I pass Objective-C expression to user-commands?

I've searched the gdb manual, but it doesn't cover much practical info
about user commands. In fact, chapter 8.1 makes me think that there
shouldn't be any different between user-command and e.g. print
built-in command.

file:///Developer/ADC Reference Library/documentation/DeveloperTools/gdb/gdb/gdb_9.html#SEC57

Thanks for any hints!

---

The user-command is basically defined like:

(gdb) define nslog
print $arg0
end

but my intention is make a shortcut to NSLog (or rather CFShow) call.

I examplify the problem with a little test session. First, passing an
Objective-C expression as an argument to "nslog" fails because of a
parse error:

(gdb) nslog [self description]
A parse error near end of expression.

Secondly, this is in contrast how built-in print command works, that
obiviously evaluates the Objective-C code:

(gdb) print (NSString *)[self description]
$2 = (class NSString *) 0x3e7950

Thirdly, calling NSLog function directly isn't a problem:

(gdb) call (void)NSLog(@"%@", (id)[self description])
2006-11-10 13:12:51.401 MyApp[1365] <Controller: 0x3770f0>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: XCode SSH SCM times out
  • Next by Date: Question about gcc linking with dependent dynamic libraries
  • Previous by thread: Re: moving from GCC 4.0.1 to 4.1/4.2?
  • Next by thread: Question about gcc linking with dependent dynamic libraries
  • Index(es):
    • Date
    • Thread