[PATCH] D84555: [lldb-vscode ]Add Syntax Highlighting to Disassembly View
Yifan Shen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 24 14:56:21 PDT 2020
aelitashen updated this revision to Diff 280596.
aelitashen added a comment.
Use unique id for disassembly.json
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84555/new/
https://reviews.llvm.org/D84555
Files:
lldb/tools/lldb-vscode/lldb-vscode.cpp
llvm/utils/vscode/llvm/package.json
llvm/utils/vscode/llvm/syntaxes/disassembly.json
Index: llvm/utils/vscode/llvm/syntaxes/disassembly.json
===================================================================
--- /dev/null
+++ llvm/utils/vscode/llvm/syntaxes/disassembly.json
@@ -0,0 +1,31 @@
+{
+ "name": "Disassembly",
+ "scopeName": "source.disassembly",
+ "uuid": "9ade615f-5d82-4ac5-b22f-a1998c356ebe",
+ "patterns": [
+ {
+ "comment": "Address, bytes and opcode",
+ "name": "meta.instruction",
+ "match": "^([A-Za-z0-9]+):\\s([A-Z0-9]{2}\\s)+>?\\s+(\\w+)",
+ "captures": {
+ "1": {"name": "constant.numeric"},
+ "3": {"name": "keyword.opcode"}
+ }
+ },
+ {
+ "comment": "Numeric constant",
+ "name": "constant.numeric",
+ "match": "(\\$|\\b)((0x)|[0-9])[A-Za-z0-9]+\\b"
+ },
+ {
+ "comment": "Register",
+ "name": "variable.language",
+ "match": "%[A-Za-z][A-Za-z0-9]*"
+ },
+ {
+ "comment": "End of line comment",
+ "name": "comment.line.semicolon",
+ "match": ";.*$"
+ }
+ ]
+}
Index: llvm/utils/vscode/llvm/package.json
===================================================================
--- llvm/utils/vscode/llvm/package.json
+++ llvm/utils/vscode/llvm/package.json
@@ -39,6 +39,15 @@
".ll"
],
"configuration": "./language-configuration.json"
+ },
+ {
+ "id": "lldb.disassembly",
+ "aliases": [
+ "Disassembly"
+ ],
+ "extensions": [
+ ".disasm"
+ ]
}
],
"grammars": [
@@ -51,6 +60,11 @@
"language": "llvm",
"scopeName": "source.llvm",
"path": "./syntaxes/ll.tmLanguage.json"
+ },
+ {
+ "language": "lldb.disassembly",
+ "scopeName": "source.disassembly",
+ "path": "./syntaxes/disassembly.json"
}
],
"taskDefinitions": [
Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===================================================================
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -2188,6 +2188,7 @@
} else {
response["success"] = llvm::json::Value(false);
}
+ EmplaceSafeString(body, "mimeType", "text/x-lldb.disassembly");
response.try_emplace("body", std::move(body));
g_vsc.SendJSON(llvm::json::Value(std::move(response)));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84555.280596.patch
Type: text/x-patch
Size: 2494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200724/13ae7783/attachment.bin>
More information about the llvm-commits
mailing list