Visual Studio 2019 debug embedded targets. How to force VS to not treat it as a windows executable - c

I am trying to set up Cmake ARM uC (STM32) embedded project in the VS 2019.
Project buils OK but I struggle to start the debug session.
I have amended launch.vs.json
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "cppdbg",
"name": "GCEC-FW.elf",
"project": "out\\build\\IoT-Debug\\GCEC-FW.elf",
"projectTarget": "",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}\\BUILD\\${workspaceRootFolderName}.elf",
"MIMode": "gdb",
"externalConsole": true,
"inheritEnvironments": [
"gcc_arm"
],
"miDebuggerPath": "${env.gccpath}\\bin\\arm-none-eabi-gdb.exe",
"setupCommands": [
{
"text": "-environment-cd ${workspaceRoot}/BUILD"
},
{
"text": "-file-exec-and-symbols ${workspaceRootFolderName}.elf",
"description": "load file",
"ignoreFailures": false
},
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"visualizerFile": "${debugInfo.linuxNatvisPath}",
"showDisplayString": true,
"miDebuggerServerAddress": "localhost:3333",
"launchCompleteCommand": "None",
"debugServerPath": "C:\\Program Files (x86)\Atollic\\TrueSTUDIO for STM32 9.3.0\\Servers\\J-Link_gdbserver\\JLinkGDBServerCL.exe",
"debugServerArgs": "-port 2331 -s -CPU Cortex-M -device STM32F427II -endian little -speed 4000 -vd -swoport 2332",
"serverStarted": "GDB\\ server\\ started",
"filterStderr": true,
"filterStdout": true
}
]
}
But when I try to start the debug session I am getting error stating that my .elf file is not an win32 executable (which is actually correct - it is not).
The question is: what has to be done VS to start this session?
edit
I needed to change the name when adding appending the new microcontroller debug configuration.
"name": "GCEC-FW.elf"
Now it complains about the path to the gdb.
The new question is: can I output or see build variables in VisualStudio - Like
${workspaceRootFolderName} or ${env.gccpath}

Regarding "... can I output or see build variables in VisualStudio - Like: ${workspaceRootFolderName} or ${env.gccpath}
To display all of the currently available macros, in the Property
Pages dialog, under VC++ Directories, choose the drop-down arrow at
the end of a property row. Click on Edit and then in the edit dialog
box, choose the Macros button. The current set of properties and
macros visible to Visual Studio is listed along with the current value
for each. For more information, see the Specifying User-Defined Values
section of C++ project property page reference.
More here about that.

Related

How to debug unconverted source code correctly in react18 jest unit test?

Environment:react18 source code, win10 , node v16.13.1
I'm using jest tests inside the source code to explore the react18 source code,but jest use babel to convert source code, when i debug jest unit test,it will jump to babel's converted code,it is hard to read,
So I want to ask is there any way to debug on the source code,not the converted code?
for Example:
when i debug it,it will be converted
Even in some places,It's almost unreadable:
i want to debug unconverted source code correctly in react18 jest unit test.
here is my vscode lanuch.json config:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"--config",
"./scripts/jest/config.source.js",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": {
"NODE_ENV": "development"
},
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
}
]
}
i found in 'preprocessor.js' file , it contain babel configuration
so,we just add global item process.env.JEST_ENABLE_SOURCE_MAPS : inline.

Passing targets in as a dependency and making sure they output something useful and meaningful to be consumed by next target

I am trying to get a plugin to use run-commands and I want it to run and execute a dependent task and pass the result to my command. In this case, I want to have a dependent target start up a webserver and keep it running.
I have tried to do the following and nx graph shows the right DAG but I am not seeing the output I want.
"executor": "nx:run-commands",
"options": {
"command": "./my-cli-tool --arg={frontendApp:serve}"
},
"dependsOn": [
"frontendApp:serve"
]
I know that in a monorepo tool like bazel, passing around the target like //frontendApp:serve would do what I am expecting here so I am guessing there should be a way to do this in nx.
Update: To help with debugging.
If the dependency is running, it is failing silently. I can run it individually, e.g. npx nx run frontendApp:serve. I can't see the port starting up and being taken so if something is happening, its happening silently.
dependsOn configuration looks a little different. It's in the docs here:
https://nx.dev/reference/project-configuration#dependson
Basically, you need have a local target which invokes the target in the other project.
{
"foo": {
"executor": "nx:run-commands",
"options": {
"command": "./my-cli-tool --arg={frontendApp:serve}"
},
"dependsOn": ["serve"]
},
"serve": {
"executor": "nx:run-commands",
"options": {
"command": "nx run frontendApp:serve"
}
}
}
Another option is to use Angular DevKit's allOf or concat executors for running multiple things at once:
"serve-with-graphql": {
"executor": "#angular-devkit/architect:allOf",
"options": {
"targets": [
{
"target": "web:serve"
},
{
"target": "graphql:dev-server"
}
]
}
},
https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/architect/builders/builders.json#L14-L23
allOf runs each target at the same time
concat runs them serially

