Fixed error handling in module initialization.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30908 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -87,13 +87,12 @@ disasm_command(int argc, char **argv)
|
|||||||
static status_t
|
static status_t
|
||||||
std_ops(int32 op, ...)
|
std_ops(int32 op, ...)
|
||||||
{
|
{
|
||||||
status_t err;
|
|
||||||
|
|
||||||
if (op == B_MODULE_INIT) {
|
if (op == B_MODULE_INIT) {
|
||||||
err = disasm_arch_init();
|
status_t err = disasm_arch_init();
|
||||||
if (err < 0)
|
if (err != B_OK)
|
||||||
return err;
|
return err;
|
||||||
return add_debugger_command_etc("dis", disasm_command,
|
|
||||||
|
err = add_debugger_command_etc("dis", disasm_command,
|
||||||
"Print disassembly at address",
|
"Print disassembly at address",
|
||||||
"[ -b <back count> ] [ <address> [ <count> ] ]\n"
|
"[ -b <back count> ] [ <address> [ <count> ] ]\n"
|
||||||
"Prints disassembly at address.\n"
|
"Prints disassembly at address.\n"
|
||||||
@@ -103,6 +102,9 @@ std_ops(int32 op, ...)
|
|||||||
" starting at <address>.\n"
|
" starting at <address>.\n"
|
||||||
" -b <back count> - Number of instruction to disassemble before\n"
|
" -b <back count> - Number of instruction to disassemble before\n"
|
||||||
" <address>.\n", 0);
|
" <address>.\n", 0);
|
||||||
|
if (err != B_OK)
|
||||||
|
disasm_arch_fini();
|
||||||
|
return err;
|
||||||
} else if (op == B_MODULE_UNINIT) {
|
} else if (op == B_MODULE_UNINIT) {
|
||||||
remove_debugger_command("dis", disasm_command);
|
remove_debugger_command("dis", disasm_command);
|
||||||
return disasm_arch_fini();
|
return disasm_arch_fini();
|
||||||
|
|||||||
Reference in New Issue
Block a user