New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue 636111



Sign in to add a comment

char strings only show first character in debugger

Project Member Reported by wfh@chromium.org, Sep 8 2017

Issue description

Chrome Version: 63.0.3209.2
OS: Windows

As noted in  issue 761633 , some char strings are not fully expanding in the debugger when debugging a clang build.

Example:

MSVS (63.0.3209.0)

      =00007ff8`d10e7bc0 kNotPresent      : [0]  "internal-not-yet-present"
      =00007ff8`d10e7ba8 kPDFExtensionPluginName : [0]  "Chrome PDF Viewer"
      =00007ff8`d0bd6330 kPDFInternalPluginName : [0]  "Chrome PDF Plugin"
      =00007ff8`d0bd60d8 kPDFPluginPath   : [0]  "internal-pdf-viewer"
      =00007ff8`cdec0000 kRemotingViewerPluginPath : [0]  "MZ???"

clang (63.0.3209.2)

      =000007fe`d3de7540 kNotPresent      : [1]  "i"
      =000007fe`d3de7560 kPDFExtensionPluginName : [1]  "C"
      =000007fe`d3de7580 kPDFInternalPluginName : [1]  "C"
      =000007fe`d3de75a0 kPDFPluginPath   : [1]  "i"
      =000007fe`d0480000 kRemotingViewerPluginPath : [1]  "M"

maybe clang is typing these wrong for windbg?

original cdb output files (Google access only) https://drive.google.com/drive/folders/0BzKr4yVrnrZNM3BZODhReDR4d3c?usp=sharing
 
Blocking: 636111
Cc: r...@chromium.org
Less important than the other ones, but maybe easy

Comment 2 by r...@chromium.org, Sep 11 2017

Small reproducer:

extern "C" int puts(const char *);
struct Foo {
  static const char str[];
  void doit();
};
const char Foo::str[] = "asdf";
void Foo::doit() {
  puts(Foo::str);
}
int main() {
  Foo o;
  o.doit();
}

LLVM gets confused because it thinks that Foo::str is a VLA, so it says sizeof(Foo::str) = sizeof(char), which is the same as saying it has one element.

We're supposed to have two types for Foo::str: one for the forward declaration, and one for the definition (with five elements). The forward declaration should have a zero size, and the definition should be sized.

This should be pretty simple.

Comment 3 by r...@chromium.org, Sep 13 2017

Owner: r...@chromium.org
Status: Assigned (was: Untriaged)
Fixed in LLVM r313203.

Comment 4 by thakis@chromium.org, Oct 20 2017

Cc: h...@chromium.org
This is fixed, right?

Comment 5 by h...@chromium.org, Oct 23 2017

Status: Fixed (was: Assigned)
Yes. (I verified the example from #2 works in VS.)

Sign in to add a comment