Tag Archives: debugging

Error while trying to run project:unable to start debugging.the debugger is not properly installed. run setup to install or repa

Error while trying to run project:unable to start debugging. the debugger is not properly installed. run setup to install or repair the debugger。

Solution 1: Run the Visual Studio .NET Add/Remove feature from “Control Panel > Add or Remove Programs”, by selecting the correct version of Visual Studio and clicking on “Change/Repair” button. In my case this solution did not fix the problem.

Solution 2: Reinstall .NET Framework debugging services.

Open command prompt
Type “cd /d %windir%/Microsoft.NET/Framework/”
regsvr32.exe mscordbi.dll
Unfortunately, this solution did not fix my problem either.

Solution 3: Manually register mdm.exe.

Open command prompt
Type “%CommonProgramFiles%/Microsoft Shared/VS7Debug/mdm. exe” /regserver
This solution did not work for me either.

Clion breakpoint not triggered debugging no response to solve the problem

When using clion to debug C + + code, there is no response when debugging after adding breakpoints, and breakpoints are not triggered. After checking some materials, we found that there was a problem. When compiling, we need to set the debug mode in cmakelists. The solution is to add the following code to cmakelists:

set(CMAKE_BUILD_TYPE Debug)

When recompiling and debugging, breakpoints can be triggered normally.

Visual studio 2012, a complete collection of solutions to flash back windows after running

Visual Studio 2012, flash back window after the solution of operation

I believe you all have a kind of want to beat the rhythm of the person, every time to write the code, after the code is written, run the compiled code but the result of window flashback, below, I will introduce several solutions to Visual Studio 2012 run window flashback method. I hope I can help you solve this problem.
Method 1: Press Ctrl +F5 to run the program, and then run the program.
This method is only to solve the general flash back, rookie level novice if there is a flash back, might as well try this method, Xiaobian when just contact VS, is to use this method to solve.
//add system(“pause”) before Main’s returrn = 0;
This method can solve most of the flashback problem, of course, some more advanced, Xiaobian temporarily do not know whether this method has any effect, and so on later contact will be constantly updated.
Method 3: Use getchar() before return. This method can also solve the flashback problem, but you have to try it out slowly.
Method 4: Flashback will occur when an exception is encountered. To solve this problem, it is generally necessary to check the various plug-ins of VS itself, which may be caused by the expiration of plug-ins.
Method 5: you can try to set the debugging type to native or mixed only, this method is not always effective, the specific effective Xiaobian has not found the result, know the dear friends can also reply.
Inline void keep_window_open(char ch; cin> > ch;) , then add keep_Window_open() to the end of the mian function; This method is the most effective and the most commonly used, and the most effective method. (Recommended)
Method 7: Set breakpoint debugging method, press F9 to set breakpoint, press F10 to step debugging. This method is also very effective in finding errors.

The above is a summary of the solution to VS2012 flashback method, there are mistakes please point out, Xiaobian in this thank you. Of course, if there are other ways to reply, so that more latecomers can see, no longer bothered by the problem. Thanks for the flowers

Vs debug window flashback

There are three ways:
1. Start debugging Don’t use this button: directly Ctrl+F5 start. The effect is as follows:


2. Add the system (” pause “);
#include< stdio.h>

the main () {
printf (” Hello, World! \n”);
system (” pause “);
}
The effect is as follows:


3. Add _getch ();
#include< stdio.h>
#include < conio.h>

the main () {
printf (” Hello, World! \n”);
_getch ();
}
The effect is as follows:

Vc2010 configuring OpenGL environment

Glut32.Lib Glut32.dll and Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h
2, the glut. H in the C:/Program Files/Microsoft SDKs/Windows/AA/Include/gl v7.0 directory; GLUT32. lib: C:/Program Files /Microsoft SDKS /Windows/ V7.0a/lib Glut32.dll is placed in the C:/WINDOWS/system32 directory
3. Create a new empty project in VS2010 and select Win32 Console Project
 
4. Add a.cpp file to the project with the following contents:
# include “stdafx. H”
#include< gl/glut.h>
 
Void myDisplay (void)
{
GlClear (GL_COLOR_BUFFER_BIT);
GlRectf (0.5-0.5 f to 0.5 f, f, 0.5 f);
GlFlush ();
}
Int _tmain(int argc, _TCHAR* argv[])
{
GlutInitDisplayMode (GLUT_RGB | GLUT_SINGLE);
GlutInitWindowPosition (100, 100);
GlutInitWindowSize (400, 400);
GlutCreateWindow (” the first OpenGL program “);
GlutDisplayFunc (& amp; myDisplay);
GlutMainLoop ();
Return 0;
}
5. Set the IDE environment: project->; new Property-> Configuration propertites-> linker-> Input-> Additional dependencies
OpenGL32. lib GLUT32. lib, apply, confirm.
 
 
6. F5, Start Debugging, you should see a window with a white square in the middle.

