dlbeer / mspdebug

Debugging tool for MSP430 MCUs
GNU General Public License v2.0
190 stars 80 forks source link

Add lowercase_dis option #50

Closed tgtakaoka closed 6 years ago

tgtakaoka commented 6 years ago

The lowercase_dis option, if set to true, changes instruction and register names of disassembler command to lower case. This can be matched with hexadecimal dump of raw instruction and address. It also matches with GNU debugger and assembler.

tgtakaoka commented 6 years ago

Hi, Daniel. Thank you for creating and maintaining mspdebug command. This pull request add an option to change the output of disassemble command to lower case text.

I'm aware of a minor performance issue because of calling opdb_get_boolean a few times for every line of disassemble output. I'm happy to add cache or O(1) lookup to opdb.c. Please let me know.

Thanks.

dlbeer commented 6 years ago

I think this is a good idea, and I'm happy to include such an option, but would it not be easier to just convert the output to lowercase in dis_format(), rather than maintaining an upper and a lowercase version of every mnemonic and register name in the tables?

tgtakaoka commented 6 years ago

Hi, Daniel. As you suggested, I reverted dis.c and move lowercase conversion to output_util.c. Please take a look again?

dlbeer commented 6 years ago

Looks good to me -- thanks!