Skip to content

Commit 767e4a7

Browse files
committed
Fixed debugging for Mac
1 parent 18bda90 commit 767e4a7

File tree

8 files changed

+173
-476
lines changed

8 files changed

+173
-476
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ Works on both Windows and Mac.
99
* Renaming, Viewing references, Going to definitions, Go to Symbols
1010
* View signature and similar by hovering over a function or method
1111
* Debugging with support for local variables, arguments, expressions, watch window, stack information, break points
12-
* Debugging Multiple threads (Web Applications, etc) and expanding values in watch windows is supported on Windows
12+
* Debugging Multiple threads (Web Applications, etc) and expanding values (on Windows and Mac)
1313
* Unit testing (unittests and nosetests, with config files)
1414
* Sorting imports
1515
* Snippets
1616

1717
## Issues and Feature Requests
1818
[Github Issues](https://github.com/DonJayamanne/pythonVSCode/issues)
1919
* Remote Debugging (coming soon)
20-
* Improved debugging for Mac (in development)
2120

2221
## Feature Details (with confiuration)
2322
* IDE Features
@@ -35,8 +34,7 @@ Works on both Windows and Mac.
3534
```json
3635
"python.autoComplete.extraPaths": [
3736
"C:/Program Files (x86)/Google/google_appengine",
38-
"C:/Program Files (x86)/Google/google_appengine/lib"
39-
]
37+
"C:/Program Files (x86)/Google/google_appengine/lib" ]
4038
```
4139
* Code formatting
4240
* - Use either yapf or autopep8 for code formatting (defaults to autopep8)
@@ -59,8 +57,8 @@ Works on both Windows and Mac.
5957
* - Step through code (Step in, Step out, Continue)
6058
* - Add/remove break points
6159
* - Local variables and arguments
62-
* - Multiple Threads and Web Applications (such as Flask) (only Windows at this stage)
63-
* - Expanding values (viewing children, properties, etc) again only Windows at this Stage
60+
* - Multiple Threads and Web Applications (such as Flask) (Windows and Mac)
61+
* - Expanding values (viewing children, properties, etc) (Windows and Mac)
6462
* Unit Testing
6563
* - unittests (default is on)
6664
* - nosetests (default is off)
@@ -98,6 +96,11 @@ Works on both Windows and Mac.
9896

9997
## Change Log
10098

99+
### Version 0.2.2
100+
* Improved debugger for Mac, with support for Multi threading, Web Applications, expanding properties, etc
101+
* (Debugging now works on both Windows and Mac)
102+
* Debugging no longer uses PDB
103+
101104
### Version 0.2.1
102105
* Improved debugger for Windows, with support for Multi threading, debugging Multi-threaded apps, Web Applications, expanding properties, etc
103106
* Added support for relative paths for extra paths in additional libraries for Auto Complete

package.json

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python",
33
"displayName": "Python",
44
"description": "Linting, Debugging (multi-threaded), Intellisense, auto-completion, code formatting, snippets, and more.",
5-
"version": "0.2.1",
5+
"version": "0.2.2",
66
"publisher": "donjayamanne",
77
"license": "SEE LICENSE IN LICENSE or README.MD",
88
"homepage": "https://github.com/DonJayamanne/pythonVSCode/blob/master/README.md",
@@ -54,56 +54,7 @@
5454
"debuggers": [
5555
{
5656
"type": "python",
57-
"label": "Python (pdb)",
58-
"enableBreakpointsFor": {
59-
"languageIds": [
60-
"python"
61-
]
62-
},
63-
"program": "./out/client/debugger/pdb/debuggerMain.js",
64-
"runtime": "node",
65-
"configurationAttributes": {
66-
"launch": {
67-
"required": [
68-
"program"
69-
],
70-
"properties": {
71-
"program": {
72-
"type": "string",
73-
"description": "Workspace relative path to a text file.",
74-
"default": "__init__.py"
75-
},
76-
"pythonPath": {
77-
"type": "string",
78-
"description": "Path (fully qualified) to python executable. Use this if you want to use a custom pthon executable version.",
79-
"default": ""
80-
},
81-
"stopOnEntry": {
82-
"type": "boolean",
83-
"description": "Automatically stop after launch.",
84-
"default": true
85-
},
86-
"args": {
87-
"type": "array",
88-
"description": "List of arguments for the program",
89-
"default": []
90-
}
91-
}
92-
}
93-
},
94-
"initialConfigurations": [
95-
{
96-
"name": "Python (Pdb)",
97-
"type": "python",
98-
"request": "launch",
99-
"program": "__init__.py",
100-
"stopOnEntry": true
101-
}
102-
]
103-
},
104-
{
105-
"type": "python_windows",
106-
"label": "Python (Windows)",
57+
"label": "Python",
10758
"enableBreakpointsFor": {
10859
"languageIds": [
10960
"python"
@@ -137,9 +88,10 @@
13788
},
13889
"initialConfigurations": [
13990
{
140-
"name": "Python (Windows)",
141-
"type": "python_windows",
91+
"name": "Python",
92+
"type": "python",
14293
"request": "launch",
94+
"stopOnEntry": true,
14395
"program": "__init__.py"
14496
}
14597
]
@@ -306,9 +258,9 @@
306258
"compile": "node ./node_modules/vscode/bin/compile -watch -p ./ && installServerIntoExtension ./out ./src/server/package.json ./src/server/tsconfig.json"
307259
},
308260
"dependencies": {
309-
"long": "^3.0.3",
310261
"named-js-regexp": "^1.3.1",
311262
"tmp": "0.0.28",
263+
"uint64be": "^1.0.1",
312264
"vscode-debugadapter": "^1.0.1",
313265
"vscode-debugprotocol": "^1.0.1",
314266
"vscode-languageclient": "^1.1.0",

src/client/debugger/vs/Common/BufferReader.ts

Lines changed: 0 additions & 170 deletions
This file was deleted.

src/client/debugger/vs/Common/BufferUtils.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/client/debugger/vs/Common/SocketStream.ts

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as net from 'net';
2-
var long = require("long");
2+
var uint64be = require("uint64be");
33

44

55
export class SocketStream {
@@ -14,25 +14,7 @@ export class SocketStream {
1414
}
1515

1616
public WriteInt64(num: number) {
17-
//convert to long
18-
var longNumber = long.fromNumber(num, true);
19-
20-
// Can't use BitConverter because we need to convert big-endian to little-endian here,
21-
// and BitConverter.IsLittleEndian is platform-dependent (and usually true).
22-
var hi = longNumber.shiftRight(0x20).toInt()
23-
var lo = longNumber.and(0xFFFFFFFF).toInt();
24-
var buf = [
25-
<number>((hi >> 0x18) & 0xFF),
26-
<number>((hi >> 0x10) & 0xFF),
27-
<number>((hi >> 0x08) & 0xFF),
28-
<number>((hi >> 0x00) & 0xFF),
29-
<number>((lo >> 0x18) & 0xFF),
30-
<number>((lo >> 0x10) & 0xFF),
31-
<number>((lo >> 0x08) & 0xFF),
32-
<number>((lo >> 0x00) & 0xFF)
33-
];
34-
35-
var buffer = new Buffer(buf);
17+
var buffer = uint64be.encode(num);
3618
this.socket.write(buffer);
3719
}
3820
public WriteString(value: string) {
@@ -186,13 +168,8 @@ export class SocketStream {
186168
else {
187169
this.buffer = this.buffer.slice(8);
188170
}
189-
190-
// Can't use BitConverter because we need to convert big-endian to little-endian here,
191-
// and BitConverter.IsLittleEndian is platform-dependent (and usually true).
192-
var hi = <number>((buf[0] << 0x18) | (buf[1] << 0x10) | (buf[2] << 0x08) | (buf[3] << 0x00));
193-
var lo = <number>((buf[4] << 0x18) | (buf[5] << 0x10) | (buf[6] << 0x08) | (buf[7] << 0x00));
194-
var returnValue = <number>((hi << 0x20) | lo);
195171

172+
var returnValue = uint64be.decode(buf);
196173
return returnValue;
197174
}
198175

0 commit comments

Comments
 (0)