Gintracer v0.8.4 - Fix driver error

@fix
<> USB driver uninstallation (uninstall only when the driver is installed)
This commit is contained in:
Yatis 2021-03-14 21:33:44 +01:00
parent c2b41bbbd0
commit d1bea31365
3 changed files with 14 additions and 11 deletions

Binary file not shown.

View File

@ -38,6 +38,7 @@ struct tsession *tracer_create_session(void *address, int menu)
menu_register(session->display.gmenu, &menu_callgraph, "CallG");
/* force install the UBC driver */
//FIXME: move me into tracer_set_session !!
ubc_install();
ubc_set_handler(&gintrace_handler);
ubc_set_breakpoint(0, address, NULL);

View File

@ -58,17 +58,19 @@ void ubc_install(void)
/* ubc_uninstall(): Uninstall the UBC driver */
void ubc_uninstall(void)
{
ubctx.cbr0 = SH7305_UBC.CBR0.lword;
ubctx.crr0 = SH7305_UBC.CRR0.lword;
ubctx.car0 = SH7305_UBC.CAR0;
ubctx.camr0 = SH7305_UBC.CAMR0;
ubctx.cbr1 = SH7305_UBC.CBR1.lword;
ubctx.crr1 = SH7305_UBC.CRR1.lword;
ubctx.car1 = SH7305_UBC.CAR1;
ubctx.camr1 = SH7305_UBC.CAMR1;
ubctx.cdr1 = SH7305_UBC.CDR1;
ubctx.cdmr1 = SH7305_UBC.CDMR1;
ubctx.cdr1 = SH7305_UBC.CETR1.lword;
if (ubc_driver_installed == 1) {
ubctx.cbr0 = SH7305_UBC.CBR0.lword;
ubctx.crr0 = SH7305_UBC.CRR0.lword;
ubctx.car0 = SH7305_UBC.CAR0;
ubctx.camr0 = SH7305_UBC.CAMR0;
ubctx.cbr1 = SH7305_UBC.CBR1.lword;
ubctx.crr1 = SH7305_UBC.CRR1.lword;
ubctx.car1 = SH7305_UBC.CAR1;
ubctx.camr1 = SH7305_UBC.CAMR1;
ubctx.cdr1 = SH7305_UBC.CDR1;
ubctx.cdmr1 = SH7305_UBC.CDMR1;
ubctx.cdr1 = SH7305_UBC.CETR1.lword;
}
}
/* ubc_set_breakpoint(): Setup one breakpoint */