Analysis of the causes of errors in G + + compilation “was not declared in this scope”“

When compiling the program, prompt: “Was not declared in this scope”.

This is the simplest case ~ but I often make the mistake (basic is also the reason of this a few of the most likely)

in addition, the Internet was also pointed out the following reasons can cause the prompt error:
2. A dependency error occurred when header files #include each other. For example, the header file forms a circular dependency,

/***file a ****/
#ifndef FILE_A_
#define FILE_A_
#include <file b>
#endif 


/****file b ***/
#ifndef FILE_B_
#define FILE_B_
#include <file a>
#endif 

If variables, functions, and classes in file A are used in file B, then #ifndef and #define are used in file B, and #include <; file a> Unable to execute #include 3. Header file name when accidentally and header files in the library name repetition, and in the program using the library of the header file.
so, will cause the macro name repetition, there must be a header file for # # ifndef lost effect. Was not decleared in this scope?The header file was not decleared in this scope

Workaround: windowserror: [error 193]% 1 is not a valid Win32 Application

WindowsError: [Error 193] %1 is not an valid Win32 application

Specific solutions:

This is because your computer is 64-bit

But your file is 32-bit, so you have this conflict

By this point, you should know that you have deleted the 32-bit Python download

There’s a similar answer on StackOverflow, you can click on it and see

Python Download interface portal, click to access

Python3 is best downloaded

Python 3.5.4 rc1-2017-07-25
Download Windows x86 executable installer

Python2 is best downloaded

Python 2.7.14 rc1-2017-08-27
Download Windows x86 MSI installer

Afterword.
Finally, the old formula, publicity a wave of their own public number! (Attention!)
I in the big house, welcome everyone to pay attention, please sweep the following two-dimensional code (‘ ▽ ‘ ‘”)

If you feel helpful, you can scan the code, praise and encourage! Thank you very much!

Solution windowserror: [error 193]% 1 is not a valid Win32 Application

WindowsError: [Error 193] %1 is not an valid Win32 application

Specific solutions:

This is because your computer is 64-bit

But your file is 32-bit, so you have this conflict

By this point, you should know that you have deleted the 32-bit Python download

There’s a similar answer on StackOverflow, you can click on it and see

Python Download interface portal, click to access

Python3 is best downloaded

Python 3.5.4 rc1-2017-07-25
Download Windows x86 executable installer

Python2 is best downloaded

Python 2.7.14 rc1-2017-08-27
Download Windows x86 MSI installer

Afterword.
Finally, the old formula, publicity a wave of their own public number! (Attention!)
I in the big house, welcome everyone to pay attention, please sweep the following two-dimensional code (‘ ▽ ‘ ‘”)

If you feel helpful, you can scan the code, praise and encourage! Thank you very much!

(springmvc) Failed to load resource: the server responded with a status of 404 (Not Found)

Today, I plan to upload the plug-in function I wrote to Github, create a new Java project, which USES the Spring MVC framework, and then debug the page when I found that I could not find the static resource file, as shown in the figure below:

So I checked the path of the page resource on the JSP at the first time:

<link rel="stylesheet" type="text/css" href="css/amazeui.min.css">
	<link rel="stylesheet" type="text/css" href="css/amazeui.cropper.css">
	<link rel="stylesheet" type="text/css" href="css/custom_up_img.css">

After confirmation, the path was found to be correct:

Friends can refer to my file path, if the path is wrong, then you can change the path to solve the problem.
Then I go on to my question, which is obviously not a path problem, so what is the reason why the page cannot find the static file?I finally saw the console output the following message:

Interpretation, i.e., when the request distribution, did not find “/ ScreenshotForUpload/CSS/amazeui. Min. CSS” mapping (No mapping found for…) “And I found out what the problem was. It turns out that spring MVC is blocking the request of a page to a static resource, but your controller does not have the mapping of this path, so the page request to a static resource file is not issued correctly. So how do you solve this problem?The following methods are given for reference:
Solutions:
1. Adopt & lt; mvc:default-servlet-handler /> . Add the following sentence to the SPRING MVC XML configuration file: < mvc:default-servlet-handler /> . As shown in the figure below:

After joining, Spring MVC will screen the URL entering the DispatcherServlet, and if a request for static resources is found, the request will be processed by the default Servlet of the Web application server, and if it is not a static resource, then the DispatcherServlet will continue to process. This method is the fastest.
2. Use & lt; mvc:resources /> . You can use < mvc:resources /> , and put the static resources in the Web-inF directory (or wherever you like), then add the following configuration in springMVC-Servlet:

<mvc:resources location="/File floder" mapping="/mapping path"/>

