How to use the OpenEdge debugger (OpenEdge Debugger 11.6) - debugging

I'm working with OpenEdge Progress-4GL AppBuilder and Procedure Editor, and now I'd like to start working with the OpenEdge Debugger, release 11.6.
As found on quite some places on the internet, I've taken following actions to enable debugging of my Progress application:
Using Proenv, I've launched following command:
prodebugenable -enable-all
I get following response:
OpenEdge Release 11.6 as of Fri Oct 16 19:01:51 EDT 2015
==============================================================================
PROGRESS Debug Enabler
==============================================================================
Debugging is enabled for the Progress 4GL installed in
C:\PROGRE~1\OpenEdge.
For your information, some information on environment variables:
proenv>set DLC
DLC=C:\PROGRE~1\OpenEdge
proenv>set WRK
WRKDIR=C:\OPENED~1\WRK
proenv>set ENABLE_OPENEDGE_DEBUGGER
Environment variable ENABLE_OPENEDGE_DEBUGGER not defined
As far as my application is concerned, the application is based on a shortcut, which looks as follows:
C:\Progressx86\OpenEdge\bin\prowin32.exe
-basekey "INI"
-ininame c:\progress\our_application\progress.ini
-pf c:\progress\our_application\misc\run_our_application.pf
-p our_application.r
-rr
The file "run_our_application.pf" contains a list of entries, like the following:
-db our_DB
-H DC1
-N tcp
-S 6543
To the mentioned shortcut, I've added -debugReady 5001 in order to enable debugging, based on TCP portnumber 5001. When I launch the application, I get a warning message about this, and netstat -aon gives me following entry:
TCP 0.0.0.0:5001 0.0.0.0:0 LISTENING 11344
Where 11344 is confirmed as the prowin32 application.
In OpenEdge debugger, I've following entries in menu item "Edit", "Preferences", "Attachable":
C:\progress\our_application
Z:\Progress\our_application\PRG
C:\Progressx86\OpenEdge
For your information: The Z:-drive is an external server drive, Z:\Progress\our_application\PRG is the directory where files (*.w and *.p) get compiled into *.r files, the file our_application.r can be found there.
Nevertheless, when I open a *.w file and I go to the menu "Debug", the "Attach to Process" menu item stays disabled.
What can I do in order to debug my application/*.w file?

There are several ways of debugging. Start simple. You should be able to use any of the following:
from the procedure editor
Instead of selecting [ Compile / Run ], select [ Compile / Debug ]. The AVM will start executing the current file and the debugger will suspend execution on the first line.
from any alert-box
Add -debugalert to your startup parameters and every alert-box will display an additional 'Help' button. Clicking on it will show the stack-trace and a 'Debug' button. Clicking on that will start the debugger, execution is suspended at the line of the alert-box, this can be your own alert-box or an error.
stand-alone debugger
Start the debugger application (the Windows shortcut starts proDebugger.bat) and select [ Debug / Attach To Process... ] you can then either enter a PID or select a local running session (AVM).
remote attachable debugger
This is what you seem to be trying to setup - this allows you to attach the stand alone debugger (see option 3) to a process running on another machine, this can be useful when you have an AppServer or WebSpeed agent that you want to debug.
PDSOE debugger
Not relevant for you since you are not using Progress Developer Studio for OpenEdge, but just mentioning it for completeness. This allows adding break points in your source code by double clicking in the left margin and stepping through your source code instead stepping through a debug-listing.

Related

Why do I have these paths in Intellij IDEA console?

I've just installed IDEA on my new PC and when I try to run my project, before the result I see these paths:
"C:\Program Files\Java\jdk-11.0.2\bin\java.exe" -javaagent:C:\JetBrains\IntelliJ_IDEA_Community_Edition_2019.3.3\lib\idea_rt.jar=55779:C:\JetBrains\IntelliJ_IDEA_Community_Edition_2019.3.3\bin -Dfile.encoding=UTF-8 -classpath "C:\Users\Hor\IdeaProjects\HF Java\out\production\HF Java" Ch3.
14 //result
Process finished with exit code 0
I didn't have that on my previous PC. How do I solve the problem? I'd like not to see this 'pathway' line..
There is no explicit setting responsible for displaying the system message in the 'Run' tool window (Alt+4) - other than File | Settings | Editor | Color Scheme | Console Colors > 'Console' section > 'System output' option.
However, if you run your application via the 'Services' tool window (Alt+8), the system message will be partially folded and faded:

How do I configure Aptana 3 to run my Rails server in debug mode so it stops on breakpoints?

I'm using Aptana Studio 3 on Mac OS X. I'm trying to run my server in debug mode so I can set breakpoints and step through my code. I created the below debug configuration
with the "server" argument ...
However, when I start my server in debug mode (by right clicking on my project, selecting Debug As -> Debug Configurations and clicking the "Debug" button on the resulting dialog after I've selected the above configuration), the server starts up, but when I invoke code (using a curl command) to invoke the method, the curl method hangs, seemingly at the breakpoint ...
In the Aptana Studio console I see the "entered create" output, but I don't see the "done building" line. But the Aptana IDE doesn't highlight the line where I set the breakpoint like I'd expect it to. Below is the Aptana console. What else do I need to do so that I can interact with the IDE properly in debug mode?
Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1, file filtering is supported) listens on 127.0.0.1:50900
=> Booting Puma
=> Rails 5.2.2.1 application starting in development
=> Run `rails server -h` for more startup options
[79989] Puma starting in cluster mode...
[79989] * Version 3.11.4 (ruby 2.5.1-p57), codename: Love Song
[79989] * Min threads: 5, max threads: 5
[79989] * Environment: development
[79989] * Process workers: 2
[79989] * Phased restart available
[79989] * Listening on tcp://0.0.0.0:3000
[79989] Use Ctrl-C to stop
[79989] - Worker 0 (pid: 80014) booted, phase: 0
[79989] - Worker 1 (pid: 80015) booted, phase: 0
Started POST "/users" for 127.0.0.1 at 2019-10-13 13:44:17 -0500
[1m[35m (5.5ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
Processing by UserController#create as JSON
Parameters: {"first_name"=>"Dave", "last_name"=>"Smith", "email"=>"test#example.com"}
entered create
The approach which you have taken is correct and as far as i know the steps to set debug configuration is also proper .
Approach 1 to Fix :
Use the rails s --debugger and check whether its working.
Approach 2 to Fix :
Try once by updating the to ruby-debug-base19 (0.11.25) ruby-debug-ide19 (0.4.12) ruby-debug19 (0.11.6) and verify once.
Approach 3 to Fix : Remote Debugging ::
As the netbeans & Aptana share the same debug core , we can do a remote debugging too , the thread mentioned here can help . Remote debugging Rails application in Aptana Studio 3 we can follow the steps in order to ensure remote debugging works.
Basically, run the ruby app using rdebug-ide -p 7000 (or whatever port you want), then inside the IDE, go to Run > Debug configurations. On the left hand side, select "Remote Ruby Debug Session" and then add a new configuration there (the plus icon above the list). Enter the proper host IP/name and port you entered on the command line.
How do we debug if we have a rake file and tasks to execute ?
If we are using a rake file and tasks to execute , you can have the reference in the thread here How to debug ruby tests in Eclipse/Aptana Studio?
1. Run > Debug As > Debug configurations. Then add an entry under Ruby application. Point it at your rake script path (say /usr/local/bin/rake) as the file to launch.
2. The Arguements should be edited to pass in your app's Rakefile as the first arg and the rake task as the second arg. (i.e. /my/path/to/project/Rakefile build).
Note :
Sometimes there might be a possibility of a specific gem causing a issue , if we remove a gem and then bundle it and try it might work out , try this if nothing works out.

Unable to start debugging on bash on Windows within Visual Studio Code

I have installed WSL(Ubuntu on Windows) and gcc/gdb, and open a directory in Visual Studio Code, then click Debug Menu | add configuration, select C/C++:(gdb) Bash on
Windows launch, press F5,get the message:
Unable to start debugging, Unable to establish a connection to GDB, ...
output in debug console:
Starting: "C:\Windows\sysnative\bash.exe" "/usr/bin/gdb --interpreter=mi"
"C:\Windows\sysnative\bash.exe" exited with code -1 (0xFFFFFFFF).
I don't have enough points to leave a comment, but could you paste your
configuration in launch.json? One issue I have seen is that "/usr/bin/gdb --interpreter=mi" gets treated as single string instead of calling gdb with an extra flag. Updating my configuration with the following flag in pipeArgs fixed the error for me.
"configurations": [
...,
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
...
"pipeArgs"; ["-c"],
}
]

Netbeans: C code debug hangs on start

When I start debug in Netbeans, nothig happens. Output strings don't apper; Pause, Continue, step buttons are inactive (only Stop debug button and restart button are active). Stack window is empty.
I tried to run process in shell and attach to it by Netbeans debug. Message with caption "Debugger error" appeared, it contained a text: \320\235\320\265\321\202 \321\202\320\260\320\272\320\276\320\263\320\276 \321\204\320\260\320\271\320\273\320\260 \320\270\320\273\320\270 \320\272\320\260\321\202\320\260\320\273\320\276\320\263\320\260.
Project is compiled with -g flag; gdb version is: GNU gdb 7.0.1-debian; Netbeans version is 7.1; In DDD tool debug for this program works fine.
In my case the cause was a bad variable in the Watches. I couldn't delete it while debugging was hanging. So I had to open the variables window manually while not building/debugging (Windows -> Debugging -> Variables). After deleting the bad variable, everything was fine.
Basically I deleted all variables, since I couldn't figure out, why gdb or netbeans disliked something like:
(char*)_Foo->Bar->Fail. During the previous debugging run this watch worked fine.

Custom debug command in Visual Studio using a Makefile project

I have a Makefile-powered project in Visual Studio 2010 (uses NAnt, in fact, but that's beside the point).
The output of the build process is a .elf file, and I have a separate, non-VStudio debugger which can be run on that .elf file to debug it.
Building works fine, but when I click the 'debug' button (little green triangle), VStudio fails with "Unable to start program 'XXX.elf'. The specified file is an unrecognized or unsupported binary format"
I'm guessing VStudio is just trying to 'run' the .elf as though it were an .exe, and failing.
What I really want VStudio to do is run "my_debugger.exe XXX.elf" when I press the debug button.
I have tried adding a file association with .elf=>my_debugger.exe
I have updated PATHEXT appropriately as well, and run VStudio under those changes.
Still no luck.
Isn't there somewhere in VStudio where you can specify a custom debug command? I thought there was, but can't find it.
I could just have the build process output a .bat file or something I guess, but this seems silly.
As Jim mentioned you can specify which app to start on run in the project settings (Command field). If you place a debugger there you can pass down your executable as an argument to the debugger being launched (Command Arguments field). This way you can launch the debugger which in turn will launch your executable if the debugger expects any commandline arguments.
MinGW on Windows example:
Command: gdb.exe; Command Arguments: Path\ToMyApp\whatever.exe
will start gdb.exe, gdb.exe will open whatever.exe, parse the debug info and wait for debug instructions.
Command: msys.exe; Command Arguments: gdb.exe Path\ToMyApp\whatever.exe
will start msys.exe, msys.exe will execute "gdb.exe Path\ToMyApp\whatever.exe"
Look at the project properties. Do you have a Debug tab which has a Start Action section giving three choices? Those choices would be: ( ) Start project, (x) Start external program: ... ( ) Start browser with URL.
You can also set the command line arguments and working directory.
Cf. How to: Change the Start Action for Application Debugging

Resources