Mail Archives: djgpp/2000/08/25/09:39:51
On 23 Aug 2000 07:48:21 GMT, Hans-Bernhard Broeker
<broeker AT physik DOT rwth-aachen DOT de> wrote:
>This is by far not precise enough to give a helpful response. We'll
>need compilable code (minimized to the bare necessities before
>posting, please) to be able to test this out.
>
I thought so... I wasn't sure if I should expect a helpful response :)
Glad to see I'm too cynical about such things...
>The debugger can be confused, sometimes, about the values of certain
>variables in highly optimized code which are currently kept in
>registers during execution.
This is good to know but the code isn't optimised at all.
typedef struct{
double rho,hz,m,m0,kp,kpt,ftr,kbb,kt11,alpha,lambda,td,
t0,trp,time,kttrp;
}model_data;
typedef struct{
double h;
}simulation_data;
main(){
int pulse = 0;
model_data mdata;
simulation_data sdata;
double h;
mdata.time = 0;
mdata.t0 = 0.1;
sdata.h = 0.01;
mdata.td = 1;
do{
if(mdata.time >= mdata.t0*pulse && mdata.t0*pulse <
mdata.time+sdata.h){
pulse++;
}
h=sdata.h;
if(sdata.h >= mdata.t0*pulse - mdata.time)h = mdata.t0*pulse -
mdata.time;
mdata.time += h;
}while(mdata.time < mdata.td);
return 0;
}
On my system the program hangs just before pulse = 6 but the debugger
says the condition to execute 'pulse++' is satisfied. Any ideas?
- Raw text -