48 lines
951 B
C
48 lines
951 B
C
#include "cmd.h"
|
|
|
|
#include <blue/cmd.h>
|
|
#include <blue/object/string.h>
|
|
#include <blue/term.h>
|
|
#include <errno.h>
|
|
#include <ivy/asm/assembler.h>
|
|
#include <ivy/asm/lex.h>
|
|
#include <ivy/asm/parse.h>
|
|
#include <ivy/file.h>
|
|
#include <stdio.h>
|
|
|
|
enum {
|
|
ARG_BIN_FILE,
|
|
};
|
|
|
|
static int disassemble(
|
|
const b_command *cmd, const b_arglist *args, const b_array *_)
|
|
{
|
|
const char *in_path = NULL;
|
|
|
|
b_arglist_get_string(args, B_COMMAND_INVALID_ID, ARG_BIN_FILE, 0, &in_path);
|
|
if (!in_path) {
|
|
b_err("no input file specified.");
|
|
return -1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
B_COMMAND(CMD_DISASSEMBLE, CMD_ROOT)
|
|
{
|
|
B_COMMAND_NAME("disassemble");
|
|
B_COMMAND_SHORT_NAME('D');
|
|
B_COMMAND_DESC("disassemble an Ivy object file.");
|
|
B_COMMAND_FLAGS(B_COMMAND_SHOW_HELP_BY_DEFAULT);
|
|
B_COMMAND_FUNCTION(disassemble);
|
|
|
|
B_COMMAND_ARG(ARG_BIN_FILE)
|
|
{
|
|
B_ARG_NAME("input file");
|
|
B_ARG_DESC("the Ivy object file to disassemble.");
|
|
B_ARG_NR_VALUES(1);
|
|
}
|
|
|
|
B_COMMAND_HELP_OPTION();
|
|
}
|