{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2823","repository_url":"https://api.github.com/repos/Microsoft/vscode-cpptools","labels_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2823/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2823/comments","events_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2823/events","html_url":"https://github.com/Microsoft/vscode-cpptools/issues/2823","id":380733861,"node_id":"MDU6SXNzdWUzODA3MzM4NjE=","number":2823,"title":"lldb cannot read bitfield dwarf debug info generated by -mmacosx-version-min=10.11","user":{"login":"s22chan","id":32464643,"node_id":"MDQ6VXNlcjMyNDY0NjQz","avatar_url":"https://avatars3.githubusercontent.com/u/32464643?v=4","gravatar_id":"","url":"https://api.github.com/users/s22chan","html_url":"https://github.com/s22chan","followers_url":"https://api.github.com/users/s22chan/followers","following_url":"https://api.github.com/users/s22chan/following{/other_user}","gists_url":"https://api.github.com/users/s22chan/gists{/gist_id}","starred_url":"https://api.github.com/users/s22chan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s22chan/subscriptions","organizations_url":"https://api.github.com/users/s22chan/orgs","repos_url":"https://api.github.com/users/s22chan/repos","events_url":"https://api.github.com/users/s22chan/events{/privacy}","received_events_url":"https://api.github.com/users/s22chan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-14T14:51:37Z","updated_at":"2018-11-14T14:51:37Z","closed_at":null,"author_association":"NONE","body":"Type: Debugger\r\n\r\n**Describe the bug**\r\n- OS and Version: MacOSX 10.4.1\r\n- VS Code Version: 1.29.0\r\n- C/C++ Extension Version: 0.20.1\r\n- A clear and concise description of what the bug is.\r\n\r\nStarting from MacOSX target 10.11, clang tunes it's debug information for lldb. This causes the version of lldb embedded in the cpptools extension to misreport bitfield values.\r\n\r\n**To Reproduce**\r\n```cpp\r\n#include <stdio.h>\r\n\r\nint main() {\r\n    struct Test {\r\n        unsigned short a;\r\n        unsigned short b : 1;\r\n        unsigned short c: 15;\r\n    };\r\n\r\n    Test x = {0};\r\n    x.a = 5;\r\n    printf(\"%hu\", x.b);\r\n    return 0;\r\n}\r\n```\r\n\r\n```json\r\n{\r\n    \"version\": \"0.2.0\",\r\n    \"configurations\": [\r\n        {\r\n            \"name\": \"(lldb) Launch\",\r\n            \"type\": \"cppdbg\",\r\n            \"request\": \"launch\",\r\n            \"program\": \"${workspaceFolder}/a.out\",\r\n            \"args\": [],\r\n            \"stopAtEntry\": false,\r\n            \"cwd\": \"${workspaceFolder}\",\r\n            \"environment\": [],\r\n            \"externalConsole\": true,\r\n            \"MIMode\": \"lldb\"\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\nSteps to reproduce the behavior:\r\n1. Run `clang++ test.cc -mmacosx-version-min=10.11 -g`\r\n2. Place a breakpoint at line 10: `x.a = 5`\r\n3. Launch debugger\r\n4. Step over `x.a = 5` and see that `x.b` or `x.c` changes value (lldb cannot find the right addresses for the bitfields.\r\n\r\n**Additional context**\r\nCompilation where older lldb works:\r\n1. `clang++ -c test.cc -mmacosx-version-min=10.10 -g`\r\n2. `clang++ -c test.cc -mmacosx-version-min=10.11 -ggdb`\r\n"}}
{"actor":{"display_login":"s22chan"}}