<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - BOOL output in debugger is misleading, because of a hidden cast"
href="http://llvm.org/bugs/show_bug.cgi?id=16826">16826</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>BOOL output in debugger is misleading, because of a hidden cast
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Reporter</th>
<td>riazrizvi@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>