• 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
Re: Issue in LLDB's Expression Parser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue in LLDB's Expression Parser


  • Subject: Re: Issue in LLDB's Expression Parser
  • From: Jim Ingham <email@hidden>
  • Date: Wed, 27 Jul 2011 10:33:29 -0700

lldb uses clang as its expression parser.  There can be some subtle differences because at present we always run Clang in ObjC++ mode.

But in this case, I'm not sure what you are seeing, but I get:

 > cat foo.cpp
#include <stdio.h>
#include <stdint.h>

int main ()
{
  uint8_t c = 0;
  bool value = (c - 0xC2) < 0x32;
  if (value)
    printf ("True.\n");
  else
    printf ("False.\n");

  return 0;
}
 > clang++ -g -O0 -o foo foo.cpp
 > ./foo
True.

I'm not sure what you are seeing that is different.

Jim


On Jul 27, 2011, at 4:16 AM, Andreas Grosam wrote:

> Hi All,
>
>
> I figured an issue in the expression parser of LLDB.
>
> Firstly, I'm not sure if LLDB uses its own parser or if it's based somehow on LLVM. Anyway, here is the problem:
>
> LLDB prints the following result for the given expression:
> (lldb) print ((uint8_t)(0) - 0xC2) < 0x32
> (_Bool) $2 = true
>
>
> If my understandings of the C99 integer promotion, value preserving and sign preserving rules are correct, the result should be false however.
> The rationale and the rules for the above expression do appear complex, however LLVM and GCC both agree on me ;)
>
>
> Here is code that corresponds to the expression above:
>
> uint8_t c = 0;
> bool result =  (c - 0xC2) < 0x32;
>
> LLVM and GCC will evaluate this to false.
>
>
>
> Regards
> Andreas
> _______________________________________________
> 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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Issue in LLDB's Expression Parser
      • From: Andreas Grosam <email@hidden>
References: 
 >Issue in LLDB's Expression Parser (From: Andreas Grosam <email@hidden>)

  • Prev by Date: ld: symbol dyld_stub_binding_helper not found
  • Next by Date: XCode 4 - Only Use Mac OSX Documentation?
  • Previous by thread: Issue in LLDB's Expression Parser
  • Next by thread: Re: Issue in LLDB's Expression Parser
  • Index(es):
    • Date
    • Thread