mini-trazador rules

This commit is contained in:
Gabriel Lorenzo 2002-10-19 18:17:39 +00:00
parent 313562b4a0
commit 21f8a2c6d8
20 changed files with 301 additions and 96 deletions

View file

@ -6,6 +6,27 @@
claro identificar errores mediante un nombre en lugar de un numero. (Daijo)
* Limpio el archivo extern.h y comentarizo segun las normas de ANSI C99. (Daijo)
* Elimino varias variables no utilizadas en las dll's. (Daijo)
* Ahora el stub con trazador es aplicación de consola, desde la que podemos
trazar el programa con un "mini-trazador" que lleva incorporado. Así podemos
descubrir fácilmente dónde petan los programas (por ejemplo, robots.prg
peta en el collision). Por cierto, lo que muestra el trazador entre corchetes
al principio de cada línea es el imem donde comienza la sentencia.
(Er_Makina)
* Haciendo el mini_trazador he modificado inicio_sentencia(), ahora no tiene
bucle, sólo un par de asignaciones, así que en teoría eDIV debería compilar
ya correctamente en Windows 98. (Er_Makina)
* Cuando eDIV compila con la opción -d (y compilado en modo Debug), genera un
fichero ediv.lin donde se muestra la información que usa el trazador para
localizar el código correspondiente al imem actual. (Er_Makina)
18/10/2002
----------
* Añadido el entrypoint "quit". Usadlo para liberar los recursos de la dll.
(Er_Makina)
* Arreglado get_id, que (en teoria) no se reseteaba al hacer frame. Ademas he
hecho que use las variables de la estructura reserved. (Er_Makina)
* Ahora se inicializan las locales son, father, bigbro y smallbro. (Er_Makina)
* Añadido exit() (accede a stub_quit mediante fp->Stub_Quit). (Er_Makina)
17/10/2002
----------

View file

@ -76,9 +76,10 @@
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\shared"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/b2f.pch"
@ -92,7 +93,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
AdditionalDependencies="sdlmain.lib sdl.lib"
OutputFile=".\Release/b2f.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"

Binary file not shown.

View file

@ -96,7 +96,10 @@ int ExportaFuncs(EXPORTAFUNCS_PARAMS)
// DATOS LOCALES PREDEFINIDOS
// Estructura reserved - POR HACER: ¿preservar compatibilidad con DIV?
// Estructura reserved - POR HACER: ¿preservar compatibilidad con DIV? -> si
/* pero ¿Qué hacer con distance_1 y distance_2 (sinónimos de m8_object y old_ctype,
* respectivamente)? ya nos toparemos con ellas cuando hagamos el modo7. */
LOCAL_STRUCT("reserved",0);
_INT("process_id",0);
_INT("id_scan",0);
@ -144,37 +147,62 @@ int ExportaFuncs(EXPORTAFUNCS_PARAMS)
LOCAL("flags",0);
LOCAL("transparency",128) ;
FUNCTION("exit",2,eDIV_Exit);
FUNCTION("get_id",1,eDiv_GetId) ;
FUNCTION("define_region",5,eDiv_DefineRegion) ;
ENTRYPOINT( first_load ) ;
// POR HACER: funciones signal, get_id, system, exit, ignore_error...
// POR HACER: funciones signal, system, ignore_error...
return TRUE;
}
int eDIV_Exit(FUNCTION_PARAMS)
{
int codigo=getparm();
char* mensaje=getstrparm();
/* FIXME: ¿Qué hacemos con el mensaje? ¿Lo mostramos en un msgbox si no es ""? */
#ifdef _WIN32
MessageBox(0,mensaje,fp->nombre_program,0);
#else
printf("%s\n",mensaje);
#endif
#ifdef _DEBUG
printf("dbg:\texit(): código de retorno: %d\n",codigo);
#endif
fp->Stub_Quit(codigo);
/* Por si acaso :P */
return codigo;
}
int eDiv_GetId(FUNCTION_PARAMS)
{
int i ,id1 ;
int a = getparm() ;
if ( last_type == a )
i = last_proc+1 ;
else
int* last_type=&reserved("type_scan",fp->procs_s[fp->proc_orden[*fp->proceso_actual]].id);
int* last_proc=&reserved("id_scan",fp->procs_s[fp->proc_orden[*fp->proceso_actual]].id);
if ( *last_type == a )
i = *last_proc+1 ;
else {
i = 0 ;
last_type = a ;
*last_type = a ;
}
for ( ; i < *fp->num_procs ; i++ )
{
last_proc = i ;
*last_proc = i ;
id1 = fp->procs_s[ fp->proc_orden[ i ] ].id ;
//Si el proceso se corresponde con el type
// if ( fp->mem[ id1 + fp->varindex[ _res_process_type ] ] == a )
/* Si el proceso se corresponde con el type */
if ( reserved("process_type",id1) == a )
{
return ( fp->procs_s[ fp->proc_orden[ i ] ].id ) ;
}
}
last_proc = -1 ;
*last_type = 0 ;
return 0 ;
}
@ -199,6 +227,10 @@ int eDiv_DefineRegion(FUNCTION_PARAMS)
return 1 ;
}
int eDIV_Signal(FUNCTION_PARAMS)
{
}