Apache Zeppelin: interpreter.json keeps getting reset

I'm trying to change the default interpreter in an interpreter group.
Specifically, I'm changing
"defaultInterpreter": true,
to
"defaultInterpreter": false,
in
{
"name": "spark",
"class": "org.apache.zeppelin.spark.SparkInterpreter",
"defaultInterpreter": true,
"editor": {
"language": "scala",
"editOnDblClick": false,
"completionKey": "TAB",
"completionSupport": true
}
},
Then changing the next section (Spark SQL) to true.
But then as I restart Zeppelin, interpreter.json gets reverted.
Please advice
Ok after digging around I think I found the right place.
In interpreters/< interpreter >/interpreter-settings.json is the actual place to edit the settings.
conf/interpreter.json is generated.
I wish these things were easily found in docs or via search though, not by developers digging and trying different things.

Adding local dependency in Zeppelin Helium

I am creating a Zeppelin Helium Visualization and I need to add one local dependency. I am working on Zeppelin 0.8.snapshot version.
I am not able to do it, I have tried adding in the following manner. I tried using "*" for my modules, I also tried providing relative path without success.
My module has to be added locally.
{
"name": "zeppelin_helium_xxx",
"description" : "xxx",
"version": "1.0.0",
"main": "heliumxxx",
"author": "",
"license": "Apache-2.0",
"dependencies": {
"mymodule": "*",
"zeppelin-tabledata": "*",
"zeppelin-vis": "*"
}
}
Currently, Zeppelin doesn't support the relative path in helium json. You need to provide the absolute path for the artifact field.
Here is one example from https://github.com/1ambda/zeppelin-highcharts-columnrange/blob/master/zeppelin-highcharts-columnrange.json
{
"type" : "VISUALIZATION",
"name" : "zeppelin-highcharts-columnrange",
"version" : "local",
"description": "Column range chart using highcharts library",
"artifact" : "/Users/lambda/github/1ambda/zeppelin-highcharts-columnrange",
"icon": "<i class=\"fa fa-align-center\"></i>"
}
Additionally, there is a JIRA ticket for this issue.
https://issues.apache.org/jira/browse/ZEPPELIN-2097
And you might see an incorrect error message when you load local helium packages.
ERROR [2017-03-05 12:54:14,308] ({qtp1121647253-68}
HeliumBundleFactory.java[buildBundle]:131) - Can't get module name and version of package zeppelin-markdown-spell
Then check the artifact value again. Probably, it's invalid.
https://issues.apache.org/jira/browse/ZEPPELIN-2212

Atom custom language package not picking up file extensions or highlighting correctly

I'm trying to build a simple atom package that displays some filetypes associated with squarespace development in the correct highlighted way. Iv'e tried reading the docs and looking at related packages and mirroring mine off of theirs but it seems no matter what I do atom wont pickup that these file types have an associated language package installed, and when I manually apply my language it doesn't even highlight them correctly.
The associations I'm trying to build are
.block -> html
.region -> html
.list -> html
.item -> html
.conf -> json
.preset -> json
my package.json looks like
{
"name": "language-squarespace",
"version": "0.4.0",
"description": "Syntax Highlighting for SquareSpace files",
"repository": {
"type": "git",
"url": "https://github.com/blaketarter/language-squarespace"
},
"license": "MIT",
"engines": {
"atom": "*",
"node": "*"
}
}
and an example of one of my grammar files is
'filetypes': [
'block'
]
'name': 'block (squarespace)'
'patterns': [
{
'include': 'source.html'
}
]
'scopeName': 'source.block'
I feel like im missing something important because I based mine off of https://github.com/rgbkrk/language-ipynb and things seem to match.

Resources