Fill in the path according to the actual situation.
3. In the web.xml file, change the blocking path of Spring MVC to/SpringMVC /* (” SpringMVC “can be replaced with your preferred path), as shown in the figure below
thus distinguishes “requests to Spring MVC” from “requests to static resource files”, but has the disadvantage that all your MVC requests must start with “/ SpringMVC “.
The problem that the static resource file cannot be found caused by Spring MVC can be said to be relatively secret. Novices may be unable to find the root of the problem for a while. I hope this article can provide you with help!

Failed to connect to remote VM. Connection reused. Connection reused: Connect

as shown in the figure:

:

solution 1 : the service is started under the root account, turn off the service, kill the process, and then log in with a normal user to restart the service!

solution 2 : find run-debug Configurations -remote Java Application find the corresponding project under connect’s tag set port to 8000 (which means invalid in my case)

If

still doesn’t work, delete all WebViewHistory under Remote Java Application. Instead of creating a new one, Debug it and Eclipse will automatically create a default WebViewHistory for you. Do not debug directly! Close test)

solution 3 : it is possible that there is a firewall problem (close the firewall, this problem still exists!

solution 4 : because it was possible before, so puzzled, Google for a long time, can find the problem is generally because the other side did not open the remote debugging port, so naturally not connected, but I here obviously is not the case. After a long period of confusion, it occurred to me that I might be affected by the Eclipse proxy Settings. It seems unlikely, though, because my understanding is that the agent is only for Eclipse itself, not for applications launched through Eclipse.

solution 5 : this is because Tomcat has not started yet, or it is not started in Debug mode. (of course I don’t have this problem here)

solution 6 : other people in the same group own the connection (only one connection can be used for remote debugging), click the disconnect button. (I still don’t have that problem here)

: it’s important to run the application and connect to it, otherwise Eclipse will throw an exception “Failed to connect to remote vm.connection 40”. In the JVM DEBUG parameter, there is a parameter called “suspend” that takes two values, “y” or “n”, and if you want to DEBUG from the beginning, set it to “suspend=y” so that Eclipse can connect to Java applications remotely.
if you want to run the project first and then connect to Eclipse, you can set the parameter to “suspend=n” so that the Java application will be up and running, after which Eclipse will start the remote connection. Tip 2: use the startup script to enter JVM debugging parameters, and use the variable isDebugEnabled or REMOTE_DEBUG_PORT in the script, which you can export when you want to remotely debug Java applications. The entire operation is very simple, requiring only a one-time installation.
prompt 3: if you get an error message, “Failed to connect to remote vm.connection union” or “Connection union: connect”, there are two possible reasons for this. The first is that your Java project is not running on the remote host. The second is that there are errors in the input port and host name. After successful verification, you can fill in the complete host name. Tip 4: you also want to make sure that local Eclipse and remote Eclipse run the same code base. Code can be compiled using the debug option “-g”, and Eclipse can easily collect debugging information, such as debugging information for local variables. By default, with the debug option “-g”, the class file may have larger debug information.

.

solution 8 : find the tomcat/bin/catalina.bat file, edit, and add the downstream code

before CATALINA_OPTS

set CATALINA_OPTS=-server – xdebug-xnoager-djava.com piler= none-xrunjdwp :transport=dt_socket,server=y,suspend=n,address=50001 [port number used for debugging]

save and restart Tomcat (this one doesn’t solve my problem either)

solution 9 : the most likely reason is that the IP address in Eclipse is misconfigured (for this reason, copying the IP address is wrong, so am I…)

solution 10 :
estimated that the network is unstable, but finally the debugging was successful. this… )

solution 11 : firewall issues. Turn off the web firewall in 360 and you’re good to go. I reload every time. This time the reason has finally been found.

.

conclusion : in the future, you must look at the most basic configuration, and then step by step to determine whether your conclusion is correct. In fact, IP address error, this problem should be the first reason to rule out, but I for some reason, did not check, so that I wasted a day’s time!

Debugging with chrome Node.js

sharpen the knife not by mistake woodcutters, good tools will let us debug a lot of convenience and fast.

in November 2019, Google Chrome 78 release. Js (which may have been available in earlier versions, but I didn’t)

The

entry is next to the familiar “element selection tool” and “device emulator” in the developer tools:

is also easy to use. Click the button, devtools-node. js will pop up, as shown in the figure below:


can Add connection by Add connection button, and create a new port listening, here I Add localhost:9999 (as shown below). You can also modify and delete existing links.



everything is ready to start debugging. debugger where you need to debug in NodeJs code. Then execute the command node --inspect=port your_script, for example:

node --inspect=9999 message_list

if we run into an error like , inspector on 127.0.0.1:9229 failed: address already in use try changing the port number.

all normal will automatically enter debugging mode: