From 749faf4107ce82f11972e42965ca94a9f6c80927 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Mon, 29 Mar 2010 17:27:22 +1300 Subject: [PATCH] Expand symbols for indexed addressing, allow . and : in symbols. --- dis.c | 10 ++++++++-- stab.c | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dis.c b/dis.c index f27718f..8f80bab 100644 --- a/dis.c +++ b/dis.c @@ -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); diff --git a/stab.c b/stab.c index 89c8920..a4acce1 100644 --- a/stab.c +++ b/stab.c @@ -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 {