View file

@ -4,5 +4,6 @@
struct _regions regions[32] ;
// Prototipos
int eDIV_Exit(FUNCTION_PARAMS);
int eDiv_GetId(FUNCTION_PARAMS) ;
int eDiv_DefineRegion(FUNCTION_PARAMS) ;

View file

@ -28,6 +28,9 @@
* notifíquelo a Sion Entertainment en bugs@edivcentral.com
*/
#ifndef __EDIV__EXPORT_H
#define __EDIV__EXPORT_H
#ifdef __cplusplus
extern "C" {
#endif
@ -38,8 +41,10 @@ extern "C" {
//# define DllMain() WINAPI DllMain(HINSTANCE hInst, DWORD reason, LPVOID)
# include <windows.h>
#else
#ifndef bool
typedef enum { FALSE, TRUE } bool;
#endif
#endif
///// VARINDEX /////
@ -65,7 +70,7 @@ typedef struct {
#include <SDL/SDL.h>
// Funciones de exportación de datos
/* Funciones de exportación de datos */
typedef int (TYPEOF_EDIV_Export)(char* cadena, int nparam, void* hfuncion);
typedef int (TYPEOF_EDIV_Export_Const)(char* cadena, int valor);
typedef int (TYPEOF_EDIV_Export_Global)(char* cadena, int valor);
@ -81,19 +86,22 @@ typedef int (TYPEOF_EDIV_Export_Local_Struct)(char* cadena, int numregs);
typedef int (TYPEOF_EDIV_Export_Entrypoint)(int ep, void* hfuncion);
typedef int (TYPEOF_EDIV_Export_Priority)(int priority);
// Call_Entrypoint
/* Call_Entrypoint */
typedef int (TYPEOF_Call_Entrypoint)(int ep, ...);
// Dibuja
/* Dibuja */
typedef int (TYPEOF_Dibuja)(SDL_Surface *, SDL_Rect, SDL_Rect, int, int);
// Errores
/* Errores */
typedef void (TYPEOF_Runtime_Error)(int, ...);
typedef void (TYPEOF_Critical_Error)(int, ...);
// Obtiene offset de variable indexada dinámicamente
/* Obtiene offset de variable indexada dinámicamente */
typedef int (TYPEOF_GetVarOffset)(tipo_t tipo,char* nombre);
/* Finaliza el stub (exit) */
typedef void (TYPEOF_Stub_Quit)(int n);
// estilo BO2K, sólo para "defaultear" las funciones como NULL
/*extern TYPEOF_EDIV_Export *EDIV_Export;
extern TYPEOF_EDIV_Export_Const *EDIV_Export_Const;
@ -262,6 +270,7 @@ struct _fun_params{
TYPEOF_Runtime_Error *Runtime_Error ;
TYPEOF_Critical_Error *Critical_Error ;
TYPEOF_GetVarOffset *GetVarOffset ;
TYPEOF_Stub_Quit *Stub_Quit ;
} ;
@ -306,3 +315,5 @@ void quit(void);
#ifdef __cplusplus
}
#endif
#endif /* __EDIV__EXPORT_H */

View file

@ -118,6 +118,8 @@ void prepara_compilacion()
*(prog+progsize)=0;
_source=NULL;
linsize=0;
}
void compila()
@ -296,7 +298,11 @@ void compila()
}
/* renombra temp.dj! al nombre del exe */
rename("temp.dj!",outfilename);
if(rename("temp.dj!",outfilename)) {
printf(translate(33)); /* error escribiendo ejecutable */
remove("temp.dj!");
exit(1);
}
/* ordenamos varindex */
ordena_varindex();
@ -1004,13 +1010,8 @@ void add_code(int dir, int param, int op) {
*/
void inicio_sentencia(void)
{
byte * p=ierror-1;
inicio=imem;
linea1=linea;
columna1=0;
while (*p!=cr && *p!=lf && p>_source) {
columna1++; p--;
}
inicio_prg=(int)(ierror-prog);
}
/*
@ -1018,13 +1019,8 @@ void inicio_sentencia(void)
*/
void final_sentencia(void)
{
byte * p=old_ierror_end-1;
final=imem-1;
linea2=old_linea;
columna2=0;
while (*p!=cr && *p!=lf && p>=_source) {
columna2++; p--;
}
final_prg=(int)(old_ierror_end-prog);
}
/*
@ -1033,13 +1029,20 @@ void final_sentencia(void)
void grabar_sentencia(void)
{
if(debug && linf!=NULL) {
/*if(debug && linf!=NULL) {
fwrite(&inicio,4,1,linf);
fwrite(&final,4,1,linf);
fwrite(&linea1,4,1,linf);
fwrite(&columna1,4,1,linf);
fwrite(&linea2,4,1,linf);
fwrite(&columna2,4,1,linf);
}*/
if(debug && linf!=NULL) {
fwrite(&inicio,4,1,linf);
fwrite(&final,4,1,linf);
fwrite(&inicio_prg,4,1,linf);
fwrite(&final_prg,4,1,linf);
linsize++;
}
}
@ -1052,9 +1055,14 @@ void escribe_lin(FILE* f)
int b=0;
int l;
byte* progcomp;
#ifdef _DEBUG
FILE* ediv_lin;
int j;
#endif
/* comprimimos el codigo fuente */
while(prog[b]!=0) b++;
b++;
progcomp=e_malloc(b*2);
l=b*2;
if(compress(progcomp,&l,prog,b)) {
@ -1071,16 +1079,34 @@ void escribe_lin(FILE* f)
free(progcomp);
/* Escribe el tamaño del LIN */
b=ftell(linf);
#ifdef _DEBUG
printf("dbg: TAMANO LIN: %d\n",b);
printf("dbg: linsize: %d\n",linsize);
#endif
fwrite(&linsize,1,4,f);
#ifdef _DEBUG
ediv_lin=fopen("ediv.lin","w");
fprintf(ediv_lin,"linsize: %d\n",linsize);
#endif
fwrite(&b,1,4,f);
/* Escribe la información LIN (offset de cada sentencia en el prg y en el bytecode) */
fseek(linf,0,SEEK_SET);
while((b=fgetc(linf))!=EOF)
while((b=fgetc(linf))!=EOF) {
fputc(b,f);
}
#ifdef _DEBUG
j=0;
fseek(linf,0,SEEK_SET);
while(!feof(linf)) {
fread(&b,1,4,linf);
fprintf(ediv_lin,"[%d] eml_start\t%d\n",j,b);
fread(&b,1,4,linf);
fprintf(ediv_lin,"[%d] eml_end \t%d\n",j,b);
fread(&b,1,4,linf);
fprintf(ediv_lin,"[%d] prg_start\t\t%d\n",j,b);
fread(&b,1,4,linf);
fprintf(ediv_lin,"[%d] prg_end \t\t%d\n",j++,b);
}
fclose(ediv_lin);
#endif
fclose(linf);
}

View file

@ -235,8 +235,10 @@ struct { // Peephole, "mirilla" para el optimizador
FILE * linf; /* En este temporal guardamos la info y luego lo agregamos al exe */
int inicio,final; /* Direcciones inicial y final de mem[] de la sentencia */
int linea1,columna1; /* Posicion en la que comienza la sentencia en el fuente */
int linea2,columna2; /* Posicion en la que acaba la sentencia en el fuente */
//int linea1,columna1; /* Posicion en la que comienza la sentencia en el fuente */
//int linea2,columna2; /* Posicion en la que acaba la sentencia en el fuente */
int inicio_prg,final_prg; /* Direcciones inicial y final en el PRG de la sentencia */
int linsize;
void inicio_sentencia(void); /* Fija inicio, linea1, columna1 */
void final_sentencia(void); /* Fija final, linea2, columna2 */

View file

@ -26,7 +26,7 @@
#include "edivcfg/iniparser.h"
//#define MULTI_ERROR // para activar el sistema multi-error (bugs a mansalva)
#define DEBUG_DLL // para mostrar información al cargar las DLLs
//#define DEBUG_DLL // para mostrar información al cargar las DLLs
#define swap(a,b) {(a)^=(b);(b)^=(a);(a)^=(b);}

View file

@ -82,9 +82,12 @@ typedef int (TYPEOF_Dibuja)(SDL_Surface *, SDL_Rect , SDL_Rect , int , int ) ;
typedef void (TYPEOF_Runtime_Error)(int, ...);
typedef void (TYPEOF_Critical_Error)(int, ...);
// Obtiene offset de variable indexada dinámicamente
/* Obtiene offset de variable indexada dinámicamente */
typedef int (TYPEOF_GetVarOffset)(tipo_t tipo,char* nombre);
/* Finaliza el stub (exit) */
typedef void (TYPEOF_Stub_Quit)(int n);
/*
* ENTRY-POINTS
*
@ -97,30 +100,29 @@ typedef int (TYPEOF_GetVarOffset)(tipo_t tipo,char* nombre);
* Constantes para EDIV_Export_Entrypoint
*/
#define EDIV_set_video_mode 1 // Al activar un nuevo modo de vídeo */
#define EDIV_process_palette 2 // Al cargar una paleta */
#define EDIV_process_active_palette 3 // Al modificar la paleta activa (usada en los fades) */
#define EDIV_process_sound 4 // Al cargar un efecto sonoro */
#define EDIV_process_map 5 // Al cargar un mapa */
#define EDIV_process_fpg 6 // Al cargar un FPG */
#define EDIV_process_fnt 7 // Al cargar una fuente */
#define EDIV_background_to_buffer 8 // Volcar el fondo al buffer */
#define EDIV_buffer_to_video 9 // Volcar el buffer a la memoria de video */
#define EDIV_post_process_scroll 10 // Tras dibujar una ventana de scroll (sin los sprites) */
#define EDIV_post_process_m7 11 // Tras dibujar una ventana de modo7 (sin los sprites) */
#define EDIV_post_process_m8 12 // Tras dibujar una ventana de modo8 (sin los sprites) */
#define EDIV_post_process_buffer 13 // Tras haber terminado de dibujarlo todo */
#define EDIV_post_process 14 // Tras ejecutar el frame de un proceso (cualquier %) */
#define EDIV_put_sprite 15 // Dibujar un sprite */
#define EDIV_ss_init 16 // Inicio de salvapantallas */
#define EDIV_ss_frame 17 // Frame de salvapantallas */
#define EDIV_ss_end 18 // Fin de salvapantallas */
#define EDIV_frame 19 // En cada frame */
#define EDIV_trace 20 // Después de ejecutar cada instrucción de bytecode (solo en debug) */
#define EDIV_debug 21 // Invocar al trazador - sentencia debug (solo en debug) */
#define EDIV_first_load 22 // Se ejecuta al cargar la DLL en ejecucion */
#define EDIV_quit 23 // Llamado por stub_quit() */
#define EDIV_set_video_mode 1 // Al activar un nuevo modo de vídeo
#define EDIV_process_palette 2 // Al cargar una paleta
#define EDIV_process_active_palette 3 // Al modificar la paleta activa (usada en los fades)
#define EDIV_process_sound 4 // Al cargar un efecto sonoro
#define EDIV_process_map 5 // Al cargar un mapa
#define EDIV_process_fpg 6 // Al cargar un FPG
#define EDIV_process_fnt 7 // Al cargar una fuente
#define EDIV_background_to_buffer 8 // Volcar el fondo al buffer
#define EDIV_buffer_to_video 9 // Volcar el buffer a la memoria de video
#define EDIV_post_process_scroll 10 // Tras dibujar una ventana de scroll (sin los sprites)
#define EDIV_post_process_m7 11 // Tras dibujar una ventana de modo7 (sin los sprites)
#define EDIV_post_process_m8 12 // Tras dibujar una ventana de modo8 (sin los sprites)
#define EDIV_post_process_buffer 13 // Tras haber terminado de dibujarlo todo
#define EDIV_post_process 14 // Tras ejecutar el frame de un proceso (cualquier %)
#define EDIV_put_sprite 15 // Dibujar un sprite
#define EDIV_ss_init 16 // Inicio de salvapantallas
#define EDIV_ss_frame 17 // Frame de salvapantallas
#define EDIV_ss_end 18 // Fin de salvapantallas
#define EDIV_frame 19 // En cada frame
#define EDIV_trace 20 // Después de ejecutar cada instrucción de bytecode (solo en debug)
#define EDIV_debug 21 // Invocar al trazador - sentencia debug (solo en debug)
#define EDIV_first_load 22 // Se ejecuta al cargar la DLL en ejecucion
#define EDIV_quit 23 // Llamado por stub_quit()
/*
* Call_Entrypoint
@ -237,6 +239,7 @@ struct _fun_params{
TYPEOF_Runtime_Error *Runtime_Error ;
TYPEOF_Critical_Error *Critical_Error ;
TYPEOF_GetVarOffset *GetVarOffset ;
TYPEOF_Stub_Quit *Stub_Quit ;
} fp ;
@ -247,8 +250,8 @@ struct _fun_params{
* int sp;
*/
void* extfuncs[MAX_EXTERN_FUNCS]; /* tabla de punteros a las funciones de las DLLs (stub)
int extparms[MAX_EXTERN_FUNCS]; /* nº de parámetros de cada función externa (necesario para la sobrecarga)
void* extfuncs[MAX_EXTERN_FUNCS]; /* tabla de punteros a las funciones de las DLLs (stub) */
int extparms[MAX_EXTERN_FUNCS]; /* nº de parámetros de cada función externa (necesario para la sobrecarga) */
struct _entrypoints {
int tipo; /* Ver #defines de entrypoints más arriba */

View file

@ -31,8 +31,8 @@
#include "main.h"
#include "extern.h"
#include "parser.h"
#include "compiler.h"
//#include "parser.h"
//#include "compiler.h"
#include "varindex.h"
#include "language.h"
@ -811,7 +811,7 @@ int Call_Entrypoint(int ep, ...)
funcion_ep=entrypoints[i].hfuncion;
funcion_ep(_imem,_nombreprg,_lin,_dbg);
}
#endif
#endif /* DBG */
}
}

