Mail Archives: djgpp/2002/03/23/17:00:17
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f
|
From: | "Nirvana" <nir_vana AT libero DOT it>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Breakpoints crazy?
|
Lines: | 121
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2615.200
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2615.200
|
Message-ID: | <Oh6n8.62328$%g7.1987589@twister2.libero.it>
|
Date: | Sat, 23 Mar 2002 22:24:35 +0100
|
NNTP-Posting-Host: | 151.28.9.77
|
X-Complaints-To: | abuse AT libero DOT it
|
X-Trace: | twister2.libero.it 1016918254 151.28.9.77 (Sat, 23 Mar 2002 22:17:34 MET)
|
NNTP-Posting-Date: | Sat, 23 Mar 2002 22:17:34 MET
|
Organization: | [Infostrada]
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
I use DJGPP-RHIDE to develop a DOS application but i'm experimenting very
strange debugging problem.
While the initialization code i've written seem to work properly by using
printf() and similar output methods i'm unable to use breakpoints and
watches to assure the proper working of the code.
To me, it seem crazy.
The following a little part of the code, don't spend much time to understand
what it does, it is mainly initialization functions, there's only a very
simple if, the remaining code is sequential.
#include <allegro.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "almp3.h"
#include "LCD.c"
#include "Audio.c"
#include "InOut.c"
#define path_iniziale "config.txt"
int main()
{
// ********* DICHIARAZIONI *********
mp3dir* mp3data; // delle directory delle playlist
pl_full* curr_p; // sulla playlist corrente
s_id* curr_s; // sulla canzone corrente
char* pathsys; // al file MP3SYS.TXT
char* pathlast; // al file LAST.TXT
MP3FILE* mp3; // corrente e stream audio
char kc; // corrente in input
int *cd,*cp,*cs; // pl e song
int status; // di visualizzazione
int cont; // multiuso
int ready; // se la canzone in curr_s S ok
int exit; // se bisogna uscire dal programma
int load; // se mp3 S carico;
int back; // quando bisogna uscire dal loop di controllo
// ********* INIZIALIZZAZIONE *********
// INIT ALLEGRO
allegro_init();
install_timer();
install_keyboard();
set_volume_per_voice(0);
// INIT AUDIO
if (install_sound(DIGI_AUTODETECT, MIDI_NONE, 0) < 0)
{
return 1;
}
// INIT LCD
LCD_init();
LCD_SET_display(1,0,0);
LCD_riempi
(
" MP3-PLAY ",
" ",
" progettato da ",
" Gabriele Palma "
);
delay(500);
LCD_riempi
(
" ",
"CARICAMENTO IN CORSO",
" ATTENDERE PREGO.. ",
" "
);
delay(500);
// INIT PERCORSI
pathsys=get_mp3sys_path(path_iniziale);
pathlast=get_last_path(path_iniziale);
// INIT VARIABILI
mp3data=load_mp3sys(pathsys);
curr_s=get_last(pathlast);
cd=&(curr_s->dir);
cp=&(curr_s->pl);
cs=&(curr_s->song);
mp3 = (MP3FILE*)malloc(sizeof(MP3FILE));
// CHIUSURA
free(mp3);
LCD_clear();
LCD_turnoff();
allegro_exit();
return 0;
}
Someone can explain me why if i run this procedure with some breakpoints it
seem to go here and there without any apparent reason? It jump some lines,
then come back, the it invent some cycles and repeat several times the same
instruction and so on.
I'm not joking, for example it regularly jump the first two lines (first
after declaration) and generally execute several times the install_timer()
and more.....
Every time i repeat it do something very similar to the previous one but a
little different. I tried moving and deleting some sections or instruction
but it continue to jump here and there. If i add some watches it simply tell
me "not available" or VERY strange values, meanwhile the same variable,
checked with a printf() not only is available and declared but also is
initialized at the correct value.
(I'm referring to the varibles initialized in the INIT PERCORSI and INIT
VARIABILI section)
The code seem to do what it is supposed to do but i'm unable to check it in
a definitive way because debugging mode make me crazy telling me things
without any sense.
I miss something about debugging with Rhide (most probably case) or Rhide
became crazy (least probably case)?
- Raw text -