Expand symbols for indexed addressing, allow . and : in symbols.

This commit is contained in:
Daniel Beer 2010-03-29 17:27:22 +13:00
parent 9afbc30778
commit 749faf4107
2 changed files with 10 additions and 3 deletions

10
dis.c
View File

@ -544,8 +544,14 @@ static int format_operand(char *buf, int max_len,
return snprintf(buf, max_len, "%s", msp430_reg_names[reg]);
case MSP430_AMODE_INDEXED:
return snprintf(buf, max_len, "0x%x(%s)", (u_int16_t)addr,
msp430_reg_names[reg]);
{
int len = format_addr(buf, max_len, "", addr);
len += snprintf(buf + len,
max_len - len,
"(%s)", msp430_reg_names[reg]);
return len;
}
case MSP430_AMODE_SYMBOLIC:
return format_addr(buf, max_len, "", addr);

3
stab.c
View File

@ -293,7 +293,8 @@ int stab_parse(const char *text, int *addr)
token_sum = 0;
while (*text) {
if (isalnum(*text) || *text == '_' || *text == '$') {
if (isalnum(*text) || *text == '_' || *text == '$' ||
*text == '.' || *text == ':') {
if (token_len + 1 < sizeof(token_buf))
token_buf[token_len++] = *text;
} else {