[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 4679974da1 141/323: Add documentation and sta
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 4679974da1 141/323: Add documentation and starter file for PHP support |
Date: |
Thu, 9 Mar 2023 10:58:25 -0500 (EST) |
branch: externals/beardbolt
commit 4679974da16370607dda5c79b48201a0aef8a82e
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>
Add documentation and starter file for PHP support
---
README.org | 7 ++++++-
rmsbolt.el | 14 +++++++++++---
starters/rmsbolt.php | 37 +++++++++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/README.org b/README.org
index 4a9dde26cc..ddba8bda2f 100644
--- a/README.org
+++ b/README.org
@@ -11,7 +11,7 @@ versa. It supports more types of languages than any previous
tool of its kind.
- Much more flexible and powerful:
- Supports disassembly to bytecode as well as assembly.
- - Supports many languages that godbolt does not support, such as Python,
+ - Supports many languages that godbolt does not support, such as Python, PHP,
Common Lisp, Emacs Lisp, Ocaml, Java, and Pony.
- No more sending your code to any server.
- Much faster turnaround time from writing code to seeing and interacting with
disassembly.
@@ -127,6 +127,10 @@ moment.
[[https://i.imgur.com/KkWEMMj.gif][https://i.imgur.com/KkWEMMj.gif]]
+** PHP
+Requires the [[https://github.com/derickr/vld][vld php extension]] to display
PHP opcodes.
+
+[[https://i.imgur.com/xBfzaK9.gif][https://i.imgur.com/xBfzaK9.gif]]
** Pony
Filtering on pony is not as effective as pony asm includes references to
@@ -206,5 +210,6 @@ mail with your patch. If your change is non-trivial, please
- [[https://github.com/yawkat/javap][yawkat/javap]]
-
[[https://github.com/mattgodbolt/compiler-explorer][mattgodbolt/compiler-explorer]]
- [[http://reliant.colab.duke.edu/c2mips/][c2mips]]
+ - [[https://3v4l.org/][3v4l]]
Please let me know if you find other alternatives not mentioned!
diff --git a/rmsbolt.el b/rmsbolt.el
index 882d48fac0..cf05367e59 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -25,8 +25,8 @@
;; RMSBolt is a package to provide assembly or bytecode output for a source
;; code input file.
;;
-;; It currently supports: C/C++, OCaml, Haskell, Python, Java, Pony, Emacs
Lisp,
-;; and (limited) Common Lisp.
+;; It currently supports: C/C++, OCaml, Haskell, Python, Java, PHP, Pony,
+;; Emacs Lisp, and (limited) Common Lisp.
;;
;; Adding support for more languages, if they have an easy manual compilation
;; path from source->assembly/bytecode with debug information, should be much
@@ -52,6 +52,10 @@
;; `rmsbolt-intel-x86': Toggle between intel and att syntax if supported.
;; `rmsbolt-demangle': Demangle the output, if supported.
;;
+;; For more advanced configuration (to the point where you can override almost
+;; all of RMSbolt yourself), you can set `rmsbolt-language-descriptor' with a
+;; replacement language spec.
+;;
;; Please see the readme at https://gitlab.com/jgkamat/rmsbolt for
;; more information!
;;
@@ -484,7 +488,10 @@ Return value is quoted for passing to the shell."
" "))))
(cl-defun rmsbolt--php-compile-cmd (&key src-buffer)
- "Process a compile command for PHP it needs to have the vld.so module on."
+ "Process a compile command for PHP.
+In order to disassemble opcdoes, we need to have the vld.so
+extension to php on.
+https://github.com/derickr/vld"
(rmsbolt--with-files
src-buffer
(concat (buffer-local-value 'rmsbolt-command src-buffer)
@@ -1222,6 +1229,7 @@ Argument OVERRIDE-BUFFER use this buffer instead of
reading from the output file
("rust " . "rmsbolt.rs")
("python" . "rmsbolt.py")
("haskell" . "rmsbolt.hs")
+ ("php" . "rmsbolt.php")
("pony" . "rmsbolt.pony")
("emacs-lisp" . "rmsbolt-starter.el")
;; Rmsbolt is capitalized here because of Java convention of Capitalized
diff --git a/starters/rmsbolt.php b/starters/rmsbolt.php
new file mode 100644
index 0000000000..dbed187c68
--- /dev/null
+++ b/starters/rmsbolt.php
@@ -0,0 +1,37 @@
+<?php
+
+/*
+ RMSBolt requires the 'vld.so' extension to php in order to display opcodes
for PHP.
+ You can install it following instructions from here:
+ https://github.com/derickr/vld
+
+ Without this, you will get an empty buffer or an error.
+ */
+
+function isRMS($var) {
+ switch ($var) {
+ case 'R':
+ case 'M':
+ case 'S':
+ return true;
+ default:
+ return true;
+ }
+}
+
+
+function main() {
+ $a = 200;
+ foreach (range(1, 5) as $var) {
+ $a += $var;
+ }
+ $a = 82;
+ print(isRMS(chr($a)) ? "True\n" : "False\n");
+}
+
+main();
+
+// Local Variables:
+// rmsbolt-command: "php"
+// End:
+?>
- [elpa] externals/beardbolt 15aa590bcf 106/323: Add ability to specify moved initial src file, (continued)
- [elpa] externals/beardbolt 15aa590bcf 106/323: Add ability to specify moved initial src file, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt b60a9e3a84 117/323: Fix errors with emacs <25 with elisp disass, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a5855171f8 120/323: Fix byte-compilation warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 0d5774397b 124/323: Update README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt be3f92821e 140/323: Clean up PHP exporter slightly, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a4e0b8a805 134/323: Optimize disassembly function, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3527f2fa3a 123/323: Fix source code highlighting when multiple files are provided, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d564f9def8 131/323: Update README.org, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ebc56d81b0 127/323: Disable automatic recompile for buffers larger than 500 lines, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5f998f34d7 137/323: Update README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4679974da1 141/323: Add documentation and starter file for PHP support,
ELPA Syncer <=
- [elpa] externals/beardbolt 345dd21d24 145/323: Fix typo in docstring, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 33c687fae5 151/323: Implement helpers for compile_commands parsing, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 708260ac56 163/323: Add sharplab to README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 79de946e68 161/323: Add IRC channel to README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt cc4347908c 179/323: Inline demo screencast, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt b6e105190c 168/323: Actually use hidden-func-zig, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 10b70ca151 181/323: Add custom logic for finding swiftc, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 565d4a44ee 180/323: Convert if chain into cond, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2bb741e6f1 183/323: Merge branch 'add-swift-support' into 'master', ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 73a547856c 182/323: Remove rmsbolt-command from local variables in starter file, ELPA Syncer, 2023/03/09