sourcepawn/vm/sp_reader.c
changeset 47 50d5e52ded7e
parent 44 821e7544601e
child 49 6e490d2f1df5
     1.1 --- a/sourcepawn/vm/sp_reader.c	Tue Aug 01 23:17:13 2006 +0000
     1.2 +++ b/sourcepawn/vm/sp_reader.c	Tue Aug 01 23:40:32 2006 +0000
     1.3 @@ -39,10 +39,6 @@
     1.4  			plugin->data_size = dat->datasize;
     1.5  			plugin->memory = dat->memsize;
     1.6  		}
     1.7 -		else if (!(plugin->info->stringbase) && !strcmp(nameptr, ".names"))
     1.8 -		{
     1.9 -			plugin->info->stringbase = base + secptr->dataoffs;
    1.10 -		}
    1.11  		else if (!(plugin->info->publics) && !strcmp(nameptr, ".publics"))
    1.12  		{
    1.13  			plugin->info->publics_num = secptr->size / sizeof(sp_file_publics_t);
    1.14 @@ -58,25 +54,34 @@
    1.15  			plugin->info->natives_num = secptr->size / sizeof(sp_file_natives_t);
    1.16  			plugin->info->natives = (sp_file_natives_t *)(base + secptr->dataoffs);
    1.17  		}
    1.18 +		else if (!(plugin->info->stringbase) && !strcmp(nameptr, ".names"))
    1.19 +		{
    1.20 +			plugin->info->stringbase = base + secptr->dataoffs;
    1.21 +		}
    1.22  		else if (!(plugin->debug->files) && !strcmp(nameptr, ".dbg.files"))
    1.23  		{
    1.24 -			plugin->debug->files_num = secptr->size / sizeof(sp_fdbg_file_t);
    1.25  			plugin->debug->files = (sp_fdbg_file_t *)(base + secptr->dataoffs);
    1.26  		}
    1.27 +		else if (!(plugin->debug->lines) && !strcmp(nameptr, ".dbg.lines"))
    1.28 +		{
    1.29 +			plugin->debug->lines = (sp_fdbg_line_t *)(base + secptr->dataoffs);
    1.30 +		}
    1.31 +		else if (!(plugin->debug->symbols) && !strcmp(nameptr, ".dbg.symbols"))
    1.32 +		{
    1.33 +			plugin->debug->symbols = (sp_fdbg_symbol_t *)(base + secptr->dataoffs);
    1.34 +		}
    1.35 +		else if (!(plugin->debug->lines_num) && !strcmp(nameptr, ".dbg.info"))
    1.36 +		{
    1.37 +			sp_fdbg_info_t *inf = (sp_fdbg_info_t *)(base + secptr->dataoffs);
    1.38 +			plugin->debug->files_num = inf->num_files;
    1.39 +			plugin->debug->lines_num = inf->num_lines;
    1.40 +			plugin->debug->syms_num = inf->num_syms;
    1.41 +		}
    1.42  		else if (!(plugin->debug->stringbase) && !strcmp(nameptr, ".dbg.strings"))
    1.43  		{
    1.44  			plugin->debug->stringbase = base + secptr->dataoffs;
    1.45  		}
    1.46 -		else if (!(plugin->debug->lines) && !strcmp(nameptr, ".dbg.lines"))
    1.47 -		{
    1.48 -			plugin->debug->lines_num = secptr->size / sizeof(sp_fdbg_line_t);
    1.49 -			plugin->debug->lines = (sp_fdbg_line_t *)(base + secptr->dataoffs);
    1.50 -		}
    1.51 -		else if (!(plugin->debug->symbols) && !strcmp(nameptr, ".dbg.symbols"))
    1.52 -		{
    1.53 -			plugin->debug->syms_num = secptr->size / sizeof(sp_fdbg_symbol_t);
    1.54 -			plugin->debug->symbols = (sp_fdbg_symbol_t *)(base + secptr->dataoffs);
    1.55 -		}
    1.56 +
    1.57  		secptr++;
    1.58  		sectnum++;
    1.59  	}