* mi/mi-cmds.h (mi_cmd_target_flash_erase): New declaration.
* mi/mi-main.c (mi_cmd_target_flash_erase): New function.
* target.c (flash_erase_command): New function.
(initialize_targets): Add new flash-erase command.
* target.h (flash_erase_command): New declaration.
+@smallexample
+(gdb)
+-target-flash-erase
+^done,erased-regions=@{address="0x0",size="0x40000"@}
+(gdb)
+ current_uiout->message (", size = ");
+ current_uiout->field_fmt ("size", "0x%s", phex (m->hi - m->lo, 0));
phex always prints 64-bit hex numbers with leading "00000000". So
I think that instead of:
+^done,erased-regions=@{address="0x0",size="0x40000"@}
you're getting something like:
+^done,erased-regions=@{address="0x0",size="0x0000000000040000"@}
You can avoid that by using phex_nz instead. Or better, use
hex_string, and remove the "0x" from the string, since hex_string
already handles that.