Changeset 25a76ab8 in mainline for kernel/generic/src/console/cmd.c


Ignore:
Timestamp:
2010-05-08T07:53:23Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
051bc69a
Parents:
6c39a907 (diff), 1317380 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/cmd.c

    r6c39a907 r25a76ab8  
    837837        bool pointer = false;
    838838        int rc;
    839 
    840         if (((char *)argv->buffer)[0] == '*') {
     839       
     840        if (((char *) argv->buffer)[0] == '*') {
    841841                rc = symtab_addr_lookup((char *) argv->buffer + 1, &addr);
    842842                pointer = true;
    843         } else if (((char *) argv->buffer)[0] >= '0' &&
    844                    ((char *)argv->buffer)[0] <= '9') {
    845                 rc = EOK;
    846                 addr = atoi((char *)argv->buffer);
    847         } else {
     843        } else if (((char *) argv->buffer)[0] >= '0' &&
     844                   ((char *) argv->buffer)[0] <= '9') {
     845                uint64_t value;
     846                rc = str_uint64((char *) argv->buffer, NULL, 0, true, &value);
     847                if (rc == EOK)
     848                        addr = (uintptr_t) value;
     849        } else
    848850                rc = symtab_addr_lookup((char *) argv->buffer, &addr);
    849         }
    850 
     851       
    851852        if (rc == ENOENT)
    852853                printf("Symbol %s not found.\n", argv->buffer);
     854        else if (rc == EINVAL)
     855                printf("Invalid address.\n");
    853856        else if (rc == EOVERFLOW) {
    854857                symtab_print_search((char *) argv->buffer);
    855                 printf("Duplicate symbol, be more specific.\n");
     858                printf("Duplicate symbol (be more specific) or address overflow.\n");
    856859        } else if (rc == EOK) {
    857860                if (pointer)
     
    859862                printf("Writing %#" PRIx64 " -> %p\n", arg1, addr);
    860863                *(uint32_t *) addr = arg1;
    861         } else {
     864        } else
    862865                printf("No symbol information available.\n");
    863         }
    864866       
    865867        return 1;
Note: See TracChangeset for help on using the changeset viewer.