/[gxemul]/trunk/src/file/file_aout.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/file/file_aout.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41 by dpavlin, Mon Oct 8 16:22:11 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: file_aout.c,v 1.2 2007/04/19 15:18:16 debug Exp $   *  $Id: file_aout.c,v 1.3 2007/06/15 17:02:39 debug Exp $
29   *   *
30   *  a.out file support.   *  a.out file support.
31   */   */
# Line 173  static void file_load_aout(struct machin Line 173  static void file_load_aout(struct machin
173                  off_t oldpos;                  off_t oldpos;
174    
175                  debug("symbols: %i bytes @ 0x%x\n", symbsize, (int)ftello(f));                  debug("symbols: %i bytes @ 0x%x\n", symbsize, (int)ftello(f));
176                  syms = malloc(symbsize);                  CHECK_ALLOCATION(syms = malloc(symbsize));
                 if (syms == NULL) {  
                         fprintf(stderr, "out of memory\n");  
                         exit(1);  
                 }  
177                  len = fread(syms, 1, symbsize, f);                  len = fread(syms, 1, symbsize, f);
178                  if (len != symbsize) {                  if (len != symbsize) {
179                          fprintf(stderr, "error reading symbols from %s\n",                          fprintf(stderr, "error reading symbols from %s\n",
# Line 190  static void file_load_aout(struct machin Line 186  static void file_load_aout(struct machin
186                  strings_len = ftello(f) - oldpos;                  strings_len = ftello(f) - oldpos;
187                  fseek(f, oldpos, SEEK_SET);                  fseek(f, oldpos, SEEK_SET);
188                  debug("strings: %i bytes @ 0x%x\n", strings_len,(int)ftello(f));                  debug("strings: %i bytes @ 0x%x\n", strings_len,(int)ftello(f));
189                  string_symbols = malloc(strings_len);                  CHECK_ALLOCATION(string_symbols = malloc(strings_len));
                 if (string_symbols == NULL) {  
                         fprintf(stderr, "out of memory\n");  
                         exit(1);  
                 }  
190                  fread(string_symbols, 1, strings_len, f);                  fread(string_symbols, 1, strings_len, f);
191    
192                  aout_symbol_ptr = (struct aout_symbol *) syms;                  aout_symbol_ptr = (struct aout_symbol *) syms;

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26