From c25d1fb32f77d36dc241c8d0de1e2e8ee7d872b6 Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Thu, 31 Oct 2024 10:31:20 +0000 Subject: [PATCH] gud jdb follows source files --- developer/javac/IO.java | 10 +++--- developer/javac/Mosaic.java | 2 +- developer/javac/TestBench.java | 26 +++++++------- developer/javac/Util.java | 12 +++---- developer/shell/Mosaic | 2 ++ release/Mosaic.jar | Bin 0 -> 8497 bytes tester/document/jdb.txt | 61 ++++++++++++++++++-------------- tester/javac/Test0.java | 4 +-- tester/javac/TestMosaic_0.javax | 6 ++-- tester/javac/Test_IO.java | 2 +- tester/javac/Test_Util.java | 38 ++++++++++---------- tester/jvm/Test_Mosaic.jar | Bin 3664 -> 3894 bytes tester/tool/#run_jdb# | 12 ------- tester/tool/run_jdb | 1 + tool_shared/bespoke/cat_w_fn | 2 +- tool_shared/bespoke/emacs.el | 52 +++++++++++++++++++++++++++ 16 files changed, 141 insertions(+), 89 deletions(-) create mode 100755 developer/shell/Mosaic create mode 100644 release/Mosaic.jar delete mode 100755 tester/tool/#run_jdb# create mode 100644 tool_shared/bespoke/emacs.el diff --git a/developer/javac/IO.java b/developer/javac/IO.java index 0c80da1..90107e1 100644 --- a/developer/javac/IO.java +++ b/developer/javac/IO.java @@ -21,8 +21,8 @@ public class IO{ private ByteArrayOutputStream out_content; private ByteArrayOutputStream err_content; private ByteArrayInputStream in_content; - private boolean streams_foobar = false; - private boolean uninitialized = true; + private Boolean streams_foobar = false; + private Boolean uninitialized = true; // IO currently has no constructors defined, uses default @@ -35,7 +35,7 @@ public class IO{ // functions are used. // // This is the only method that can set the streams_foobar flag. - public boolean redirect(){ + public Boolean redirect(){ try{ original_out = System.out; @@ -95,7 +95,7 @@ public class IO{ System.setIn(in_content); } - public boolean has_out_content(){ + public Boolean has_out_content(){ if(streams_foobar){ throw new IllegalStateException ( @@ -114,7 +114,7 @@ public class IO{ return out_content.toString(); } - public boolean has_err_content(){ + public Boolean has_err_content(){ if(streams_foobar){ throw new IllegalStateException ( diff --git a/developer/javac/Mosaic.java b/developer/javac/Mosaic.java index 8ab7fe7..aeb992e 100644 --- a/developer/javac/Mosaic.java +++ b/developer/javac/Mosaic.java @@ -9,7 +9,7 @@ Mosaic currently does not have shell commands. public class Mosaic{ - public static boolean test_is_true(){ + public static Boolean test_is_true(){ return true; } diff --git a/developer/javac/TestBench.java b/developer/javac/TestBench.java index 83e0e26..8165867 100644 --- a/developer/javac/TestBench.java +++ b/developer/javac/TestBench.java @@ -23,10 +23,10 @@ public class TestBench{ private static ByteArrayOutputStream err_content; private static InputStream in_content; - public static boolean method_is_wellformed(Method method) { - // Check if the method returns boolean - if(!method.getReturnType().equals(boolean.class)){ - System.out.println("Structural problem: " + method.getName() + " does not return boolean."); + public static Boolean method_is_wellformed(Method method) { + // Check if the method returns Boolean + if(!method.getReturnType().equals(Boolean.class)){ + System.out.println("Structural problem: " + method.getName() + " does not return Boolean."); return false; } @@ -50,16 +50,16 @@ public class TestBench{ return true; } - public static boolean run_test(Object test_suite ,Method method ,IO io){ + public static Boolean run_test(Object test_suite ,Method method ,IO io){ String test_name = method.getName(); // Ways a test can fail, these are not generally singularly exclusive. - boolean fail_TestBench = false; - boolean fail_malformed = false; - boolean fail_reported = false; - boolean fail_exception = false; - boolean fail_extraneous_stdout = false; - boolean fail_extraneous_stderr = false; + Boolean fail_TestBench = false; + Boolean fail_malformed = false; + Boolean fail_reported = false; + Boolean fail_exception = false; + Boolean fail_extraneous_stdout = false; + Boolean fail_extraneous_stderr = false; String exception_string = ""; @@ -75,7 +75,7 @@ public class TestBench{ } // redirect I/O to an io instance - boolean successful_redirect = io.redirect(); + Boolean successful_redirect = io.redirect(); if( successful_redirect ){ io.clear_buffers(); // start each test with nothing on the I/O buffers }else{ @@ -122,7 +122,7 @@ public class TestBench{ } // return condition - boolean test_failed = + Boolean test_failed = fail_reported || fail_exception || fail_extraneous_stdout diff --git a/developer/javac/Util.java b/developer/javac/Util.java index 1757275..653f626 100644 --- a/developer/javac/Util.java +++ b/developer/javac/Util.java @@ -22,20 +22,20 @@ public class Util{ } // True when it does a search and finds a true value; otherwise false. - public static boolean exists( Object[] elements ){ + public static Boolean exists( Object[] elements ){ return elements.length > 0 && find( elements ,element -> (element instanceof Boolean) && (Boolean) element ) != null; } // True when it does a search and does not find a false value; otherwise false. - public static boolean all( Object[] elements ){ + public static Boolean all( Object[] elements ){ return elements.length > 0 && find( elements ,element -> !(element instanceof Boolean) || !(Boolean) element ) == null; } - public static void all_set_false(boolean[] conditions){ - for(boolean condition : conditions) condition = false; + public static void all_set_false(Boolean[] conditions){ + for(Boolean condition : conditions) condition = false; } - public static void all_set_true(boolean[] conditions){ - for(boolean condition : conditions) condition = true; + public static void all_set_true(Boolean[] conditions){ + for(Boolean condition : conditions) condition = true; } public static String iso_utc_time(){ diff --git a/developer/shell/Mosaic b/developer/shell/Mosaic new file mode 100755 index 0000000..ba5b241 --- /dev/null +++ b/developer/shell/Mosaic @@ -0,0 +1,2 @@ +#!/bin/bash +java com.ReasoningTechnology."Mosaic".Mosaic diff --git a/release/Mosaic.jar b/release/Mosaic.jar new file mode 100644 index 0000000000000000000000000000000000000000..246a225662a93e191f8e5c4ab0f18e75c975e263 GIT binary patch literal 8497 zcmai(1yEeuvWD^C!3h#1xCR*9T?Tj8!QEZL5C}noL+}I$?(PtRySu~S1eXwaaL>6n zIj8Qsr>mxFPwoDD@3nSUt-tzHl7)rCfkH$?gbGzN(1!Xgkf7k8P$v#7T%7FPZP3iv?<2+{kM=UR*AR{TEs>UoYc_u$NAScVjJccIAL_a(@Ql-K& z30U27W(LYL%E*to6;`XTuulR;0qm-yj`G8OjI;{sj&gmkY5N$5rZ%_Mw_yJD67nuD zlEoe$A@cb9^%5Rlz`v{j`SC8Zg_Wz7g}sBb*~Gfa2gryn~Ce73g2$|Nebw{#h)e$PBVIc5#V}-#5g8;P$jVZ(VNXQM@= z$FJZNiKObt0&7j00vMmOn5JX{s%SrQT1`~T*v1-+%Z_vU%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hk6lYikEz`yhiWqad}ZMbaxP6xtO zjaaCOHJrg*4>6VBSg=YA&*h*tprR)~qIk*{5PSPzA#$ejQqM5Ax++A#B1#TvPe(D4 z!5PWTjZR40AO*VT42|xSagPAaYb7V$U6Z;jbF3HAdMyHw2cz zA^TpqU0^$KlMYvqx<=YwfBb1*3rNObO}!&K$MVSYI5Q_p&>@ZWhdzzPb+p#~u0Izy zt)in1!HAhy1bv?_1pyTy_Q=PKl_|zp6^8gXxX&nnU5&BM7(;WVzS6d=)HG5Ma|@I_ zNJ<|Yt)~LhzuHB+8>(DZL74M^2eIj7#plPU3i+G6hdT5-qiw- z8@j}e{W6t%$o((s&xu&y65YZ@%0+I7bw5E09s;H%&WM^n zlne=P7=m>n&C`2L5{vNkdPzSKDPjb(^8Y zdg_&$~)q$&Q1xE3O%wwC=vw5R~pZ-kpA6K`LPC z85(3d*MoEk=zwNCQt3LR0EU539fgb)l)l2E_V4$jilH*No4+vDI$`-5go>?F?T*{c5xyCg;jqw# zzgR0-`}&EE&Ja3mG^i-M4lnz)!87j#x2*6+tnHsbBGRqnLR0vFt<1YfNd@S4GT)&) zBhEy+!&_v!>BzpT`DoNY)O-wTGL;VF3V#j;{L9bOH45{3Jz`Qk>?c114TA&qS3>!3 zJp4qE{~G^6!cRQ;@6z9)?h`-$6#|c!|B?PilYg)91b=_0xsQJ9x9EJl{)K{{bjVPD zklg>qdVdK~p#M#Ne<}Vx1%G0{zk=yc#eXNk|9_Py7W^wf|D(!($nalx{`Zmn6C3^& zS^r$@-=z5W9erBo@3YsZY5%XFcx-?tCjQ^n`R5z{KKuWB;om*+)9ChBls$fze<=L7 sLGIsc|K6WZuKHIvK05G!sQt@hE6Kt?5)i1zK0$_Bc cd Mosaic + > source env_tester + > emacs & + + (I use emacs as my IDE. You might be using a different tool.) + +2. location of the executable + + Provided that the project administrator installed it, jdb is located in the + third_party tools directory. In the tester environment the variable + `JAVA_HOME` should hold the jdb directory path, and this should already + be in the `PATH`. For example: + + > echo $ENV + tester/tool/env + + > echo $JAVA_HOME + /var/user_data/Thomas-developer/Mosaic/tool_shared/third_party/jdk-11 - 2024-10-27T09:34:37Z[Mosaic_tester] - Thomas-developer@Blossac§/var/user_data/Thomas-developer/Mosaic/tester§ > which jdb /var/user_data/Thomas-developer/Mosaic/tool_shared/third_party/jdk-11/bin/jdb -2. IDE and the environment +3. invocation from a shell command: - The environment must be set before running the IDE or the IDE will not - have access to it. + jdb -sourcepath $SOURCEPATH - For example Emacs will be following the PATH as it was when Emacs - was invoked, for file completion in the Emacs shell, etc. Even when - the environment is set in a shell running inside of emacs. + The `SOURCEPATH` is assigned a value in `tester/tool/env`. In some versions + of jdb there is no space between `-sourcepath` and the `$SOURCDEPATH`. - FYI, the path can be fixed but other environment settings will still be missing. - (setenv "PATH" (concat (getenv "PATH") ":")) - (setq exec-path (append exec-path '(" + The file `tool_shared/bespoke/emacs.el` holds a definition for the `jdbx` + command. This command will read the SOURCEPATH from the environment and run + jdb in Emacs. - currently, in emacs, e.g.: - jdb -sourcepathjavac Test_Util + That file also holds the definition for a listener to the jdb `sourcepath` + command. - When invoked from Emacs M-x jdb, there is no space between the -sourcepath and - the $SOURCEPATH. - In jdb run from gud-gdb, when packages are used, the SOURCEPATH is the path - to the directory that holds a directory tree, where said directory tree - parallels the package name. Otherwise it is the directory path to the source - directory. Note the `distribute_sources` script. - When using packages, the is fully qualified. diff --git a/tester/javac/Test0.java b/tester/javac/Test0.java index 40c4ef8..e8a4810 100644 --- a/tester/javac/Test0.java +++ b/tester/javac/Test0.java @@ -9,12 +9,12 @@ Plug it in, see if there is smoke. There usually is. public class Test0{ - public static boolean test_is_true(){ + public static Boolean test_is_true(){ return true; } public static int run(){ - boolean[] condition = new boolean[1]; + Boolean[] condition = new Boolean[1]; condition[0] = test_is_true(); int i = 0; diff --git a/tester/javac/TestMosaic_0.javax b/tester/javac/TestMosaic_0.javax index 8e1a782..85ab091 100644 --- a/tester/javac/TestMosaic_0.javax +++ b/tester/javac/TestMosaic_0.javax @@ -19,16 +19,16 @@ public class TestTestBench extends TestBench{ TestSuite(){ } - public boolean test_pass(ByteArrayOutputStream out_content, ByteArrayOutputStream err_content){ + public Boolean test_pass(ByteArrayOutputStream out_content, ByteArrayOutputStream err_content){ return true; } - public boolean test_fail_0(ByteArrayOutputStream out_content, ByteArrayOutputStream err_content){ + public Boolean test_fail_0(ByteArrayOutputStream out_content, ByteArrayOutputStream err_content){ return false; } // Tests if exception uncaught by the test correctly causes a failure from the TestBench. - public static boolean test_fail_1() throws Exception { + public static Boolean test_fail_1() throws Exception { int randomInt = (int) (Math.random() * 100); // Generate a random integer // Always returns true, but Java will not complain that following code is unreachable if( diff --git a/tester/javac/Test_IO.java b/tester/javac/Test_IO.java index d6621fe..7298b1d 100644 --- a/tester/javac/Test_IO.java +++ b/tester/javac/Test_IO.java @@ -28,7 +28,7 @@ public class Test_IO{ public static int run(){ IO io = new IO(); - boolean[] condition = new boolean[3]; + Boolean[] condition = new Boolean[3]; // Redirect IO streams io.redirect(); diff --git a/tester/javac/Test_Util.java b/tester/javac/Test_Util.java index 0d0edba..de046ff 100644 --- a/tester/javac/Test_Util.java +++ b/tester/javac/Test_Util.java @@ -7,33 +7,33 @@ Test_Util public class Test_Util{ - public static boolean test_all(){ + public static Boolean test_all(){ // Test with zero conditions - boolean[] conditions0 = {}; - boolean result = !Util.all(conditions0); // Empty conditions list is false. + Boolean[] conditions0 = {}; + Boolean result = !Util.all(conditions0); // Empty conditions list is false. // Test with one condition - boolean[] conditions1_true = {true}; - boolean[] conditions1_false = {false}; + Boolean[] conditions1_true = {true}; + Boolean[] conditions1_false = {false}; result &= Util.all(conditions1_true); // should return true result &= !Util.all(conditions1_false); // should return false // Test with two conditions - boolean[] conditions2_true = {true, true}; - boolean[] conditions2_false1 = {true, false}; - boolean[] conditions2_false2 = {false, true}; - boolean[] conditions2_false3 = {false, false}; + Boolean[] conditions2_true = {true, true}; + Boolean[] conditions2_false1 = {true, false}; + Boolean[] conditions2_false2 = {false, true}; + Boolean[] conditions2_false3 = {false, false}; result &= Util.all(conditions2_true); // should return true result &= !Util.all(conditions2_false1); // should return false result &= !Util.all(conditions2_false2); // should return false result &= !Util.all(conditions2_false3); // should return false // Test with three conditions - boolean[] conditions3_false1 = {true, true, false}; - boolean[] conditions3_true = {true, true, true}; - boolean[] conditions3_false2 = {true, false, true}; - boolean[] conditions3_false3 = {false, true, true}; - boolean[] conditions3_false4 = {false, false, false}; + Boolean[] conditions3_false1 = {true, true, false}; + Boolean[] conditions3_true = {true, true, true}; + Boolean[] conditions3_false2 = {true, false, true}; + Boolean[] conditions3_false3 = {false, true, true}; + Boolean[] conditions3_false4 = {false, false, false}; result &= !Util.all(conditions3_false1); // should return false result &= Util.all(conditions3_true); // should return true result &= !Util.all(conditions3_false2); // should return false @@ -43,20 +43,20 @@ public class Test_Util{ return result; } - public static boolean test_all_set_false(){ - boolean[] conditions = {true, true, true}; + public static Boolean test_all_set_false(){ + Boolean[] conditions = {true, true, true}; Util.all_set_false(conditions); return !Util.all(conditions); // Should return false after setting all to false } - public static boolean test_all_set_true(){ - boolean[] conditions = {false, false, false}; + public static Boolean test_all_set_true(){ + Boolean[] conditions = {false, false, false}; Util.all_set_true(conditions); return Util.all(conditions); // Should return true after setting all to true } public static int run(){ - boolean[] condition = new boolean[3]; + Boolean[] condition = new Boolean[3]; condition[0] = test_all(); condition[1] = test_all_set_false(); condition[2] = test_all_set_true(); diff --git a/tester/jvm/Test_Mosaic.jar b/tester/jvm/Test_Mosaic.jar index 5e80583ab14bfeace406a3829e432b0c5ff24669..acdaf46e21890c2ec3ef85b5cb0655a8fc0a77e1 100644 GIT binary patch delta 3329 zcmZ9PXEYm(+s0!gR#G)$l^9RaQc7u!P=spD3S!UNv6IFqnxZx>HEQq1rnN^=9$Rb` zo1#S39;H>@KL2yx_y3&t{&0V|&vl>c%XNO|zDK$1VPHKiDr!~$EiElz$S?s6r~K13 zh?GRbM0N^3Jci{VM_Buk)WM_GgpPnu6y|OTV3YW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-kQsKI@}qJo2V>N zFU4bu1J00h$#S^5j^bX_`Mb3f&e(X7HKitJzZ@xT((2Ux5kJ4(<~OP6m`aw?7V~oF z7kT^(*}d{-8Hy^5W<#v zu5qNAStDfE4BA{S>^@JDTJFsml@BG2gdftgeYzEe5K0sZ1HN6G7oIL@(T)(h1gbZ1 z6j#5ZhbdmGI*Kvm>#;UA5y-F8uj%$rulZATx)gqIH z-?FSI0qP2+7F;q4i+fo|m-Pu1?m2QI>?3_eH-E=i##<85%4c@2$WRp9GkKYmKq0Qu zoMl|oG&5JKA*^xqx1)pP$XBI5rz1@z5!9$_xdHXY0La~b2?yH_A*xNF)8Y9$!>Cjr z-4&-?z|PiHnG)|Ct8yOpU_h|VRrc#}pU7d*hld5jgZ|KO5s|R@EEvPTDG`LG+cG-53H6(s+Nv(b48Xk0SKjWxV zE~wLDheN!_L}L!*t9@CdTWdBdc;G^89LEe8sAp#D7G?O(Vkf(DQ4iDWc{t2+<7TqF zp78fGXV?lOTp7j)hq$g8Z}Y;QSwO5+Oy9=S|F7G>g};c`{gOR+bgWRAJl>q)or2oS z)N&Y^Gk)Sw=>Tf@NljX;&XLerb8Koh9%WQpn`{wfd%u?&I`xa8oW%jHVu6NxhJ;)w z0*Ek;GGdiqaoSbYE~xHbu;>f%+P9A_Xo2`eupqST(=+e6LFUy7diluT-j59qq`fuS z))>{rsx-03=bkW7^4Hje9r^Pa-r~hRh^iaZW-0K`OVb&oEk0;q%P)CaDGog+%ZtT8 zilTL%AghA-C;67s%(#JuXv@DCEHJC>=@;;&zNqu$7M* zrzHNtRzJfDwrFTML4R9%S`UlrA5BlAg9brQeChutl@ [filename2] ..." + echo "Usage: $(script_fp) [filename2] ..." exit 1 fi diff --git a/tool_shared/bespoke/emacs.el b/tool_shared/bespoke/emacs.el new file mode 100644 index 0000000..5ca4331 --- /dev/null +++ b/tool_shared/bespoke/emacs.el @@ -0,0 +1,52 @@ + +; The first time Emacs encounters a link to a source file, Emacs asks if it should follow it. +; This might suppress that initial question and follow the link. +; (setq find-file-visit-truename t) + +(defun jdbx () + "Set gud-jdb-sourcepath from the environment and run jdb with the correct source path." + (interactive) + (let* + ( + (sourcepath (getenv "SOURCEPATH")) + ) + (if + sourcepath + (setq gud-jdb-sourcepath (split-string sourcepath ":" t)) + (message "Warning: SOURCEPATH is not set. `jdb` will run without source path information.") + ) + (let + ( + (class-name (read-string "Enter the class to debug: " "Test_Util")) + ) + (jdb (concat "jdb -sourcepath" + (if + sourcepath + (mapconcat 'identity gud-jdb-sourcepath ":") "" + ) + " " + class-name + ) + )))) + +(defun monitor-jdb-sourcepath (output) + "Monitor the jdb output for `sourcepath ARG` commands and update `gud-jdb-sourcepath` with each path in ARG." + (when + (string-match "sourcepath \\(.+\\)" output) + (let* + ( + (new-paths (match-string 1 output)) + (paths-list (split-string new-paths ":" t)) + ) + ;; Add each path in paths-list to gud-jdb-sourcepath if not already present + (dolist + (path paths-list) + (unless + (member path gud-jdb-sourcepath) + (setq gud-jdb-sourcepath (append gud-jdb-sourcepath (list path))) + ) + ) + (message "Updated gud-jdb-sourcepath: %s" gud-jdb-sourcepath))) + output) + +(add-hook 'gud-filter-functions 'monitor-jdb-sourcepath) -- 2.20.1