How to enable debugging messages in Juno (Julia editor) - debugging

The Julia docs are pretty clear on how to enable debugging messages from #debug macros, i.e. run export JULIA_DEBUG=mymodule or export JULIA_DEBUG=all on the command line before starting Julia. However, is there an easy way to enable debugging from within the Juno, or, more generally, while Julia is running?
I tried fiddling with Base.CoreLogging.disable_logging , Base.CoreLogging.BelowMinLevel and Base.CoreLogging._min_enabled_level without success.
I know I can set env variables for Julia in the Juno settings. But that's kind of annoying to work with as it requires restarting Julia. I really want to have the following workflow while working interactively:
Enter a line in the REPL
Stumble upon a bug from your own code that you didn't see coming.
Enable debugging.
Run that line again.
See the debug logs.
Fix your code.
Disable debug logging again.
Which I think is nicer than the common practice of commenting and un-commenting printf everywhere.

Enable #debug everywhere (this will only affect code loaded after running the following expression):
julia>ENV["JULIA_DEBUG"] = "all"
Enable #debug in file foo.jl (according to docs, haven't tested this):
julia>ENV["JULIA_DEBUG"] = "foo"
Disable #debug:
ENV["JULIA_DEBUG"] = ""
important note: macros are evaluated when code is loaded. So the tricks above will only have effect on code that is loaded after changing the value of JULIA_DEBUG. So after setting it to e.g. all, nothing will have changed. Reload the modules you want to #debug.

To enable #debug messages logging in your julia script:
# ... script ...
ENV["JULIA_DEBUG"]="all"
# debug messages are now enabled.
# ... Rest of the script...
The addition of ENV["JULIA_DEBUG"]="all" will enable #debug messages when running the script in Juno or running it with Julia from your terminal.

Related

Use swc as compiler for tsc-watch

I'm trying to use the lightning fast swc compiler in tsc-watch, but it does not seem to parse it properly. I've tried various locations in #swc/cli and #swc/core, but to no avail.
I've also tried using ts-node, which has a configuration option for swc, but this also doesn't appear to work.
Here's the script I'm trying to run:
When running this, it prints the command and then stops.

configure automatic Hy REPL imports

I've been absolutely loving the Hy REPL. However it would speed up my workflow immensely if I could have a set of default imports at startup. Clojure has a way of configuring startup imports via leiningen config. Currently I load the repl this way:
path/bin/hy --repl-output-fn=hy.contrib.hy-repr.hy-repr
Similarly is there a way I can reset all imported modules from the REPL namespace without having to restart the REPL ?
Proper initialization scripts are not yet implemented. In the meantime, you can do things like
hy -i '(import math re pandas)'
or
hy -i '(import [my-init-package [*]])'
to run some code of your choice before starting the REPL.

MacOS VulkanInfo Reports 0 Validation Layers

I am getting started with Vulkan (vulkansdk-macos-1.1.126.0) on macOS (10.14.6), and have followed a tutorial in setting up an instance which all seems to go well however when I call vkEnumerateInstanceLayerProperties I get a returned layer count of 0.
At first I thought it could be my build arguments/variables, however when I run the vulkanInfo application supplied with the tar.gz it also reports there that there are no layers (Layers: count = 0). I then tried to add environment variables:
PATH=$PATH:$VULKAN_ROOT/bin
export VK_LAYER_PATH=$VULKAN_ROOT/etc/vulkan/explicit_layers.d
export VK_ICD_FILENAMES=$VULKAN_ROOT/etc/vulkan/icd.d/MoltenVK_icd.json
export VK_LAYER_PATH=$VULKAN_ROOT/etc/vulkan/explicit_layers.d
export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation vulkaninfo
#export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation vulkaninfo
and launch vulkanInfo from the terminal. Maybe it is a Mac trying to be too secure issue or has something to do with file permissions. Any suggestions are appreciated since this will seriously hamper debugging.
So as you'd expect I was doing something wrong, just doing 2 different things wrong:
- for launching vulkanInfo from the terminal, you can see that I wasn't exporting the PATH variable.
- for VSCode (where I am building the application) I had the VK_ICD_FILENAMES and VK_LAYER_PATH as preprocessor definitions, not as launch environment variables (set in the launch.json, environment name/value map).

Running a command line for groovy from XCode after unit testing

I edited my target scheme to run a script action after testing as below
Target Scheme -> Test (Debug) -> Post Actions
The script hw.sh had a simple command line call:
open /Applications/Safari.app/
It worked fine for the above script. When I changed it to the following
groovy http://frankencover.it/with -s /Users/sasokan/Downloads/MyProject
Nothing happened. How can I call this groovy application using a script.
I am also trying to run frankencover.it and had the same problem you did. I eventually found this answer on SO that lead me to a solution. I added the following before calling frankencover.it and it fixed the issue.
PATH=${PATH}:/usr/local/bin
I will further note that even if you use the full path to groovy in the command frankencover.it will fail internally because it cannot find 'lcov' for the same reason.

Control Fujitsu Softune debugger

Is there a way to control the Fujitsu Softune debugger with an other application(e.g. Eclipse)? I think about sending the command mentioned in the documentation of Softune and parse the output, but also other approaches are welcome.
There is pluging for eclipse; file name is "FujitsuF2MC16_1.0.1.jar", look for it on this page:
http://www.mikrocontroller.net/topic/70413
Complile en debug in eclipse.
Hope this helps.
What do you mean by controlling the Fujitsu Softune debugger?
If what you want to do is to start a debugging session with your freshly-compiled .abs file, you can do the following.
In the Eclipse environment add a button or shortcut to call the make utility to make a debug:. Your makefile would have an entry like:
debug: $(make_vars)
# start debugger
make -f$(make_vars) -f$(make_dir)/$(cfg) cfg="$(cfg)" debug_session
In the make entry for debug_session you put something like:
echo UPDATING SOFTUNE-3 PROJECT FOR DEBUGGING;\
$(subst \,/,$(DIR_SOFTUNE_WORKBENCH))/bin/Fs907s.exe softune/E7x_proj.wsp 2>/dev/null;
I hope this was useful.

Resources