View file

@ -85,6 +85,11 @@ int ini_interprete()
fp.Runtime_Error=error;
fp.Critical_Error=critical_error;
fp.GetVarOffset=GetVarOffset;
fp.Stub_Quit=stub_quit;
#ifdef DBG
last_lin=0;
#endif /* DBG */
return 1 ;
@ -142,7 +147,7 @@ int interprete()
{
for ( proceso_actual = 0 ; proceso_actual < num_proc_orden ; proceso_actual++ )
{
proceso( proc_orden[ proceso_actual ] ) ;
proceso( proc_orden[ proceso_actual ], -1 ) ;
}
Call_Entrypoint(EDIV_frame);
@ -156,18 +161,21 @@ int interprete()
}
int proceso( int num )
int proceso( int num, int padre )
{
int v1 ;
int retcode = 0;
int no_devuelve = 0 ;
int (*externa)(struct _fun_params*);
int temp ;
#ifdef DBG
int actual_lin;
#endif
num_proc = num ;
imem = procs_s[num_proc].imem ;
printf("num_proc: %d\n",num);
//printf("num_proc: %d\n",num);
//if(num==972) assert(0);
@ -285,7 +293,7 @@ int proceso( int num )
temp = proceso_actual ;
proceso_actual = lista_mete(v1) ;
procs_s[num_proc].imem = imem ;
proceso(v1) ;
proceso(v1,num_proc) ;
proceso_actual = temp ;
num_proc = num ;
imem = procs_s[num_proc].imem ;
@ -300,6 +308,7 @@ int proceso( int num )
break;
case lfrm://29
procs_s[num_proc].imem = imem ;
reserved("type_scan",procs_s[num_proc].id)=0; /* resetea get_id() */
if ( first_loaded )
{
Call_Entrypoint(EDIV_first_load);
@ -321,8 +330,20 @@ int proceso( int num )
critical_error(3); // redefinición del tipo de proceso
procs_s[num_proc].id = mem[2] + ( num_proc * iloc_len ) ;
if(procs_s[num_proc].id>imem_max-iloc_len) critical_error(8); // demasiados procesos en ejecución
reserved("process_id",procs_s[num_proc].id)=procs_s[num_proc].id;
memcpy(&mem[procs_s[num_proc].id],&mem[iloc],iloc_pub_len<<2);
reserved("process_id",procs_s[num_proc].id)=procs_s[num_proc].id;
if(padre!=-1) {
int bigbro;
if(bigbro=local("son",procs_s[padre].id)) {
local("smallbro",bigbro)=procs_s[num_proc].id;
local("bigbro",procs_s[num_proc].id)=bigbro;
}
local("son",procs_s[padre].id)=procs_s[num_proc].id;
local("father",procs_s[num_proc].id)=procs_s[padre].id;
}
else {
local("father",procs_s[num_proc].id)=0;
}
procs_s[num_proc].tipo = mem[ imem++ ] ;
reserved("process_type",procs_s[num_proc].id) = procs_s[num_proc].tipo ;
inicio_privadas=mem[6];
@ -436,7 +457,7 @@ int proceso( int num )
break ;
case ldbg://58
#ifdef DBG
Call_Entrypoint(EDIV_debug,imem,nombreprg,lin,0);
Call_Entrypoint(EDIV_debug,imem,nombre_program,lin,0);
#endif
break ;
@ -507,8 +528,22 @@ int proceso( int num )
break;
}
#ifdef DBG
Call_Entrypoint(EDIV_trace,imem,nombreprg,lin,0);
#endif
Call_Entrypoint(EDIV_trace,imem,nombre_program,lin,0);
#ifdef _DEBUG
actual_lin=localiza_lin(imem);
if(actual_lin!=last_lin) {
unsigned char* p=&prog[lin[actual_lin*4+3]];
// printf("[%d|%d-%d] ",imem,lin[actual_lin*4+3],lin[actual_lin*4+4]);
printf("[%d] ",imem);
while(p<=&prog[lin[actual_lin*4+4]]) {
putc(*p,stdout);
p++;
}
printf("\n");
last_lin=actual_lin;
}
#endif /* _DEBUG */
#endif /* DBG */
}
if ( devolver > 0 && no_devuelve == 0 )
@ -522,5 +557,49 @@ int proceso( int num )
return 1 ;
}
#ifdef DBG
/*
* int localiza_lin (int ip)
* Localiza el imem actual (ip) en la tabla LIN (es decir, localiza en qué línea y
* columna del PRG nos encontramos).
*
* Retorna:
* ((El índice en lin[])-1)/4 <- sentiende no?
*/
int localiza_lin(int ip)
{
lin_item* last;
int i;
/* Primero, para ahorrar tiempo, comprueba si aún seguimos dentro de la misma
sentencia, aunque sea distinto opcode */
last=(lin_item*)(&lin[last_lin*4]);
if(last->inicio<=ip && last->fin>=ip) {
printf("(%d) last_lin\n",ip);
return last_lin;
}
/* Si no, recorre la tabla LIN a partir de donde estábamos, no desde el principio,
ya que es más probable que hayamos saltado a una sentencia posterior que a una
anterior */
for(i=last_lin;i<lin[0];i++) {
if(lin[i*4+1]<=ip && lin[i*4+2]>=ip)
return i;
}
/* No lo hemos encontrado, entonces buscaremos desde el principio hasta last_lin */
for(i=0;i<last_lin;i++) {
if(lin[i*4+1]<=ip && lin[i*4+2]>=ip)
return i;
}
/* Si aún no lo hemos encontrado, mal rollito.. bug seguro, avisemos al programador */
#ifdef _DEBUG
printf("PANIC! No se en que parte del PRG estoy! imem=%d, last_lin=%d\n",ip,last_lin);
#endif
return last_lin;
}
#endif /* DBG */

