frontend: add command to disassemble object files
This commit is contained in:
@@ -1,21 +1,21 @@
|
|||||||
#include "../debug.h"
|
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
|
|
||||||
#include <blue/cmd.h>
|
#include <blue/cmd.h>
|
||||||
#include <blue/term.h>
|
|
||||||
#include <blue/object/string.h>
|
#include <blue/object/string.h>
|
||||||
|
#include <blue/term.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ivy/file.h>
|
#include <ivy/asm/assembler.h>
|
||||||
#include <ivy/asm/lex.h>
|
#include <ivy/asm/lex.h>
|
||||||
#include <ivy/asm/parse.h>
|
#include <ivy/asm/parse.h>
|
||||||
#include <ivy/asm/assembler.h>
|
#include <ivy/file.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ARG_BIN_FILE,
|
ARG_BIN_FILE,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int disassemble(const b_command *cmd, const b_arglist *args, const b_array *_)
|
static int disassemble(
|
||||||
|
const b_command *cmd, const b_arglist *args, const b_array *_)
|
||||||
{
|
{
|
||||||
const char *in_path = NULL;
|
const char *in_path = NULL;
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ static int disassemble(const b_command *cmd, const b_arglist *args, const b_arra
|
|||||||
b_err("no input file specified.");
|
b_err("no input file specified.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,8 +32,7 @@ B_COMMAND(CMD_DISASSEMBLE, CMD_ROOT)
|
|||||||
{
|
{
|
||||||
B_COMMAND_NAME("disassemble");
|
B_COMMAND_NAME("disassemble");
|
||||||
B_COMMAND_SHORT_NAME('D');
|
B_COMMAND_SHORT_NAME('D');
|
||||||
B_COMMAND_DESC(
|
B_COMMAND_DESC("disassemble an Ivy object file.");
|
||||||
"disassemble an Ivy object file.");
|
|
||||||
B_COMMAND_FLAGS(B_COMMAND_SHOW_HELP_BY_DEFAULT);
|
B_COMMAND_FLAGS(B_COMMAND_SHOW_HELP_BY_DEFAULT);
|
||||||
B_COMMAND_FUNCTION(disassemble);
|
B_COMMAND_FUNCTION(disassemble);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user