having issues getting Visual Studio Code + Remote-SSH & Native debug to connect to openocd (i.e. gdbserver) - ssh

Is there a way to turn on some kind of log output from Visual Studio Code to figure out what is going on with a debug connection to a gdbserver (in this case openocd)?
I am running Visual Studio Code on MacOs with the Microsoft extension Remote-SSH and Native debug. Using the Remote-SSH I am connecting to a CentOS system and have been able to edit and debug code there. I can debug command line C & python using gdb without issues, but have been unable to connect to an openocd gdbserver using the following setup in my launch.json file:
```{
"name": "gdb remote",
"type": "gdb",
"request": "attach",
"remote":true,
"executable": "${WorkspaceFolder}/build/xyz.elf",
"gdbpath": "/usr/bin/gdb",
"debugger_args": ["-ex \"source ~/platform.gdb\""], //sets the correct architecture
"target": "A.B.C.D:10010",
},```
When I try to run the remote gdb debug in the launch.json above everything looks happy at first. I get the debug bar with all the expected buttons on it, but it won't do anything. If I check the openocd output it does not tell me that there have been any gdb connections. If I run gdb from the command line on the remote system, set the appropriate architecture and execute "target remote A.B.C.D:10010" I connect without issues and openocd informs me that there has been a connection. Any suggestions or help in debugging why VSCode doesn't really connect would be greatly appreciated.
P.S. I am a recent convert to Visual Studio code from another editor and am not completely familiar with all of its settings. This recent switch in editors is due to the recent work from home mandate making my old XWindows editor impossible to use over VPN. VSCode with the Remote-SSH seems to be the best solution I have found so far, so I am very eager to get the gdb with target remote working.

Just to see the logged output of VSCode wrt SSH, which is not directly solving your problem, try this in VSCode on your Mac:
View -> Output. A window should show up in a panel named "OUTPUT". There may be several other panels, such as "PROBLEMS", "DEBUG CONSOLE", "TERMINAL".
Each of these panels has a dropdown in the upper right hand corner.
In "OUTPUT", select the drop-down, and you should be able to find "Remote - SSH" that will show a log of what happens when you connect.

Related

Visual Studio Code test sidebar button disappeared

I restarted VSCode because there were some problems with it, and now the test button on the left, the one that looks like a flask, has disappeared! I tried to run the command "Test: Run All Tests", but I get a message "No tests found in this workspace. You may need to install a test provider extension". Did I just accidentally uninstall test support in VSCode??? I can still run pytest from the command line and that works fine.
EDIT
Please read my own answer below.
OK I found out the problem myself. It seems that there is another Python executable on my Windows machine, which seems to have come with VSCode itself, at C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe. Somehow when I restarted VSCode, that Python executable was selected, and it didn't have pytest or even unittest or anything I don't think, so I guess VSCode saw that there was no testing capability at all and didn't bother showing the test button. It seems insane that VSCode comes with its own Python executable though, I wonder why that is.
EDIT
Oh oops it's Visual Studio that came with the Python executable, not VSCode, obviously as the path suggests. My bad.

VS Code fails to automatically recognize AZ-3166 dev kit

According to the documentation,:
Start VS Code and then connect the DevKit to your computer. VS Code automatically finds the DevKit and opens an introduction page.
But this is not happening. No error is thrown, but nothing happens. I can hear a tone from the computer when the AZ-3166 is plugged-in. It shows up as a storage device on the PC. And the Arduino IDE is able to recognize it.
But VS Code ignores it and does not take me to the introductory page, so I am unable to complete the documented process of connecting to Azure.
I come across this issue as well.
You can resolve this manually by pressing F1 and typing in the command Arduino: Board Manager. From there look up MXChip - Microsoft Azure IoT Developer Kit and install the latest version. From there you should be able to proceed as normal.
Is there a workspace open? If so, try closing it (File > Close Workspace) then close VSCode, reopen and connect your device.
It works for me. Good luck.

