/[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 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: symbol.c,v 1.38 2007/04/22 14:32:01 debug Exp $   *  $Id: symbol.c,v 1.39 2007/06/15 17:02:38 debug Exp $
29   *   *
30   *  Address to symbol translation routines.   *  Address to symbol translation routines.
31   *   *
# Line 253  void add_symbol_name(struct symbol_conte Line 253  void add_symbol_name(struct symbol_conte
253          if ((addr >> 32) == 0 && (addr & 0x80000000ULL))          if ((addr >> 32) == 0 && (addr & 0x80000000ULL))
254                  addr |= 0xffffffff00000000ULL;                  addr |= 0xffffffff00000000ULL;
255    
256          s = malloc(sizeof(struct symbol));          CHECK_ALLOCATION(s = malloc(sizeof(struct symbol)));
         if (s == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
   
257          memset(s, 0, sizeof(struct symbol));          memset(s, 0, sizeof(struct symbol));
258    
259          s->name = symbol_demangle_cplusplus(name);          s->name = symbol_demangle_cplusplus(name);
260    
261          if (s->name == NULL) {          if (s->name == NULL)
262                  s->name = strdup(name);                  CHECK_ALLOCATION(s->name = strdup(name));
                 if (s->name == NULL) {  
                         fprintf(stderr, "out of memory\n");  
                         exit(1);  
                 }  
         }  
263    
264          s->addr   = addr;          s->addr   = addr;
265          s->len    = len;          s->len    = len;
# Line 375  void symbol_recalc_sizes(struct symbol_c Line 365  void symbol_recalc_sizes(struct symbol_c
365          struct symbol *tmp_ptr;          struct symbol *tmp_ptr;
366          int i;          int i;
367    
368          tmp_array = malloc(sizeof (struct symbol) * sc->n_symbols);          CHECK_ALLOCATION(tmp_array = malloc(sizeof (struct symbol) *
369          if (tmp_array == NULL) {              sc->n_symbols));
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
370    
371          /*  Copy first_symbol --> tmp_array, and remove the old          /*  Copy first_symbol --> tmp_array, and remove the old
372                  first_symbol at the same time:  */                  first_symbol at the same time:  */

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

  ViewVC Help
Powered by ViewVC 1.1.26