Changeset 1590

Show
Ignore:
Timestamp:
03/06/08 17:33:47 (6 months ago)
Author:
common
Message:

libemu

  • emu_profile_function_argument_get arg0 is return value
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libemu/trunk/src/environment/emu_profile.c

    r1551 r1590  
    305305int copy_data(struct emu_profile_argument *argument, uint8_t *addr, uint8_t **next) 
    306306{ 
    307       printf("%s : %i \n", __PRETTY_FUNCTION__, __LINE__); 
     307//    printf("%s : %i \n", __PRETTY_FUNCTION__, __LINE__); 
    308308 
    309309        uint32_t *addr32 = (uint32_t *)addr; 
     
    388388void *emu_profile_function_argument_get(struct emu_profile_function *function, int argc) 
    389389{ 
    390         int i = 0; 
    391         struct emu_profile_argument *argument = emu_profile_arguments_first(function->arguments); 
    392  
    393         while (i < argc) 
    394         { 
    395                 argument = emu_profile_arguments_next(argument); 
    396                 i++; 
    397  
    398                 if (emu_profile_arguments_istail(argument)) 
    399                         return NULL; 
    400         } 
    401  
     390        struct emu_profile_argument *argument; 
     391 
     392        if ( argc == 0 ) 
     393        { 
     394                argument = function->return_value; 
     395        }else 
     396        { 
     397                int i = 1; 
     398                argument = emu_profile_arguments_first(function->arguments); 
     399                while ( i < argc ) 
     400                { 
     401                        argument = emu_profile_arguments_next(argument); 
     402                        i++; 
     403 
     404                        if ( emu_profile_arguments_istail(argument) ) 
     405                                return NULL; 
     406                } 
     407        } 
     408         
    402409        uint32_t size = 0; 
    403410        size = measure_size(argument, true); 
    404411 
    405       printf("%s size is %i\n", argument->argname, size); 
     412//    printf("%s size is %i\n", argument->argname, size); 
    406413 
    407414        uint8_t *data = malloc(size);