/[gxemul]/trunk/src/symbol.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/symbol.c

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

revision 14 by dpavlin, Mon Oct 8 16:18:51 2007 UTC revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2003-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2003-2007  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: symbol.c,v 1.32 2005/09/26 00:08:02 debug Exp $   *  $Id: symbol.c,v 1.37 2006/12/30 13:30:52 debug Exp $
29   *   *
30   *  Address to symbol translation routines.   *  Address to symbol translation routines.
31   *   *
32   *  This module is (probably) independant from the rest of the emulator.   *  This module is (probably) independent from the rest of the emulator.
33   *  symbol_init() must be called before any other function in this   *  symbol_init() must be called before any other function in this file is used.
  *  file is used.  
34   */   */
35    
36  #include <stdio.h>  #include <stdio.h>
37  #include <stdlib.h>  #include <stdlib.h>
38  #include <string.h>  #include <string.h>
39    
 #include "misc.h"  
   
40  #include "symbol.h"  #include "symbol.h"
41    
42    
# Line 227  void add_symbol_name(struct symbol_conte Line 224  void add_symbol_name(struct symbol_conte
224                  exit(1);                  exit(1);
225          }          }
226    
227            if (addr == 0 && strcmp(name, "_DYNAMIC_LINK") == 0)
228                    return;
229    
230          if (name[0] == '\0')          if (name[0] == '\0')
231                  return;                  return;
232    
# Line 269  void add_symbol_name(struct symbol_conte Line 269  void add_symbol_name(struct symbol_conte
269                  exit(1);                  exit(1);
270          }          }
271    
272          s->name = strdup(name);          memset(s, 0, sizeof(struct symbol));
273    
274            s->name = symbol_demangle_cplusplus(name);
275    
276          if (s->name == NULL) {          if (s->name == NULL) {
277                  fprintf(stderr, "out of memory\n");                  s->name = strdup(name);
278                  exit(1);                  if (s->name == NULL) {
279                            fprintf(stderr, "out of memory\n");
280                            exit(1);
281                    }
282          }          }
283    
284          s->addr   = addr;          s->addr   = addr;
285          s->len    = len;          s->len    = len;
286          s->type   = type;          s->type   = type;

Legend:
Removed from v.14  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26