Worklight Console can not be opened because the Worklight Server is not running

I'm just getting started with some of the samples at the Getting Started site, working with the Developers Edition. Whenever I Open Worklight Console, the eclipse environment abends. I'm sure I missed a set up item, but all seemed to install well. I appreciate any help / direction. Thanks.
I tried to post an image of the error, but stackoverflow indicates I need 10 reputations to post an image. Go figure.
The first line is Java was started but returned exit code=8096
There are some hits on this indicating that the license may not be compatible with the Rational license installed. Not sure what to do with that.
There's another post indicating Environment Variable corruption, but I don't have the corrupt Temp environment variables indicated.
StackOverflow has a FAQ explaining what one can and cannot do and when. It makes sense. Read it.
Did you at least create a new Worklight project and application?
If you do that and run the application by right-clicking on the application in the project tree and choose Run As > Run on Worklight Development Server this will: start the server + build the app + deploy the app.
Then you can right-click on the project icon and choose Open Worklight Console and you will see the console...
So unless you have some errors preventing the server from loading, the above should work.
Host the image elsewhere, like imgur.com
Explain what you have installed in your Eclipse. Which Eclipse is it? Did you install only Worklight Studio, or another plug-in in addition? Which?
What are those "hits" you mention? Elaborate.
Searching for the exit code in Google, I see the following IBM tech notes:
http://www-01.ibm.com/support/docview.wss?uid=swg21303648
http://www-01.ibm.com/support/docview.wss?uid=swg21567836
http://www-01.ibm.com/support/docview.wss?uid=swg21627887
Perhaps one of them is relevant for you as well.
If you have followed Idan's advice to Run on Worklight Development Server and it is still not started, try this:
Switch to the Servers view (on the bottom pane of Eclipse by default).
Check your Worklight Development Server status
Right-click and select Clean...
Select OK when prompted to discard all publish start.
Redeploy your app using Run As > Run on Worklight Development Server
I am not sure if this would clean up your environment variable error message as I have not seen that one, but it has helped with several other errors that have caused my server to not start or run properly. (The most common one I get is an Out of Memory in the server.)

Android Studio (Intellij Idea) - run/debug configuration - remembering which device to run on

I guess this is a bit of a longshot, but with Eclipse, if you were using an Android emulator which was not the included one (for example, VirtualBox), you could select it the first time you ran your program, and tick a checkbox saying "Use this device for future launches". But the same option does not exist in Android Studio (Intellij Idea), meaning you have to choose the emulator every time you want to run the program.
I'm wondering if anyone knows of any way I can hack this so it will always run on a particular emulator which is not the built-in emulator. Can I put the emulator's ip address and port into a config file somewhere so the program will always launch on it without me having to click? I know it's a small thing but it's just convenience.
Sure it does, click the dropdown next to the run config, and press "Edit Configurations"
You can then select an Emulator, A Device, or to ask you when you run the app (like you have now).
The correct answer is to select USB device as the default. The program will then automatically run on the connected Virtualbox emulator. The answer was provided by sasha_trn in this comment

How to attach to WWAHOST from Visual Studio 11

If I F5 a Windows 8 JavaScript app and look at the processes pane in VS11, I see that it's WWAHOST.exe that I'm attached to. Is it possible to attach to this after the fact using Debug | Attach to Process? I don't see it in the process list even when I show processes from all users. I see the same thing whether I run locally or in the Simulator. Thanks.
There are effectively two ways to do this. Delay starting the app and attaching the app. You will need to install the remote debugger from Microsoft. As of this writing, it is located on http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=28973
Detailed steps plus explanations are here.
Summary:
Install VS remote tools
On start menu, launch "Debuggable Package Manager" (powershell will start)
using powershell: get-appxpackage (to locate your package)
using powershell: enable-appxdebug PackageFullName
Launch application
Attach to the correct wwahost.exe for your application.
Debugging Topics Located here.