prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Debugging modules (using -m switch)
  This is currently not supported
  
  </issue>
  <code>
  [start of ptvsd/debugger.py]
  1 # Copyright (c) Microsoft Corporation. All rights reserved.
  2 # Licensed under the MIT License. See LICENSE in the project root
  3 # for license information.
  4 
  5 import sys
  6 
  7 
  8 __author__ = "Microsoft Corporation <ptvshelp@microsoft.com>"
  9 __version__ = "4.0.0a1"
  10 
  11 DONT_DEBUG = []
  12 
  13 
  14 def debug(filename, port_num, debug_id, debug_options, run_as):
  15     # TODO: docstring
  16 
  17     # import the wrapper first, so that it gets a chance
  18     # to detour pydevd socket functionality.
  19     import ptvsd.wrapper
  20     import pydevd
  21 
  22     sys.argv[1:0] = [
  23             '--port', str(port_num),
  24             '--client', '127.0.0.1',
  25             '--file', filename,
  26             ]
  27     try:
  28         pydevd.main()
  29     except SystemExit as ex:
  30         ptvsd.wrapper.ptvsd_sys_exit_code = ex.code
  31         raise
  32
  [end of ptvsd/debugger.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/ptvsd/debugger.py b/ptvsd/debugger.py
  --- a/ptvsd/debugger.py
  +++ b/ptvsd/debugger.py
  @@ -19,11 +19,16 @@
       import ptvsd.wrapper
       import pydevd
   
  -    sys.argv[1:0] = [
  +    args = [
               '--port', str(port_num),
               '--client', '127.0.0.1',
  -            '--file', filename,
               ]
  +    if run_as == 'module':
  +        args.append('--module')
  +        args.extend(('--file', filename + ":"))
  +    else:
  +        args.extend(('--file', filename))
  +    sys.argv[1:0] = args
       try:
           pydevd.main()
       except SystemExit as ex:
  
verification_info: {"golden_diff": "diff --git a/ptvsd/debugger.py b/ptvsd/debugger.py\n--- a/ptvsd/debugger.py\n+++ b/ptvsd/debugger.py\n@@ -19,11 +19,16 @@\n     import ptvsd.wrapper\n     import pydevd\n \n-    sys.argv[1:0] = [\n+    args = [\n             '--port', str(port_num),\n             '--client', '127.0.0.1',\n-            '--file', filename,\n             ]\n+    if run_as == 'module':\n+        args.append('--module')\n+        args.extend(('--file', filename + \":\"))\n+    else:\n+        args.extend(('--file', filename))\n+    sys.argv[1:0] = args\n     try:\n         pydevd.main()\n     except SystemExit as ex:\n", "issue": "Debugging modules (using -m switch)\nThis is currently not supported\n", "before_files": [{"content": "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See LICENSE in the project root\n# for license information.\n\nimport sys\n\n\n__author__ = \"Microsoft Corporation <ptvshelp@microsoft.com>\"\n__version__ = \"4.0.0a1\"\n\nDONT_DEBUG = []\n\n\ndef debug(filename, port_num, debug_id, debug_options, run_as):\n    # TODO: docstring\n\n    # import the wrapper first, so that it gets a chance\n    # to detour pydevd socket functionality.\n    import ptvsd.wrapper\n    import pydevd\n\n    sys.argv[1:0] = [\n            '--port', str(port_num),\n            '--client', '127.0.0.1',\n            '--file', filename,\n            ]\n    try:\n        pydevd.main()\n    except SystemExit as ex:\n        ptvsd.wrapper.ptvsd_sys_exit_code = ex.code\n        raise\n", "path": "ptvsd/debugger.py"}]}