1

Topic: How in the code to define, what now debugging?

It would be desirable something type:

if (Debug) TaskManager.setMaxThreadCount (1);

How such to make?

2

Re: How in the code to define, what now debugging?

int main (...)
{
bool bDebugIsOn = false;
#if defined _DEBUG
bDebugIsOn = true;
#endif
.
.
.
if (bDebugIsOn) TaskManager.setMaxThreadCount (1);
return 0;
}

3

Re: How in the code to define, what now debugging?

AlekseySQL wrote:

As such to make?

Key in a command line to make

4

Re: How in the code to define, what now debugging?

Cerebrum;
It not debugging. It Debug the application version.

5

Re: How in the code to define, what now debugging?

wrote:

it is passed...
Key in a command line to make

But application by a debugger can be picked up and after start from command line.

6

Re: How in the code to define, what now debugging?

Cerebrum;
At me during debugging the parameter bDebugIsOn is equal in your code false. Does not roll, in a word.

7

Re: How in the code to define, what now debugging?

wrote:

a key in a command line to make

It is possible to write, what for a key? In what field what to write and how in the code then to catch this key?

8

Re: How in the code to define, what now debugging?

AlekseySQL wrote:

Cerebrum;
At me during debugging the parameter bDebugIsOn is equal in your code false. Does not roll, in a word.

What development environment?

9

Re: How in the code to define, what now debugging?

AlekseySQL;
In a normal global variable

10

Re: How in the code to define, what now debugging?

petrav wrote:

Cerebrum;
It not debugging. It Debug the application version.

The application version also is intended for debugging DEBUG

11

Re: How in the code to define, what now debugging?

Cerebrum wrote:

it is passed...
The application version also is intended for debugging DEBUG

Under a debugger it is possible and Release to launch the version. As it is possible Debug to launch the version without a debugger.
Can it is simple the author of a topic a question incorrectly set.

12

Re: How in the code to define, what now debugging?

AlekseySQL wrote:

Cerebrum;
At me during debugging the parameter bDebugIsOn is equal in your code false. Does not roll, in a word.

That this beginning to work (if for you IDE VS and you did not crumple the project), you should launch debug (debug) the application version. The current version of application is selected here

13

Re: How in the code to define, what now debugging?

AlekseySQL wrote:

it is passed...
It is possible to write, what for a key? In what field what to write and how in the code then to catch this key?

Yes, I think, there is no such key and it so simply will not add. Though...

14

Re: How in the code to define, what now debugging?

petrav wrote:

Can it is simple the author of a topic a question incorrectly set.

I imply that indeed because I do not know  a horse-radish can such perversion is required, whether how to define in  is started application from under a debugger.
It is necessary to debug something - launch DEBUG the assembly

15

Re: How in the code to define, what now debugging?

Cerebrum wrote:

it is passed...
I imply that indeed because I do not know  a horse-radish can such perversion is required, whether how to define in  is started application from under a debugger.

About 15-20 years ago somewhere read that viruses try to define that they are launched under a debugger and somehow try to resist to debugging. But I do not understand it smile

16

Re: How in the code to define, what now debugging?

https://msdn.microsoft.com/en-us/librar … p/ms680345 (v=vs.85).aspx

17

Re: How in the code to define, what now debugging?

petrav wrote:

it is passed...
About 15-20 years ago somewhere read that viruses try to define that they are launched under a debugger and somehow try to resist to debugging. But I do not understand it smile

You trust, no, too I sit and I think: either the author writes  or any artful , but judging by its posts it not that level, while smile

18

Re: How in the code to define, what now debugging?

Dimitry Sibiryakov wrote:

https://msdn.microsoft.com/en-us/librar … p/ms680345 (v=vs.85).aspx

smile. For certain this right answer is googled for 2 minutes a maximum. But most likely for 20 seconds.

19

Re: How in the code to define, what now debugging?

Cerebrum wrote:

it is passed...
You trust, no, too I sit and I think: either the author writes  or any artful , but judging by its posts it not that level, while smile

I since first lines thought of that.

20

Re: How in the code to define, what now debugging?

mayton wrote:

I since first lines thought of that.

at us was such that there was a code which is not specially "hindering" debugging - , closing window IDE. I.e. IDE costs on , and it is closed by the top bridge , and everything,  at people was... They added the code which in a mode  did not include

21

Re: How in the code to define, what now debugging?

Cerebrum wrote:

I imply that indeed because I do not know  a horse-radish can such perversion is required, whether how to define in  is started application from under a debugger.
It is necessary to debug something - launch DEBUG the assembly

I use Qt - Creator, I push the special button "Debugging" allocated at the left below. It Is necessary for me not to launch some flows during debugging because to debug multi-threaded application inconveniently.

22

Re: How in the code to define, what now debugging?

Then the method offered by me quite approaches, if in Qt there is such macro as _DEBUG.
If it is not present, you can define it independently, as preprocessor directives - a language element, instead of IDE.

#define _MY_DEBUG
#if defined _MY_DEBUG
TaskManager.setMaxThreadCount (1);//in code debug version
#else
TaskManager.setMaxThreadCount (5);//in release'e or in high-grade debug'e
#endif

If you IDE supports creation of profiles, and most likely it so. To existing to two (DEBUG and RELEASE) you can create That own ( for example, MyDebug ) in which to define a specific macro, like standard _DEBUG ( for example, _MY_DEBUG ) which allows yours IDE to understand, what branch of the code to it is necessary for compiling. But it does not change an essence and will happen too most, as in the code which I resulted above.
Switching between profiles you you can quickly select the necessary composition of the compiled entities which are including an amount defined by you of flows.
Only be careful, as that you do can play with you a malicious joke. Experimenting only one flow you certainly you fulfill debugging in conditions which will not correspond to real service conditions of your software and consequently that perfectly worked in your one-continuous version, can go on all to a known route as soon as you will collect high-grade release.

23

Re: How in the code to define, what now debugging?

Cerebrum, thanks, but here it is necessary permanently define to distort: is necessary that so to test, so... It would be desirable that the system itself understood that now Debug without additional .

24

Re: How in the code to define, what now debugging?

AlekseySQL wrote:

it is passed...
For this type of the assembly macro QT_NO_DEBUG is not defined, here it and should be checked

25

Re: How in the code to define, what now debugging?

,  with citations

Posts [ 1 to 25 of 30 ]

Pages 1 2 Next

You must login or register to post a reply