I use the command sam local invoke 'functionName' -d 5858 to debug lambda function locally in terminal/cmd window with VSCode (The terminal is open in a separate window, not in VSCode). The problem I am facing is that the the debug session does not exit in terminal/cmd when I press CTRL+C (or any other exit method). The only way I can exit the session is by starting the debugger in VSCode and then click on disconnect the debugger from within VSCode. I am not sure if this issue occurs for everyone.
Is there any way I can directly end the session from terminal/cmd without having to start the debugger in VSCode?
Here is the link to AWS Docs which has the steps to debug lambda functions locally:
Step-through debugging Lambda functions locally
I'm trying to use the flash debugger, where I made a mistake on purpose to test out the debugger. Whenever the error is shown it is only shown in the terminal, and I can't access the localhost to test it.
I have
app.debug = True
But it only shows the stack trace in the terminal when I run.
flask run
when I run
python routes.py
I see the line where the error happened.
But how can I see the interactive debugger in the browser window?
Try setting the environment variable FLASK_ENV=development
This seems to be the suggested way to enable interactive debugging and other nice to have development features when using the flask run command.
Alternatively you can set FLASK_DEBUG=1 to just enable the interactive debugger
I try to use vscode to debug Expo project.
The expo works fine, setting are as bellow:
Expo XDE: Host: Tunnel
Development Mode
iOS Simulator: Enable Remote Debugging
But when I add Debug in Exponent in VSCode, and click debug,
it will pop up Debug adapter process has terminated unexpectedly without showing any further information.
DEBUG CONSOLE show nothing.
What should I do to finding out what's going on ?
By the way, I didn't see the file ${workspaceRoot}/.vscode/launchReactNative.js
but I have see someone said that this file is not needed.
instead of 'debug in exponent' select 'attach to packager' (but dont click the green arrow yet)
change the packager port (because expo packager defaults to 19001 instead of 19000)) by adding the line "react-native.packager.port": 19001 to user's settings.json
run the app on metro's web ui or by command line (npm run ios/android [or yarn])
click the green arrow to start debuging on vscode
then start the "Remote JS Debugging" on simulator, emulator or device
I would like to customize my remote debug session when debugging with netbeans 8 (from a windows machine).
In the gdb log, I have this line:
&"C:\Users\xxx/.gdbinit: No such file or directory.\n"
I have created such a file, but it's still ignored in my gdb session. It is probably a bug in Netbeans + Windows.
Is it possible to configure the Netbeans' gdb to use a custom configuration ?
There is an option about the debug session in the projet properties.
Here it is possible to give a file location for the gdbinit to be loaded.
For a remote debug session the path must match a valid .gdbinit on the remote machine.
Is it possible to debug a uwsgi application using an ide like PyCharm? I can debug flask based apps fine by running them directly from pycharm but cannot even run a uwsgi app from within pycharm.
Do I have to use remote debugging? Is it possible to start a uwsgi app from within pycharm using run?
You can still run your WSGI app outside of uWSGI for development and debugging purposes.
However sometimes this is not possible, for example if your app relies on uWSGI API features.
As far as I know you can't use "Attach to Process" from PyCharm because your WSGI app is running embedded into uWSGI, and there are no visible Python processes. Remote debugging however works like a charm.
Locate pycharm-debug*.egg files in your PyCharm distribution. For example, on OSX both can be found in /Applications/PyCharm.app/Contents
Copy pycharm-debug-py3k.egg next to your Flask app, or copy pycharm-debug.egg instead if you are using Python 2.7
In PyCharm, create a "Python Remote Debug" configuration from "Run/Debug Configurations" dialog. In this example I use localhost and port 4444. This dialog will show you the corresponding pydevd.settrace(...) line.
Add the following code to your app :
import sys
sys.path.append('pycharm-debug-py3k.egg') # replace by pycharm-debug.egg for Python 2.7
import pydevd
# the following line can be copied from "Run/Debug Configurations" dialog
pydevd.settrace('localhost', port=4444, stdoutToServer=True, stderrToServer=True)
In PyCharm, start the remote debugging session. PyCharm's console should display the following line :
Waiting for process connection...
Run your app from uWSGI as usual. It should attach to the debugger, and PyCharm's console should display :
Connected to pydev debugger (build 139.711)
Your app should break on the pydevd.settrace(...) line. You can then continue and use PyCharm debugger as usual (breakpoints and so on)
Not sure how to interpret your question, as you are mixing apples and oranges. Flask is a framework, uWSGI is an application server. I'll try to answer, though.
As far as I know, uWSGI is not pure python, so debugging it in PyCharm will not be trivial, if even it is possible.
However, since you are using uWSGI to run your application, I'm assuming it complies with the WSGI protocol. In that case, for debugging purposes, you can alternatively run it from a simple pure-python application engine like wsgiref.simple_server.WSGIServer.
There is now an official guide on how to do this:
https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#
If your code already exists in remote, you only need to follow Create a run/debug configuration
You'll need the IP where the PyCharm is running. When you run the remote debugger from PyCharm, it'll create a debugging server. Your code will connect to this server.
In my case, I'm using Vagrant, with private IP of the guest 192.168.0.3, and the host's private IP is 192.168.0.1.
My code in the remote guests will connect to the debugging server through the host IP. So I need to use my host IP in the code that I want to debug.