[cfe-dev] Fwd: clang-cl 8.0 (x86) - pdb

Leo Brugnara via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 2 05:08:57 PDT 2019

I'm forwarding this from the cfe-users list, thanks in advance.

---------- Forwarded message ---------
From: Leo Brugnara <leobr6 at gmail.com>
Date: Wed, Jun 26, 2019 at 1:13 PM
Subject: clang-cl 8.0 (x86) - pdb
To: <cfe-users at lists.llvm.org>


I've come across the following issue with Clang 8.0 under Windows 10 (Home
- Version 10.0.17134 Build 17134) using clang's cl driver. I have the
following snippet of code that uses *double*:

#include <stdio.h>

int main (int argc, char **argv)
    int size = 60;
    printf("size=%d\n", size);

    double d = 1.4;
    printf("double=%f\n", d);

    int  ret = (size * d);
    printf("ret=%d\n", ret);

    return ret;

If I compile this with the *x64* version of Clang while debugging with lldb
the variables have the expected value and the console's output looks good
too. Instead, if I use the *x86* version, the debug session shows weird
numbers for the variables, even though the console's output is correct (so
is the program).

If I directly use *cl.exe* (x86) to compile the program, the debug session
works as expected (and the program keeps working as expected). The same
happens if I change "double d = 1.4" by "float d = 1.4", both the debug
session and the program work as expected. Also, if I use the MSVC debugger
the output for all the scenarios is the same.

Am I missing something here or is it a bug with the generated PDB file?
These are the logs of each scenario:



-- Leo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190702/d720bfe3/attachment.html>

More information about the cfe-dev mailing list