Repository: microsoft/ptvsd

Issue:
Raw value does not get the full string
This is for a large json file:
![image](https://user-images.githubusercontent.com/3840081/37932249-d906057c-30fc-11e8-94b0-de646a1390a6.png)

Only this much was retreived:
```
{
  "web-app": {
    "servlet": [
      {
        "servlet-name": "cofaxCDS",
        "servlet-class": "org.cofax.cds.CDSServlet",
        "init-param": {
          "configGlossary:installationAt": "Philadelphia, PA",
          "configGlossary:adminEmail": "ksm@pobox.com",
          "configGlossary:poweredBy": "Cofax",
          "configGlossary:poweredByIcon": "/images/cofax.gif",
          "configGlossary:staticPath": "/content/static",
          "templateProcessorClass": "org.cofax.WysiwygTemplate",
          "templateLoaderClass": "org.cofax.FilesTemplateLoader",
          "templatePath": "templates",
          "templateOverridePath": "",
          "defaultListTemplate": "listTemplate.htm",
          "defaultFileTemplate": "articleTemplate.htm",
          "useJSP": false,
          "jspListTemplate": "listTemplate.jsp",
          "jspFileTemplate": "articleTemplate.jsp",
          "cachePackageTagsTrack": 200,
          "cachePackageTagsStore": 200,
          "cachePackageTagsRefres...
```


Discussion:

Resolving patch:
diff --git a/ptvsd/safe_repr.py b/ptvsd/safe_repr.py
--- a/ptvsd/safe_repr.py
+++ b/ptvsd/safe_repr.py
@@ -263,13 +263,16 @@ def _repr_other(self, obj, level):
     def _repr_obj(self, obj, level, limit_inner, limit_outer):
         try:
             if self.raw_value:
+                # For raw value retrieval, ignore all limits.
                 try:
                     mv = memoryview(obj)
                 except Exception:
-                    obj_repr = str(obj)
+                    yield unicode(obj)
+                    return
                 else:
                     # Map bytes to Unicode codepoints with same values.
-                    obj_repr = mv.tobytes().decode('latin-1')
+                    yield mv.tobytes().decode('latin-1')
+                    return
             elif self.convert_to_hex and isinstance(obj, self.int_types):
                 obj_repr = hex(obj)
             else:
diff --git a/ptvsd/wrapper.py b/ptvsd/wrapper.py
--- a/ptvsd/wrapper.py
+++ b/ptvsd/wrapper.py
@@ -23,9 +23,11 @@
 except Exception:
     import urllib.parse as urllib
 
-# Disable this, since we aren't packaging the Cython modules at the moment.
 import _pydevd_bundle.pydevd_constants as pydevd_constants
+# Disable this, since we aren't packaging the Cython modules at the moment.
 pydevd_constants.CYTHON_SUPPORTED = False
+# We limit representation size in our representation provider when needed.
+pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2**32
 
 import _pydevd_bundle.pydevd_comm as pydevd_comm  # noqa
 import _pydevd_bundle.pydevd_extension_api as pydevd_extapi  # noqa


Test patch:
diff --git a/tests/ptvsd/test_safe_repr.py b/tests/ptvsd/test_safe_repr.py
--- a/tests/ptvsd/test_safe_repr.py
+++ b/tests/ptvsd/test_safe_repr.py
@@ -191,16 +191,16 @@ def setUp(self):
         self.saferepr.raw_value = True
 
     def test_unicode_raw(self):
-        value = u'A' * 5
-        self.assert_saferepr(value, 'AAAAA')
+        value = u'A\u2000' * 10000
+        self.assert_saferepr(value, value)
 
     def test_bytes_raw(self):
-        value = b'A' * 5
-        self.assert_saferepr(value, 'AAAAA')
+        value = b'A' * 10000
+        self.assert_saferepr(value, value.decode('ascii'))
 
     def test_bytearray_raw(self):
         value = bytearray(b'A' * 5)
-        self.assert_saferepr(value, 'AAAAA')
+        self.assert_saferepr(value, value.decode('ascii'))
 
 
 class NumberTests(TestBase):