View file

@ -257,6 +257,10 @@ int ini_interprete() ;
int busca_proc_libre() ;
int lista_mete(int) ;
int interprete() ;
int proceso(int) ;
int proceso(int num, int padre) ;
#endif
#ifdef DBG
int localiza_lin(int ip);
#endif /* DBG */
#endif /* __INTE_H */

View file

@ -77,9 +77,19 @@ Uint8 * keys;
//
#ifdef DBG
char* prog;
unsigned char* prog;
int* lin;
#endif
int last_lin;
typedef struct _lin_item {
int inicio;
int fin;
int inicio_prg;
int fin_prg;
} lin_item;
int linsize;
#endif /* DBG */
///
// PROTOTIPOS

View file

@ -93,7 +93,6 @@ int main(int argc, char* argv[])
file_tiempo = fopen( "time.txt" , "w+" ) ;
#ifdef _WIN32
f=strlen(argv[0]);
if(argv[0][f-4]!='.' || (argv[0][f-3]!='e' && argv[0][f-3]!='E')
@ -235,9 +234,21 @@ int main(int argc, char* argv[])
}
free(progcomp);
read(f,&linsize,4);
lin=(int*)e_malloc(linsize*6*4+4);
lin=(int*)e_malloc(linsize*4*4+4);
lin[0]=linsize;
read(f,&lin[1],linsize);
for(i=0;i<linsize;i++) {
read(f,&lin[i*4+1],4);
read(f,&lin[i*4+2],4);
read(f,&lin[i*4+3],4);
read(f,&lin[i*4+4],4);
/*printf("[%d] eml_start\t%d\n",i,lin[i*4+1]);
printf("[%d] eml_end \t%d\n",i,lin[i*4+2]);
printf("[%d] prg_start\t\t%d\n",i,lin[i*4+3]);
printf("[%d] prg_end \t\t%d\n",i,lin[i*4+4]);*/
}
/* POR HACER: Leer bloque DBG (tabla de objetos) */
#endif
close(f);
@ -372,7 +383,7 @@ int main(int argc, char* argv[])
return 0;
}
#include <assert.h>
//#include <assert.h>
void stub_quit(int n)
{
int i;

View file

@ -69,7 +69,7 @@
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>

Binary file not shown.

View file

@ -79,7 +79,7 @@ makelib.bat win32.rel
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
@ -135,7 +135,7 @@ makelib.bat win32.rel
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/stub.pdb"
SubSystem="2"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>

Binary file not shown.

View file

@ -6,24 +6,28 @@
--------------------Configuration: Trazador - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RSP6E.tmp" with contents
Creating temporary file "C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RSPDD.tmp" with contents
[
/nologo /MD /W3 /Gm /GX /ZI /Od /I "d:\Qt\include" /I "..\src\dlls" /I "..\src\kwrite" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /D "_USRDLL" /FR"Debug/" /Fp"Debug/Trazador.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"D:\ediv\trazador\main.cpp"
"D:\ediv\trazador\moc_trazadorwindow.cpp"
"D:\ediv\trazador\trazadorwindow.cpp"
]
Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RSP6E.tmp"
Creating temporary file "C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RSP6F.tmp" with contents
Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RSPDD.tmp"
Creating temporary file "C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RSPDE.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib wsock32.lib d:\Qt\lib\qt-mt230nc.lib d:\Qt\lib\qtmain.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"Debug/debug.pdb" /debug /machine:I386 /def:".\trazador.def" /out:"../bin/dll/debug.dll" /implib:"Debug/debug.lib" /pdbtype:sept
.\Debug\main.obj
.\Debug\moc_trazadorwindow.obj
.\Debug\trazadorwindow.obj
]
Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RSP6F.tmp"
Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RSPDE.tmp"
<h3>Output Window</h3>
Compiling...
main.cpp
d:\ediv\trazador\main.cpp(51) : warning C4018: '<' : signed/unsigned mismatch
moc_trazadorwindow.cpp
trazadorwindow.cpp
Linking...
Creating library Debug/debug.lib and object Debug/debug.exp