[lldb-dev] [Bug 16826] New: BOOL output in debugger is misleading, because of a hidden cast

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 7 11:09:15 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16826

            Bug ID: 16826
           Summary: BOOL output in debugger is misleading, because of a
                    hidden cast
           Product: lldb
           Version: 3.2
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: riazrizvi at gmail.com
    Classification: Unclassified

In the debugger, if I break after this line of source

   `BOOL myBOOL=(BOOL)2;`

I can inspect the value of myBOOL:

   (lldb)p myBOOL
   (BOOL) $0 = YES

However, myBOOL is not YES and the debugger knows it

   (lldb)p myBOOL==YES
   (bool) $1 = false

The debugger represents BOOL with YES/NO but obviously this is insufficient in
the case of BOOL which can also take values 2..256. I believe the debugger is
performing a (bool) cast:

   (lldb)p (bool)myBOOL
   (BOOL) $3 = YES

Instead it should perform a (signed char) cast:

   (lldb)p (signed char)myBOOL
   (signed char) $4 = '\x02'

And ideally it could also show these values as YES and NO only in the case
where '\x01' or '\0' are returned.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130807/d3e89b89/attachment.html>


More information about the lldb-dev mailing list