www.digitalmars.com         C & C++   DMDScript  

c++ - Could this be a bug ??

reply "Yeric" <REMOVEamigabloke yahoo.co.ukREMOVE> writes:
Hi,

just wondered if anyone else has experienced this with the IDDE

use debugger quit back to editor, make changes recompile then back to
debugger and it crashes

could this be a bug or something I am doing, I am watching 2 variables at
the time of debugging forst time round then I quit debugger into editor ( I
press the red button) then the editor tab, change the code cos my logic
sucks <g> save it recompile then start the debugger and it crashes.

I am using CD version 8.34 dmc
Win XP
Xp 2500+ processor
1 Gb PC 3200 DDR ram

only other thing I have open is outlook

Cheers
Aug 18 2003
parent reply "Greg Peet" <admin gregpeet.com> writes:
Are you adding watches to local variables? If you are, that is very
dangerous. What does your source code look like?

"Yeric" <REMOVEamigabloke yahoo.co.ukREMOVE> wrote in message
news:bhr9n4$1ftr$1 digitaldaemon.com...
| use debugger quit back to editor, make changes recompile then back to
| debugger and it crashes
| could this be a bug or something I am doing, I am watching 2 variables at
| the time of debugging forst time round then I quit debugger into editor
( I
| press the red button) then the editor tab, change the code cos my logic
| sucks <g> save it recompile then start the debugger and it crashes.
| I am using CD version 8.34 dmc
| Win XP
| Xp 2500+ processor
| 1 Gb PC 3200 DDR ram
Aug 18 2003
next sibling parent reply "Matthew Wilson" <matthew stlsoft.org> writes:
"Greg Peet" <admin gregpeet.com> wrote in message
news:bhrqml$29m3$1 digitaldaemon.com...
 Are you adding watches to local variables? If you are, that is very
 dangerous. What does your source code look like?

Do you mean it's dangerous with DMC++'s IDDE, or a dangerous thing in principal?
Aug 18 2003
parent reply "Greg Peet" <admin gregpeet.com> writes:
"Matthew Wilson" <matthew stlsoft.org> wrote in message
news:bhrvdr$2g59$1 digitaldaemon.com...
| Do you mean it's dangerous with DMC++'s IDDE, or a dangerous thing in
| principal?

In DMC's IDDE AFAIK. However, wouldn't it be dangerous to watch a variable
that leaves scope in general?
Aug 18 2003
parent "Matthew Wilson" <matthew stlsoft.org> writes:
"Greg Peet" <admin gregpeet.com> wrote in message
news:bhsgka$7pq$1 digitaldaemon.com...
 "Matthew Wilson" <matthew stlsoft.org> wrote in message
 news:bhrvdr$2g59$1 digitaldaemon.com...
 | Do you mean it's dangerous with DMC++'s IDDE, or a dangerous thing in
 | principal?

 In DMC's IDDE AFAIK. However, wouldn't it be dangerous to watch a variable
 that leaves scope in general?

No. Any debugger for which that was true by design would be useless. An invalid watch should simply display a nominal invalid value (e.g. "????")
Aug 19 2003
prev sibling parent Yeric < REMOVE AmigaBloke yahoo.co.uk REMOVE> writes:
Greg Peet wrote:

 Are you adding watches to local variables? If you are,
 that is very dangerous. What does your source code look
 like?
 

makes no sense and the logic is all wrong, I think I must have been asleep when I coded this <g> for ( int i = 1; i < x; i++ ) { if ( ( i != 1 ) || ( i != 2 ) ) { if ( ( x % i != 0 ) || ( x % 2 != 0 ) ) { prime = true ; break ; } } } I was watching the x, i and prime variables ( all local ) at the time, as I could not figure out why it was always setting prime to true regardless, the x is from another for loop not shown I should have changed the != 1 || !=2 to !=1 && !=2, actually better still lose the two comparisons and change to > 2 in if statement, like I say I must have been asleep when coding this. Also the logic to test for prime is all wrong as you cant just rely on a 0 value from x % i as this fails for numbers like 9 where 2 dont go into it but 3 does, also I figure I only need to check numbers that are half the value of the number being checked, and that I do not need to test for even numbers apart from 2 as they can never be prime and I dont need to test with even numbers against an odd number only odd numbers against odd numbers. And to think all of this came to me in my sleep last night <g> I think this is the best way to work on an alg for prime numbers unless anyone knows better ? Cheers
Aug 19 2003